public int regServer(String nikeName,String pwd){
	 try{
		 MsgReg mrg=new MsgReg();
		 mrg.setTotalLen(4+1+4+4+10+10);
		 mrg.setType(IMsgConstance.command_reg);
		 mrg.setDest(IMsgConstance.Server_JK_NUMBER);
		 mrg.setSrc(0);
		 mrg.setNikeName(nikeName);
		 mrg.setPwd(pwd);
		  this.sendMsg(mrg);
	//˵½֮,һӦϢ
	  MsgHead loginResp=readFromServer();
	  MsgRegResp mr=(MsgRegResp)loginResp;
	  if(mr.getState()==0){//עɹ!
	  return mr.getDest();
	  }
	 }catch(Exception ef){ef.printStackTrace();}
	 return -1;
 }