public override void copyFrom(GameUpdateMessage msg) { base.copyFrom(msg); var lifMsg = (BodyLifetimeUpdateMessage)msg; exists = lifMsg.exists; }
public override void copyFrom(GameUpdateMessage msg) { base.copyFrom(msg); // call base copy var bodyMsg = (BodyUpdateMessage)msg; bodyId = bodyMsg.bodyId; syncTag = bodyMsg.syncTag; }
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; }
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)); } }
/// <summary> /// immediately send a game update /// </summary> /// <param name="msg"></param> public void sendGameUpdate(GameUpdateMessage msg) { msg.sourceUid = node.uid; node.sendToAll(msg); }
/// <summary> /// queue a game update to be sent at next update /// </summary> /// <param name="msg"></param> public void queueGameUpdate(GameUpdateMessage msg) { outgoingGameUpdates.Enqueue(msg); }
public virtual void copyFrom(GameUpdateMessage msg) { time = msg.time; sourceUid = msg.sourceUid; }
public void NotifyGameDataUpdated(GameUpdateMessage updateMessage) { Observable.ToAsync( () => ClientEvents.GameUpdateDataReceived.Publish(new ClientDataEventArgs <GameUpdateData>(updateMessage.Data)), _scheduler)(); }