public void RequestGameEnd(ServerPacketData packetData) { var sessionID = packetData.SessionID; var roomObject = CheckRoomAndRoomUser(packetData.SessionID); if (roomObject.Item1 == false) { return; } var room = roomObject.Item2; if (room.IsGamming == false) { return; } var resPacket = new GameEndResPacket(); resPacket.Result = (Int16)ERROR_CODE.NONE; resPacket.Decode(packetData.BodyData); ServerNetwork.SendData(sessionID, (UInt16)CL_PACKET_ID.RES_GAME_END, resPacket.ToBytes()); room.Broadcast((UInt16)CL_PACKET_ID.NTF_GAME_END, null); room.IsGamming = false; }
void ResponseLoginToClient(ERROR_CODE errorCode, string sessionID) { var resLogin = new LoginResPacket() { Result = (short)errorCode }; ServerNetwork.SendData(sessionID, (UInt16)CL_PACKET_ID.RES_GAME_LOGIN, resLogin.ToBytes()); }
public void ResponseLoginToClient(ERROR_CODE errorCode, string sessionID) { var resLogin = new PKTResLogin() { Result = (short)errorCode }; var bodyData = MessagePackSerializer.Serialize(resLogin); var sendData = PacketToBytes.Make(PACKETID.RES_LOGIN, bodyData); ServerNetwork.SendData(sessionID, sendData); }
public void NotifyMustCloseToClient(ERROR_CODE errorCode, string sessionID) { var resLogin = new PKNtfMustClose() { Result = (short)errorCode }; var bodyData = MessagePackSerializer.Serialize(resLogin); var sendData = PacketToBytes.Make(PACKETID.NTF_MUST_CLOSE, bodyData); ServerNetwork.SendData(sessionID, sendData); }
void ResponseEnterRoomToClient(ERROR_CODE errorCode, string sessionID) { var resRoomEnter = new PKTResRoomEnter() { Result = (short)errorCode }; var bodyData = MessagePackSerializer.Serialize(resRoomEnter); var sendData = PacketToBytes.Make(PACKETID.RES_ROOM_ENTER, bodyData); ServerNetwork.SendData(sessionID, sendData); }