protected async Task StartReceiverAsync(Socket socket, int playerNumber) { while (_runReceivers) { await Task.Delay(1); var message = Message.ReceiveMessage(socket); if (message.MessageType == MessageType.NodeUpgradeRequest) { var request = SerializationUtilities.FromByteArray <NodeUpgradeRequest>(message.Data); _handler.HandleNodeUpgradeRequestMessage(request, playerNumber); } } }
protected async Task StartReceiverAsync(Socket socket) { while (_runReceiver) { await Task.Delay(1); var message = Message.ReceiveMessage(socket); if (message.MessageType == MessageType.GameState) { var state = SerializationUtilities.FromByteArray <GameState>(message.Data); _handler.HandleGameStateMessage(state); } } }