// 请求消息 public void RequireRoleList() { NFMsg.ReqRoleList xData = new NFMsg.ReqRoleList(); xData.game_id = NFCLoginLogic.Instance().mServerID; xData.account = UnicodeEncoding.Default.GetBytes(NFCLoginLogic.Instance().mAccount); MemoryStream stream = new MemoryStream(); Serializer.Serialize <NFMsg.ReqRoleList>(stream, xData); NFCNetLogic.Instance().SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_ROLE_LIST, stream); Debug.Log("RequireRoleList"); }
public void RequireEnterGameServer(int nRoleIndex) { m_nRoleIndex = nRoleIndex; Debug.Log("RequireEnterGameServer:" + nRoleIndex); NFMsg.RoleLiteInfo info = (NFMsg.RoleLiteInfo)mRoleList[nRoleIndex]; NFMsg.ReqEnterGameServer xData = new NFMsg.ReqEnterGameServer(); xData.name = info.noob_name; xData.account = UnicodeEncoding.Default.GetBytes(NFCLoginLogic.Instance().mAccount); xData.game_id = NFCLoginLogic.Instance().mServerID; xData.id = info.id; MemoryStream stream = new MemoryStream(); Serializer.Serialize <NFMsg.ReqEnterGameServer>(stream, xData); mRoleID = PBToNF(info.id); NFCNetLogic.Instance().mOwnerID = mRoleID; NFCNetLogic.Instance().SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_ENTER_GAME, stream); }
public void RequireCreateRole(string strRoleName, int byCareer, int bySex) { if (strRoleName.Length >= 20 || strRoleName.Length < 1) { return; } NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole(); xData.career = byCareer; xData.sex = bySex; xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName); xData.account = UnicodeEncoding.Default.GetBytes(NFCLoginLogic.Instance().mAccount); xData.race = 0; xData.game_id = NFCLoginLogic.Instance().mServerID; MemoryStream stream = new MemoryStream(); Serializer.Serialize <NFMsg.ReqCreateRole>(stream, xData); NFCNetLogic.Instance().SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream); }