public override void handleMessage(QTMessage message) { switch (message.messageType) { case QTMessage.type.REQUEST_ROOMS: RequestRoomsMessage requestMessage = (RequestRoomsMessage)message; MasterServerQTClient qtRemoteClient = (MasterServerQTClient)client; RoomsMessage roomsMessage = new RoomsMessage(requestMessage); roomsMessage.rooms = MasterServerManager.instance.workersManager.getRooms(); qtRemoteClient.sendMessage(roomsMessage); break; } }
public void handleMasterConnected(QTClient client) { QTDebugger.instance.debug(QTDebugger.debugType.BASE, "Started master client..."); state = componentState.RUNNING; RequestRoomsMessage message = new RequestRoomsMessage(); message.onResponse += (QTResponsableMessage message) => { RoomsMessage roomsMesage = (RoomsMessage)message; rooms = roomsMesage.rooms; onRoomsUpdated(); }; client.sendMessage(message); }