public static void Handle_StartGame(ClientConnection Client, PacketReader reader, byte last) { Account User = Client.CurrentAccount; NormalRoom room = Rooms.GetRoom(User.CurrentRoomId); bool isRoomMaster = User.RoomPos == room.RoomMasterIndex; if (!room.CheckReadyPlayerNum(out int err)) { if (err > 0) { Client.SendAsync(new GameRoom_StartError(err, last)); } return; } bool CanStart = room.CheckCanStart(out int ErrorCode); if (isRoomMaster && CanStart) { Log.Info("Start game CountDown"); room.MapNum = reader.ReadLEInt32(); //mapid room.isPlaying = true; room.BroadcastToAll(new GameRoom_Hex("FF0703", last)); //307 if (!room.is8Player) { room.StartTimeoutCountDownThread(); } } else if (isRoomMaster && !CanStart) { if (ErrorCode == 3) { Client.SendAsync(new GameRoom_CannotStart((byte)ErrorCode, last)); } if (ErrorCode > 0 && ErrorCode != 1) { Client.SendAsync(new GameRoom_StartError(ErrorCode, last)); } if (ErrorCode == 1) { Client.SendAsync(new GameRoom_CannotStart((byte)ErrorCode, last)); } } }