Пример #1
0
 /// <summary>
 /// Handles sending out movement update messages to appropriate toons
 /// </summary>
 /// <param name="syncClient"></param>
 /// <param name="serial"></param>
 private void SendMovementUpdate(MoveRequest syncClient, int serial)
 {
     SyncObjectLocation m = new SyncObjectLocation();
     m.Serial = serial;
     m.Location = new Vector3D(syncClient.Location);
     foreach (Account p in Toons)
         if (p.CurrentToon.Serial != serial)
             m.Send(p.Client.GetStream());
     Logger.Log("Sent SyncMobile to: " + Toons.Count + " players");
 }
Пример #2
0
 public void SyncPlayer(CharacterMotor m)
 {
     //Logger.Log("Syncing");
     if (_stream != null && bConnected) {
         MoveRequest a = new MoveRequest(m.transform.position.x, m.transform.position.y, m.transform.position.z);
         //SyncClient sync = new SyncClient(m.transform.position.x, m.transform.position.y, 0);
         Send(a);
     }
 }
Пример #3
0
 private void handleMoveRequest(Toon p, MoveRequest syncClient)
 {
     Logger.Log(p.Name + " Moved to " + syncClient.Location);
     p.Location.Set(syncClient.Location);
     SendMovementUpdate(syncClient, p.Serial);
 }