private void OnReceiveConfirmMessage(NetworkMessage pMessage) { SnakeConfirmMessage _msg = pMessage.ReadMessage <SnakeConfirmMessage>(); Debug.Log("OnReceiveConfirmMessage " + _msg.snakeId); if (isServer) { Debug.Log("SendToAll " + _msg.snakeId); NetworkServer.SendToAll(snake_msg, _msg); } game.OnReceiveConfirmMessage(_msg); }
public void SendConfirmMessage(int pSnakeId, EDirection pDirection) { if (!IsMultiplayer()) { return; } Debug.Log($"SendMessage {pSnakeId} - {pDirection}"); SnakeConfirmMessage msg = new SnakeConfirmMessage(); msg.snakeId = pSnakeId; msg.direction = pDirection; NetworkManager.singleton.client.Send(snake_msg, msg); }
public void OnReceiveConfirmMessage(SnakeConfirmMessage pMessage) { Snake snake = GetSnake(pMessage.snakeId); snake.OnReceiveConfirmMessage(pMessage); }
internal void OnReceiveConfirmMessage(SnakeConfirmMessage pMessage) { SetDirection(pMessage.direction); ConfirmActions(false); }