Beispiel #1
0
 private void OnConnected(NetworkMessage netMsg)
 {
     Debug.LogWarning("Connected !");
     if (reqMaster)
     {
     }
     else
     {
         QA.Invoke <int>("Connected", ClientCommand.identity.connectionId);
         client.Send(ImServices.MSG_COMMAND, ClientCommand.identity);
     }
 }
Beispiel #2
0
 private void OnDisonnected(NetworkMessage netMsg)
 {
     Debug.LogWarning("Disconnected !");
     if (reqMaster)
     {
         ImServices.players.Remove(netMsg.conn.connectionId);
     }
     else
     {
         if (client != null)
         {
             client = null;
         }
         QA.Invoke("Disconnected");
         Invoke("Connect", 1f);
     }
 }
Beispiel #3
0
 public void Connect()
 {
     if (reqMaster)
     {
         match.CreateMatch("default", (uint)playGameNum + 1, true, "", "", "", 0, reqDomain, OnMatchCreate);
     }
     else
     {
         if (client != null)
         {
             ClientCommand.identity.catId = GM.configs["貓咪"];
             ClientCommand.identity.id    = 0;
             QA.Invoke <int>("Connected", ClientCommand.identity.connectionId);
             client.Send(ImServices.MSG_COMMAND, ClientCommand.identity);
         }
         else
         {
             match.ListMatches(0, 10, "", false, 0, reqDomain, OnMatchList);
         }
     }
 }
Beispiel #4
0
 private void OnGameEndFromServer(NetworkMessage netMsg)
 {
     QA.Invoke <int>("GameEnd", netMsg.ReadMessage <IntegerMessage>().value);
 }
Beispiel #5
0
 private void OnGameFromServer(NetworkMessage netMsg)
 {
     GM.time = netMsg.ReadMessage <IntegerMessage>().value;
     QA.Invoke("Game");
 }
Beispiel #6
0
 private void OnCommandFromServer(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <ClientSyncEvent>(ClientSyncEvent.identity);
     QA.Invoke <ClientSyncEvent>("Event", ClientSyncEvent.identity);
 }