[Orxonox-commit 545] r3088 - in trunk/src: network/synchronisable orxonox/objects/weaponsystem/projectiles orxonox/overlays/hud

scheusso at orxonox.net scheusso at orxonox.net
Wed May 27 16:09:13 CEST 2009


Author: scheusso
Date: 2009-05-27 16:09:13 +0200 (Wed, 27 May 2009)
New Revision: 3088

Modified:
   trunk/src/network/synchronisable/Synchronisable.cc
   trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc
   trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h
   trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc
   trunk/src/orxonox/overlays/hud/HUDTimer.cc
Log:
fix in Projectile (there was no createFactory) and some additional debugging
and in hubtimer (only on server now)
and in lightninggun (material is synchronised)


Modified: trunk/src/network/synchronisable/Synchronisable.cc
===================================================================
--- trunk/src/network/synchronisable/Synchronisable.cc	2009-05-27 12:45:54 UTC (rev 3087)
+++ trunk/src/network/synchronisable/Synchronisable.cc	2009-05-27 14:09:13 UTC (rev 3088)
@@ -143,7 +143,7 @@
     Identifier* id = ClassByID(header.getClassID());
     if (!id)
     {
-        for(int i = 0; i<100; i++)
+        for(int i = 0; i<160; i++)
             COUT(0) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
         COUT(0) << "Assertion failed: id" << std::endl;
         COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl;
@@ -250,6 +250,7 @@
     if (this->classID == static_cast<uint32_t>(-1))
         this->classID = this->getIdentifier()->getNetworkID();
 
+    assert(ClassByID(this->classID));
     assert(this->classID==this->getIdentifier()->getNetworkID());
     std::vector<SynchronisableVariableBase*>::iterator i;
 

Modified: trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc
===================================================================
--- trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc	2009-05-27 12:45:54 UTC (rev 3087)
+++ trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc	2009-05-27 14:09:13 UTC (rev 3088)
@@ -47,8 +47,15 @@
         this->textureIndex_ = 1;
         this->maxTextureIndex_ = 8;
         this->textureTimer_.setTimer(0.01, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
+        
+        registerVariables();
     }
     
+    void LightningGunProjectile::registerVariables()
+    {
+        registerVariable(this->materialBase_);
+    }
+    
     void LightningGunProjectile::setMaterial(const std::string& material)
     {
         this->materialBase_ = material;    

Modified: trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h
===================================================================
--- trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h	2009-05-27 12:45:54 UTC (rev 3087)
+++ trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h	2009-05-27 14:09:13 UTC (rev 3088)
@@ -51,6 +51,8 @@
             unsigned int maxTextureIndex_;
             Timer<LightningGunProjectile> textureTimer_;
             std::string materialBase_;
+      private:
+            void registerVariables();
     };
 }
 

Modified: trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc
===================================================================
--- trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc	2009-05-27 12:45:54 UTC (rev 3087)
+++ trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc	2009-05-27 14:09:13 UTC (rev 3088)
@@ -44,6 +44,8 @@
 
 namespace orxonox
 {
+    CreateFactory(Projectile);
+  
     Projectile::Projectile(BaseObject* creator) : MovableEntity(creator)
     {
         RegisterObject(Projectile);

Modified: trunk/src/orxonox/overlays/hud/HUDTimer.cc
===================================================================
--- trunk/src/orxonox/overlays/hud/HUDTimer.cc	2009-05-27 12:45:54 UTC (rev 3087)
+++ trunk/src/orxonox/overlays/hud/HUDTimer.cc	2009-05-27 14:09:13 UTC (rev 3088)
@@ -54,10 +54,13 @@
     SUPER(HUDTimer, tick, dt);
 
     Gametype* gametype = this->getGametype();
-
-    if (gametype->getTimerIsActive())
+    
+    if(gametype)
     {
-      this->setCaption(convertToString((int)gametype->getTime() + 1));
+      if (gametype->getTimerIsActive())
+      {
+        this->setCaption(convertToString((int)gametype->getTime() + 1));
+      }
     }
   }
 




More information about the Orxonox-commit mailing list