Use a correct queue to save network state
This commit is contained in:
@@ -398,7 +398,7 @@ void GameProtocol::handleState(Event *event)
|
||||
// The memory for bns will be handled in the RewindInfoState object
|
||||
RewindInfoState* ris = new RewindInfoState(ticks, data.getCurrentOffset(),
|
||||
rewinder_using, data.getBuffer());
|
||||
RewindManager::get()->addRewindInfo(ris);
|
||||
RewindManager::get()->addNetworkRewindInfo(ris);
|
||||
} // handleState
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -203,7 +203,8 @@ public:
|
||||
void addRewindInfoEventFunction(RewindInfoEventFunction* rief)
|
||||
{ m_pending_rief.push_back(rief); }
|
||||
// ------------------------------------------------------------------------
|
||||
void addRewindInfo(RewindInfo* ri) { m_rewind_queue.insertRewindInfo(ri); }
|
||||
void addNetworkRewindInfo(RewindInfo* ri)
|
||||
{ m_rewind_queue.addNetworkRewindInfo(ri); }
|
||||
|
||||
}; // RewindManager
|
||||
|
||||
|
||||
@@ -70,6 +70,12 @@ public:
|
||||
void addNetworkEvent(EventRewinder *event_rewinder,
|
||||
BareNetworkString *buffer, int ticks);
|
||||
void addNetworkState(BareNetworkString *buffer, int ticks);
|
||||
void addNetworkRewindInfo(RewindInfo* ri)
|
||||
{
|
||||
m_network_events.lock();
|
||||
m_network_events.getData().push_back(ri);
|
||||
m_network_events.unlock();
|
||||
}
|
||||
void mergeNetworkData(int world_ticks, bool *needs_rewind,
|
||||
int *rewind_ticks);
|
||||
void replayAllEvents(int ticks);
|
||||
|
||||
Reference in New Issue
Block a user