[Orxonox-commit 561] r3102 - in trunk/src/network: . synchronisable
scheusso at orxonox.net
scheusso at orxonox.net
Thu May 28 03:05:54 CEST 2009
Author: scheusso
Date: 2009-05-28 03:05:54 +0200 (Thu, 28 May 2009)
New Revision: 3102
Modified:
trunk/src/network/GamestateClient.cc
trunk/src/network/GamestateManager.cc
trunk/src/network/Server.cc
trunk/src/network/synchronisable/SynchronisableVariable.h
Log:
fixed some problems when changing the gamestate (from menu to server i.e.)
Modified: trunk/src/network/GamestateClient.cc
===================================================================
--- trunk/src/network/GamestateClient.cc 2009-05-28 00:41:15 UTC (rev 3101)
+++ trunk/src/network/GamestateClient.cc 2009-05-28 01:05:54 UTC (rev 3102)
@@ -110,7 +110,7 @@
packet::Gamestate *GamestateClient::getGamestate(){
packet::Gamestate *gs = new packet::Gamestate();
- if(!gs->collectData(0)){
+ if(!gs->collectData(0,0x2)){
delete gs;
return 0;
}
@@ -171,7 +171,7 @@
gs=undiffed;
COUT(5) << "successfully undiffed gamestate id: " << undiffed->getID() << std::endl;
}
- if(gs->spreadData())
+ if(gs->spreadData(0x2))
return gs;
else
{
Modified: trunk/src/network/GamestateManager.cc
===================================================================
--- trunk/src/network/GamestateManager.cc 2009-05-28 00:41:15 UTC (rev 3101)
+++ trunk/src/network/GamestateManager.cc 2009-05-28 01:05:54 UTC (rev 3102)
@@ -101,7 +101,7 @@
if ( reference != 0 )
delete reference;
reference = new packet::Gamestate();
- if(!reference->collectData(++id_)){ //we have no data to send
+ if(!reference->collectData(++id_, 0x1)){ //we have no data to send
delete reference;
reference=0;
}
@@ -199,7 +199,7 @@
assert(b);
}
assert(!gs->isDiffed());
- return gs->spreadData();
+ return gs->spreadData(0x1);
}
}
Modified: trunk/src/network/Server.cc
===================================================================
--- trunk/src/network/Server.cc 2009-05-28 00:41:15 UTC (rev 3101)
+++ trunk/src/network/Server.cc 2009-05-28 01:05:54 UTC (rev 3102)
@@ -363,7 +363,7 @@
assert(b);
packet::Gamestate *g = new packet::Gamestate();
g->setClientID(temp->getID());
- b = g->collectData(0);
+ b = g->collectData(0,0x1);
if(!b)
return false; //no data for the client
b = g->compressData();
Modified: trunk/src/network/synchronisable/SynchronisableVariable.h
===================================================================
--- trunk/src/network/synchronisable/SynchronisableVariable.h 2009-05-28 00:41:15 UTC (rev 3101)
+++ trunk/src/network/synchronisable/SynchronisableVariable.h 2009-05-28 01:05:54 UTC (rev 3102)
@@ -121,7 +121,7 @@
template <class T> inline uint32_t SynchronisableVariable<T>::getData(uint8_t*& mem, uint8_t mode)
{
- if ( state_ == this->mode_ )
+ if ( mode == this->mode_ )
{
saveAndIncrease( this->variable_, mem );
return returnSize( this->variable_ );
More information about the Orxonox-commit
mailing list