Ejemplo n.º 1
0
        // when using the new protocol, this object replaces
        // Client.m_PendingPlayerSnapshotMessages
        //public static Queue<NewPlayerSnapshotToClientMessage> m_PendingPlayerSnapshotMessages = new Queue<NewPlayerSnapshotToClientMessage>();

        public static void OnNewPlayerSnapshotToClient(NetworkMessage msg)
        {
            if (NetworkMatch.GetMatchState() == MatchState.PREGAME || NetworkMatch.InGameplay())
            {
                NewPlayerSnapshotToClientMessage item = msg.ReadMessage <NewPlayerSnapshotToClientMessage>();
                MPClientShipReckoning.AddNewPlayerSnapshot(item);
            }
        }
Ejemplo n.º 2
0
 public static bool Prefix(NetworkMessage msg)
 {
     if (NetworkMatch.GetMatchState() == MatchState.PREGAME || NetworkMatch.InGameplay())
     {
         PlayerSnapshotToClientMessage    item    = msg.ReadMessage <PlayerSnapshotToClientMessage>();
         NewPlayerSnapshotToClientMessage newItem = new NewPlayerSnapshotToClientMessage {
             m_num_snapshots    = item.m_num_snapshots,
             m_server_timestamp = 0, // Unused.
             m_snapshots        = item.m_snapshots.Select(m => NewPlayerSnapshot.FromOldSnapshot(m)).ToArray()
         };
         MPClientShipReckoning.AddNewPlayerSnapshot(newItem, true);
     }
     return(false);
 }