Beispiel #1
0
    void ProcessData(Telepathy.Message msg)
    {
        string TheMessage = utf8.GetString(msg.data);

        Debug.Log(TheMessage);
        string[] SplitMessage = TheMessage.Split('/');

        if (SplitMessage[0].ToLower() == "pj")
        {
            OnPlayerJoin(System.Convert.ToInt32(SplitMessage[1]));
        }

        if (SplitMessage[0].ToLower() == "pl")
        {
            ClientDisconnected(System.Convert.ToInt32(SplitMessage[1]));
        }
    }
Beispiel #2
0
    void ClientDisconnected(Telepathy.Message msg)
    {
        //for every player in list remove client from list
        for (int i = 0; i < Players.Count; i++)
        {
            //if item in list is the same as the connection lost then remove that player from list
            if (Players[i].connectionId == msg.connectionId)
            {
                //delete that player.
                RemovePlayer(Players[i], i);

                TEST(msg.connectionId);
            }
        }


        Debug.Log("Client DC = " + msg.connectionId);
    }
Beispiel #3
0
    void ProcessData(Telepathy.Message msg)
    {
        string TheMessage = utf8.GetString(msg.data);

        string[] SplitMessage = TheMessage.Split('/');
    }
Beispiel #4
0
 void ClientConnected(Telepathy.Message msg)
 {
     //add player.
     AddPlayer(0, -0, msg.connectionId, Resources.Load("Player/Player") as GameObject, PlayerData.PlayerStatus.Connected);
     SendClientConnected();
 }