private static void Postfix() { if (Overload.NetworkManager.IsServer()) { return; } MPClientShipReckoning.ResetForNewMatch(); }
// 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); } }
static bool Prefix() { // This function is called once per frame from Client.Update() if (Overload.NetworkManager.IsServer() || (NetworkMatch.m_match_state != MatchState.PLAYING && NetworkMatch.m_match_state != MatchState.POSTGAME)) { // no need to move ships around return(false); } MPClientShipReckoning.updatePlayerPositions(); return(false); }
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); }