//登录完成 public void CreateLogonFinish(byte[] tmpBuf, int size) { if (GlobalDataScript.Instance.playerInfos == null) { GlobalDataScript.Instance.playerInfos = new List <PlayerGameRoomInfo>();//登录完成初玩家始化信息 } if (GlobalDataScript.type == ModeType.Create) { nnCreateRoom(); } else { if ((playStatue)myStatue < playStatue.US_SIT) { CMD_GR_UserSitDown sitDown = new CMD_GR_UserSitDown(); sitDown.wTableID = (ushort)tableId; sitDown.wChairID = 0xff; //if (chairId == -1) // sitDown.wChairID = 0xff; //else if ((playStatue)myStatue >= playStatue.US_SIT) // sitDown.wChairID = (byte)chairId; sitDown.szPassword = new byte[66]; SocketEngine.Instance.SendScoketData((int)GameServer.MDM_GR_USER, (int)MDM_GR_USER.SUB_GR_USER_SITDOWN, NetUtil.StructToBytes(sitDown), Marshal.SizeOf(sitDown)); return; } CMD_GR_ChairUserInfoReq chairInfo = new CMD_GR_ChairUserInfoReq(); chairInfo.wChairID = (byte)chairId; chairInfo.wTableID = (byte)tableId; SocketEngine.Instance.SendScoketData((int)GameServer.MDM_GR_USER, (int)MDM_GR_USER.SUB_GR_USER_CHAIR_INFO_REQ, NetUtil.StructToBytes(chairInfo), Marshal.SizeOf(chairInfo)); } }
public void SendUserSitDown(UInt32 RoomID, UInt32 Desk, UInt32 Chair, string pwd) { var sitdown = new CMD_GR_UserSitDown(); sitdown.szPassword = pwd; sitdown.wChairID = (ushort)Chair; sitdown.wTableID = (ushort)Desk; byte[] dataBuffer = GameConvert.StructToByteArray(sitdown); GameApp.Network.SendToSvr(ConnectionID.Game, MainCommand.MDM_GR_USER, SubCommand.SUB_GR_USER_SITDOWN, 0, dataBuffer); }
//创建房间成功 public void CreateSuccess(byte[] tmpBuf, int size) { CMD_GR_CreateSuccess createSuccess = NetUtil.BytesToStruct <CMD_GR_CreateSuccess>(tmpBuf); MyDebug.Log("房间号" + NetUtil.BytesToString(createSuccess.szServerID)); tableId = (ushort)createSuccess.dwTableId; CMD_GR_UserSitDown sitDown = new CMD_GR_UserSitDown(); sitDown.wTableID = (ushort)tableId; sitDown.wChairID = 0; sitDown.szPassword = new byte[66]; SocketEngine.Instance.SendScoketData((int)GameServer.MDM_GR_USER, (int)MDM_GR_USER.SUB_GR_USER_SITDOWN, NetUtil.StructToBytes(sitDown), Marshal.SizeOf(sitDown)); }
private bool OnSocketSubLogonFinish(byte[] data, int dataSize) { byte[] szPassword = new byte[33]; CMD_GR_UserSitDown UserSitReq = new CMD_GR_UserSitDown { wTableID = (ushort)Define.INVALID_TABLE, wChairID = (ushort)Define.INVALID_CHAIR, szPassword = szPassword }; byte[] temp = NetUtil.StructToBytes(UserSitReq); //发送数据包 SocketSendManager.Instance.SendData((int)GameServer.MDM_GR_USER, (int)MDM_GR_USER.SUB_GR_USER_SITDOWN, temp, Marshal.SizeOf(UserSitReq)); return(true); //TODO: }