コード例 #1
0
        public override void copyFrom(GameUpdateMessage msg)
        {
            base.copyFrom(msg);
            var lifMsg = (BodyLifetimeUpdateMessage)msg;

            exists = lifMsg.exists;
        }
コード例 #2
0
ファイル: BodyUpdate.cs プロジェクト: xdrie/Glint.Networking
        public override void copyFrom(GameUpdateMessage msg)
        {
            base.copyFrom(msg); // call base copy
            var bodyMsg = (BodyUpdateMessage)msg;

            bodyId  = bodyMsg.bodyId;
            syncTag = bodyMsg.syncTag;
        }
コード例 #3
0
        public override void copyFrom(GameUpdateMessage msg)
        {
            base.copyFrom(msg);
            var kinMsg = (BodyKinematicUpdateMessage)msg;

            pos             = kinMsg.pos.copy();
            vel             = kinMsg.vel.copy();
            angle           = kinMsg.angle;
            angularVelocity = kinMsg.angularVelocity;
        }
コード例 #4
0
ファイル: GameSyncer.cs プロジェクト: xdrie/Glint.Networking
 private void preprocessGameUpdate(GameUpdateMessage msg)
 {
     // check if we don't know the sender of this message, and then update their connectivity if necessary
     if (peers.All(x => x.uid != msg.sourceUid))
     {
         // this is a relayed message, so we don't know the remId. we set an empty for now
         // var peer = new NetPlayer(msg.sourceUid);
         // peers.Add(peer);
         // Global.log.trace($"implicitly introduced to peer {peer} via {msg.GetType().Name}");
         // connectivityUpdates.Enqueue(new ConnectivityUpdate(peer,
         //     ConnectivityUpdate.ConnectionStatus.Connected));
     }
 }
コード例 #5
0
ファイル: GameSyncer.cs プロジェクト: xdrie/Glint.Networking
 /// <summary>
 /// immediately send a game update
 /// </summary>
 /// <param name="msg"></param>
 public void sendGameUpdate(GameUpdateMessage msg)
 {
     msg.sourceUid = node.uid;
     node.sendToAll(msg);
 }
コード例 #6
0
ファイル: GameSyncer.cs プロジェクト: xdrie/Glint.Networking
 /// <summary>
 /// queue a game update to be sent at next update
 /// </summary>
 /// <param name="msg"></param>
 public void queueGameUpdate(GameUpdateMessage msg)
 {
     outgoingGameUpdates.Enqueue(msg);
 }
コード例 #7
0
 public virtual void copyFrom(GameUpdateMessage msg)
 {
     time      = msg.time;
     sourceUid = msg.sourceUid;
 }
コード例 #8
0
 public void NotifyGameDataUpdated(GameUpdateMessage updateMessage)
 {
     Observable.ToAsync(
         () => ClientEvents.GameUpdateDataReceived.Publish(new ClientDataEventArgs <GameUpdateData>(updateMessage.Data)),
         _scheduler)();
 }