Exemplo n.º 1
0
    private void WaitForConnection()
    {
        while (!SplashKit.HasNewConnections())
        {
            SplashKit.AcceptAllNewConnections();
        }

        ThisPeer.CheckNewConnections();
    }
Exemplo n.º 2
0
    public void UpdateNetworkInfo()
    {
        if (IsServer)
        {
            SplashKit.AcceptAllNewConnections();
        }


        _otherPlayerMsg = ThisPeer.GetNewMessages();

        UpdateOtherPlayer();

        BroadcastMessage();
    }
Exemplo n.º 3
0
    public void UpdateNetworkInfo()
    {
        if (IsServer)
        {
            SplashKit.AcceptAllNewConnections();
        }

        // ThisPeer.PrintNewMessages();

        _otherPlayerMsg = ThisPeer.GetNewMessages();

        UpdateOtherPlayer();

        //Console.WriteLine(ThisPeer.GetNewMessages());
        BroadcastMessage();
    }
Exemplo n.º 4
0
 private void BroadcastMessage()
 {
     ThisPeer.Broadcast($"{_player.Name},{_player.X},{_player.Y},{_player.Radius}");
 }