public void TranslateMessage(int clientID, MessageCreateRoomRequest message) { if (TranslatedMessageToMessageCreateRoomRequest != null) { TranslatedMessageToMessageCreateRoomRequest(clientID, message); } }
public void OnClientMessage_MessageCreateRoomRequest(int clientID, MessageCreateRoomRequest message, GameRoomManager gameRoomManager, GameClientManager gameClientManager) { var gameClient = gameClientManager.GetGameClientFromClientID(clientID); var gameRoomHost = new NetworkPlayer(gameClient.ID, gameClient.Name, 0); var roomID = gameRoomManager.CreateRoom(2, message.RoomName, clientID); gameRoomManager.AddPlayerToGameRoom(clientID, roomID, 0, true); var messageResponse = new MessageCreateRoomResponse(message.RoomName, roomID, gameRoomHost); SendDataToClient(gameClient, messageResponse); }
private void TheClientToServerMeossageTranslator_TranslatedMessageToMessageCreateRoomRequest(object clientID, MessageCreateRoomRequest e) { TheClientToServerMessenger.OnClientMessage_MessageCreateRoomRequest((int)clientID, e, TheGameRoomManager, TheGameClientManager); }