Example #1
0
    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);
    }
Example #2
0
    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);
    }
Example #3
0
    public void OnReceiveConfirmMessage(SnakeConfirmMessage pMessage)
    {
        Snake snake = GetSnake(pMessage.snakeId);

        snake.OnReceiveConfirmMessage(pMessage);
    }
Example #4
0
 internal void OnReceiveConfirmMessage(SnakeConfirmMessage pMessage)
 {
     SetDirection(pMessage.direction);
     ConfirmActions(false);
 }