Changeset 2422 for code/branches
- Timestamp:
- Dec 13, 2008, 2:55:13 PM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/network/Synchronisable.cc
r2171 r2422 85 85 for(it = ObjectList<Synchronisable>::begin(); it!=ObjectList<Synchronisable>::end(); ++it){ 86 86 if( it->getObjectID()==this->objectID ) 87 assert(*it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0)); 87 if(!(*it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0))) 88 { 89 COUT(1) << "Assertion failed: *it==this || (it->objectID==OBJECTID_UNKNOWN && it->objectMode_==0x0)" << std::endl; 90 COUT(1) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl; 91 abort(); 92 } 88 93 } 89 94 #endif … … 177 182 178 183 Identifier* id = ClassByID(header->classID); 184 if (!id) 185 { 186 COUT(1) << "Assertion failed: id" << std::endl; 187 COUT(1) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl; 188 abort(); 189 } 179 190 assert(id); 180 191 BaseObject* creator = 0; -
code/branches/objecthierarchy2/src/orxonox/OrxonoxPrereqs.h
r2369 r2422 114 114 class Billboard; 115 115 class BlinkingBillboard; 116 class ExplosionChunk; 116 117 class FadingBillboard; 117 118 class GlobalShader; … … 158 159 class HumanPlayer; 159 160 class Bot; 161 class GametypeInfo; 160 162 161 163 class Gametype; -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ExplosionChunk.cc
r2414 r2422 30 30 #include "ExplosionChunk.h" 31 31 32 #include "core/Core.h" 32 33 #include "core/CoreIncludes.h" 33 34 #include "core/Executor.h" … … 47 48 ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given."); 48 49 50 this->bStop_ = false; 49 51 this->LOD_ = LODParticle::normal; 50 52 … … 63 65 } 64 66 65 Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)); 66 velocity.normalise(); 67 velocity *= rnd(40, 60); 68 this->setVelocity(velocity); 67 if (Core::isMaster()) 68 { 69 Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)); 70 velocity.normalise(); 71 velocity *= rnd(60, 80); 72 this->setVelocity(velocity); 69 73 70 this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop))); 74 this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop))); 75 } 71 76 72 77 this->registerVariables(); … … 86 91 void ExplosionChunk::registerVariables() 87 92 { 88 REGISTERDATA(this->LOD_, direction::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged)); 93 REGISTERDATA(this->LOD_, direction::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged)); 94 REGISTERDATA(this->bStop_, direction::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop)); 89 95 } 90 96 … … 97 103 } 98 104 105 void ExplosionChunk::checkStop() 106 { 107 if (this->bStop_) 108 this->stop(); 109 } 110 99 111 void ExplosionChunk::stop() 100 112 { … … 104 116 this->smoke_->setEnabled(false); 105 117 106 this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy))); 118 if (Core::isMaster()) 119 { 120 this->bStop_ = true; 121 this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy))); 122 } 107 123 } 108 124 … … 116 132 static const unsigned int CHANGES_PER_SECOND = 5; 117 133 118 if ( rnd() < dt*CHANGES_PER_SECOND)134 if (Core::isMaster() && rnd() < dt*CHANGES_PER_SECOND) 119 135 { 120 136 float length = this->getVelocity().length(); -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ExplosionChunk.h
r2414 r2422 53 53 private: 54 54 void LODchanged(); 55 void checkStop(); 55 56 void stop(); 56 57 void destroy(); 57 58 59 bool bStop_; 58 60 ParticleInterface* fire_; 59 61 ParticleInterface* smoke_; -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/MovableEntity.cc
r2361 r2422 33 33 #include "core/XMLPort.h" 34 34 #include "core/Executor.h" 35 #include "tools/Timer.h"36 35 37 36 namespace orxonox … … 112 111 void MovableEntity::clientConnected(unsigned int clientID) 113 112 { 114 new Timer<MovableEntity>(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), true);113 this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize))); 115 114 } 116 115 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/MovableEntity.h
r2171 r2422 35 35 #include "objects/Tickable.h" 36 36 #include "network/ClientConnectionListener.h" 37 #include "tools/Timer.h" 37 38 38 39 namespace orxonox … … 119 120 Vector3 overwrite_position_; 120 121 Quaternion overwrite_orientation_; 122 123 Timer<MovableEntity> resynchronizeTimer_; 121 124 }; 122 125 } -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2414 r2422 30 30 #include "Pawn.h" 31 31 32 #include "core/Core.h" 32 33 #include "core/CoreIncludes.h" 33 34 #include "core/XMLPort.h" … … 145 146 if (this->spawnparticlesource_ != "") 146 147 { 147 ParticleSpawner* effect = new ParticleSpawner(this );148 ParticleSpawner* effect = new ParticleSpawner(this->getCreator()); 148 149 effect->setPosition(this->getPosition()); 149 150 effect->setOrientation(this->getOrientation()); … … 167 168 this->getPlayer()->stopControl(this); 168 169 169 this->deatheffect(); 170 if (Core::isMaster()) 171 this->deatheffect(); 170 172 } 171 173 … … 174 176 // play death effect 175 177 { 176 ParticleSpawner* effect = new ParticleSpawner(this );178 ParticleSpawner* effect = new ParticleSpawner(this->getCreator()); 177 179 effect->setPosition(this->getPosition()); 178 180 effect->setOrientation(this->getOrientation()); … … 182 184 } 183 185 { 184 ParticleSpawner* effect = new ParticleSpawner(this );186 ParticleSpawner* effect = new ParticleSpawner(this->getCreator()); 185 187 effect->setPosition(this->getPosition()); 186 188 effect->setOrientation(this->getOrientation()); … … 190 192 } 191 193 { 192 ParticleSpawner* effect = new ParticleSpawner(this );194 ParticleSpawner* effect = new ParticleSpawner(this->getCreator()); 193 195 effect->setPosition(this->getPosition()); 194 196 effect->setOrientation(this->getOrientation()); … … 199 201 for (unsigned int i = 0; i < this->numexplosionchunks_; ++i) 200 202 { 201 ExplosionChunk* chunk = new ExplosionChunk(this );203 ExplosionChunk* chunk = new ExplosionChunk(this->getCreator()); 202 204 chunk->setPosition(this->getPosition()); 203 205 … … 214 216 { 215 217 this->setHealth(this->initialHealth_); 216 this->spawneffect(); 218 if (Core::isMaster()) 219 this->spawneffect(); 217 220 } 218 221 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2362 r2422 62 62 63 63 this->greetingFlare_ = new BillboardSet(); 64 this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);64 this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 0, 0), 1); 65 65 if (this->greetingFlare_->getBillboardSet()) 66 66 this->getNode()->attachObject(this->greetingFlare_->getBillboardSet()); -
code/branches/objecthierarchy2/src/orxonox/tools/Shader.cc
r2396 r2422 52 52 Shader::MaterialMap Shader::parameters_s; 53 53 54 Shader::Shader(Ogre::SceneManager* scenemanager) 54 Shader::Shader(Ogre::SceneManager* scenemanager) : compositorInstance_(0) 55 55 { 56 56 RegisterObject(Shader);
Note: See TracChangeset
for help on using the changeset viewer.