public static RoomData FromColyseusRoom(string mode, RoomAvailable room) { return(new RoomData { Id = room.roomId, MaxClients = (int)room.maxClients, CurrentClients = (int)room.clients, Name = "Room " + room.roomId, Mode = mode, }); }
MatchMakeResponse GetResponseObject(object msg) { IndexedDictionary <string, object> message = (IndexedDictionary <string, object>)msg; IndexedDictionary <string, object> roomData = (IndexedDictionary <string, object>)message["room"]; RoomAvailable roomAvailable = new RoomAvailable(); roomAvailable.name = roomData["name"] as string; roomAvailable.processId = roomData["processId"] as string; roomAvailable.roomId = roomData["roomId"] as string; MatchMakeResponse response = new MatchMakeResponse(); response.room = roomAvailable; response.sessionId = message["sessionId"] as string; return(response); }