Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9406 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

Location:
trunk/src/world_entities
Files:
58 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/bsp_entity.cc

    r9059 r9406  
    11/*
    22   orxonox - the future of 3D-vertical-scrollers
    3  
     3
    44   Copyright (C) 2004 orx
    5  
     5
    66   This program is free software; you can redistribute it and/or modify
    77   it under the terms of the GNU General Public License as published by
    88   the Free Software Foundation; either version 2, or (at your option)
    99   any later version.
    10  
     10
    1111   ### File Specific:
    1212   main-programmer: Claudio Botta
     
    5353
    5454  this->bspManager = NULL;
    55  
     55
    5656  this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name" ) );
    57  
     57
    5858  this->setSynchronized( true );
    5959}
     
    6363{
    6464  PRINTF(0)("+++++++++++ LOADING NAME %s\n", name.c_str());
    65  
     65
    6666  this->name = name;
    6767
  • trunk/src/world_entities/camera.cc

    r9235 r9406  
    1717#include "camera.h"
    1818#include "key_mapper.h"
     19#include "glincl.h"
    1920
    2021/**
  • trunk/src/world_entities/character_attributes.cc

    r4836 r9406  
    2020#include "stdincl.h"
    2121
    22 using namespace std;
     22
    2323
    2424
  • trunk/src/world_entities/creatures/fps_player.cc

    r9235 r9406  
    276276//     if( target != NULL)
    277277//     {
    278 //       PRINTF(0)("hit hit hit, got: %s\n", target->getClassName());
     278//       PRINTF(0)("hit hit hit, got: %s\n", target->getClassCName());
    279279//     }
    280280//     else
     
    287287  //dealing damage
    288288
    289   if ( State::isOnline() && SharedNetworkData::getInstance()->isGameServer() )
     289  if ( State::isOnline() && (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()))
    290290  {
    291291    this->damageTicker -= time;
     
    299299      if ( victim )
    300300      {
    301         PRINTF(0)("FIRE: hit %s\n", victim->getClassName());
     301        PRINTF(0)("FIRE: hit %s\n", victim->getClassCName());
    302302        victim->hit( 20, this );
    303303      }
  • trunk/src/world_entities/effects/billboard.cc

    r8495 r9406  
    2424
    2525
    26 using namespace std;
     26
    2727
    2828
  • trunk/src/world_entities/effects/explosion.cc

    r9235 r9406  
    2727
    2828
    29 using namespace std;
     29
    3030
    3131CREATE_FAST_FACTORY_STATIC(Explosion, CL_EXPLOSION);
  • trunk/src/world_entities/effects/lightning_bolt.cc

    r8793 r9406  
    2424
    2525
    26 using namespace std;
     26
    2727
    2828CREATE_FACTORY(LightningBolt, CL_LIGHTNING_BOLT);
  • trunk/src/world_entities/elements/glgui_energywidget.cc

    r9014 r9406  
    1717
    1818#include "glgui_energywidget.h"
     19
     20#include "multi_type.h"
    1921
    2022namespace OrxGui
  • trunk/src/world_entities/elements/image_entity.cc

    r7751 r9406  
    2727
    2828
    29 using namespace std;
     29
    3030
    3131
  • trunk/src/world_entities/elements/text_element.cc

    r7221 r9406  
    2525
    2626
    27 using namespace std;
     27
    2828
    2929
  • trunk/src/world_entities/environment.cc

    r7711 r9406  
    2727#include "util/loading/factory.h"
    2828
    29 using namespace std;
     29
    3030CREATE_FACTORY(Environment, CL_ENVIRONMENT);
    3131
  • trunk/src/world_entities/environments/building.cc

    r7193 r9406  
    2121#include "util/loading/factory.h"
    2222
    23 using namespace std;
     23
    2424
    2525
  • trunk/src/world_entities/environments/mapped_water.cc

    r9235 r9406  
    374374        waterColorR->setValue(this->waterColor.x);
    375375        waterColorR->setStep(0.1f);
    376         waterColorR->connect(SIGNAL(waterColorR, valueChanged), this, SLOT(MappedWater, resetWaterColorR));
     376        waterColorR->valueChanged.connect(this, &MappedWater::resetWaterColorR);
    377377        waterColorBox->pack(waterColorR);
    378378
     
    381381        waterColorG->setStep(0.1f);
    382382        waterColorG->setValue(this->waterColor.y);
    383         waterColorG->connect(SIGNAL(waterColorG, valueChanged), this, SLOT(MappedWater, resetWaterColorG));
     383        waterColorG->valueChanged.connect(this, &MappedWater::resetWaterColorG);
    384384        waterColorBox->pack(waterColorG);
    385385
     
    388388        waterColorB->setStep(0.1f);
    389389        waterColorB->setValue(this->waterColor.z);
    390         waterColorB->connect(SIGNAL(waterColorB, valueChanged), this, SLOT(MappedWater, resetWaterColorB));
     390        waterColorB->valueChanged.connect(this, &MappedWater::resetWaterColorB);
    391391        waterColorBox->pack(waterColorB);
    392392      }
     
    403403        waterUV->setValue(this->waterUV);
    404404        waterUV->setStep(1);
    405         waterUV->connect(SIGNAL(waterUV, valueChanged), this, SLOT(MappedWater, setWaterUV));
     405        waterUV->valueChanged.connect(this, &MappedWater::setWaterUV);
    406406        waterUVBox->pack(waterUV);
    407407      }
     
    418418        waterFlow->setValue(this->waterFlow);
    419419        waterFlow->setStep(0.02f);
    420         waterFlow->connect(SIGNAL(waterFlow, valueChanged), this, SLOT(MappedWater, setWaterFlow));
     420        waterFlow->valueChanged.connect(this, &MappedWater::setWaterFlow);
    421421        waterFlowBox->pack(waterFlow);
    422422      }
     
    433433        shineSize->setValue(this->shineSize);
    434434        shineSize->setStep(1);
    435         shineSize->connect(SIGNAL(shineSize, valueChanged), this, SLOT(MappedWater, resetShineSize));
     435        shineSize->valueChanged.connect(this, &MappedWater::resetShineSize);
    436436        shineSizeBox->pack(shineSize);
    437437      }
     
    448448        shineStrength->setValue(this->shineStrength);
    449449        shineStrength->setStep(0.1f);
    450         shineStrength->connect(SIGNAL(shineStrength, valueChanged), this, SLOT(MappedWater, resetShineStrength));
     450        shineStrength->valueChanged.connect(this, &MappedWater::resetShineStrength);
    451451        shineStrengthBox->pack(shineStrength);
    452452      }
     
    463463        reflStrength->setValue(this->reflStrength);
    464464        reflStrength->setStep(0.1f);
    465         reflStrength->connect(SIGNAL(reflStrength, valueChanged), this, SLOT(MappedWater, resetReflStrength));
     465        reflStrength->valueChanged.connect(this, &MappedWater::resetReflStrength);
    466466        reflStrengthBox->pack(reflStrength);
    467467      }
     
    478478        refraction->setValue(this->refraction);
    479479        refraction->setStep(0.004f);
    480         refraction->connect(SIGNAL(refraction, valueChanged), this, SLOT(MappedWater, resetRefraction));
     480        refraction->valueChanged.connect(this, &MappedWater::resetRefraction);
    481481        refractionBox->pack(refraction);
    482482      }
     
    493493        lightPosX->setValue(this->lightPos.x);
    494494        lightPosX->setStep(15);
    495         lightPosX->connect(SIGNAL(lightPosX, valueChanged), this, SLOT(MappedWater, resetLightPosX));
     495        lightPosX->valueChanged.connect(this, &MappedWater::resetLightPosX);
    496496        lightPosBox->pack(lightPosX);
    497497
     
    500500        lightPosY->setStep(15);
    501501        lightPosY->setValue(this->lightPos.y);
    502         lightPosY->connect(SIGNAL(lightPosY, valueChanged), this, SLOT(MappedWater, resetLightPosY));
     502        lightPosY->valueChanged.connect(this, &MappedWater::resetLightPosY);
    503503        lightPosBox->pack(lightPosY);
    504504
     
    507507        lightPosZ->setStep(15);
    508508        lightPosZ->setValue(this->lightPos.z);
    509         lightPosZ->connect(SIGNAL(lightPosZ, valueChanged), this, SLOT(MappedWater, resetLightPosZ));
     509        lightPosZ->valueChanged.connect(this, &MappedWater::resetLightPosZ);
    510510        lightPosBox->pack(lightPosZ);
    511511      }
     
    522522        waterHeight->setValue(this->waterHeight);
    523523        waterHeight->setStep(4);
    524         waterHeight->connect(SIGNAL(waterHeight, valueChanged), this, SLOT(MappedWater, setWaterHeight));
     524        waterHeight->valueChanged.connect(this, &MappedWater::setWaterHeight);
    525525        waterHeightBox->pack(waterHeight);
    526526      }
  • trunk/src/world_entities/environments/model_entity.cc

    r9235 r9406  
    2121#include "util/loading/factory.h"
    2222
    23 using namespace std;
     23
    2424
    2525
  • trunk/src/world_entities/environments/water.cc

    r7954 r9406  
    3232#include "network_game_manager.h"
    3333
    34 using namespace std;
     34
    3535
    3636CREATE_FACTORY(Water, CL_WATER);
  • trunk/src/world_entities/items/item_container.cc

    r6655 r9406  
    1818#include "item_container.h"
    1919
    20 using namespace std;
     20
    2121
    2222
  • trunk/src/world_entities/movie_entity.cc

    r8310 r9406  
    2020#include "util/loading/factory.h"
    2121
    22 using namespace std;
     22
    2323
    2424CREATE_FACTORY(MovieEntity, CL_MOVIE_ENTITY);
  • trunk/src/world_entities/npcs/door.cc

    r9110 r9406  
    2828
    2929
    30 using namespace std;
     30
    3131
    3232
  • trunk/src/world_entities/npcs/gate.cc

    r9298 r9406  
    3131
    3232
    33 using namespace std;
     33
    3434
    3535
  • trunk/src/world_entities/npcs/ground_turret.cc

    r9235 r9406  
    3131CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET);
    3232
    33 using namespace std;
     33
    3434
    3535
  • trunk/src/world_entities/npcs/repair_station.cc

    r9003 r9406  
    2828
    2929
    30 using namespace std;
     30
    3131
    3232
  • trunk/src/world_entities/planet.cc

    r7919 r9406  
    3030#include "primitive_model.h"
    3131
    32 using namespace std;
     32
    3333
    3434
  • trunk/src/world_entities/playable.cc

    r9235 r9406  
    148148    if (weapon != NULL)
    149149      PRINTF(2)("Unable to add Weapon (%s::%s) to %s::%s\n",
    150                 weapon->getClassName(), weapon->getName(), this->getClassName(), this->getName());
     150                weapon->getClassCName(), weapon->getCName(), this->getClassCName(), this->getCName());
    151151    else
    152152      PRINTF(2)("No weapon defined\n");
     
    361361  }
    362362}
    363 /**
    364  * @brief helps us colliding Playables
    365  * @param entity the Entity to collide
    366  * @param location where the collision occured.
    367  */
    368 void Playable::collidesWith(WorldEntity* entity, const Vector& location)
    369 {
    370   if (entity == collider)
    371     return;
    372   collider = entity;
    373 
    374   if ( entity->isA(CL_PROJECTILE) && ( !State::isOnline() || SharedNetworkData::getInstance()->isGameServer() ) )
    375   {
    376     this->decreaseHealth(entity->getHealth() *(float)rand()/(float)RAND_MAX);
    377     // EXTREME HACK
    378     if (this->getHealth() <= 0.0f)
    379     {
    380 //       this->destory();
    381 
    382       if( State::getGameRules() != NULL)
    383         State::getGameRules()->registerKill(Kill(entity, this));
    384     }
    385   }
    386 }
    387363
    388364
     
    413389    }
    414390    this->bDead = true;
    415    
     391
    416392    if( State::getGameRules() != NULL)
    417393      State::getGameRules()->registerKill(Kill(killer, this));
  • trunk/src/world_entities/playable.h

    r9235 r9406  
    8282  virtual void destroy(WorldEntity* killer);
    8383  virtual void respawn();
    84   virtual void collidesWith(WorldEntity* entity, const Vector& location);
    8584  virtual void process(const Event &event);
    8685  virtual void tick(float dt);
     
    9089  static const std::string& playmodeToString(Playable::Playmode playmode);
    9190  static const std::string playmodeNames[];
    92  
     91
    9392  inline bool beFire(){ return this->bFire; }
    9493  inline void fire(bool bF){ this->bFire = bF;}
  • trunk/src/world_entities/power_ups/laser_power_up.cc

    r7954 r9406  
    2323#include "primitive_model.h"
    2424
    25 using namespace std;
     25
    2626
    2727CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP);
     
    7878void LaserPowerUp::collidesWith(WorldEntity* entity, const Vector& location)
    7979{
    80  // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     80 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
    8181 if (entity->isA(CL_PLAYABLE))
    8282  this->toList(OM_DEAD);
  • trunk/src/world_entities/power_ups/param_power_up.cc

    r7954 r9406  
    2626#include "network_game_manager.h"
    2727
    28 using namespace std;
     28
    2929
    3030CREATE_FACTORY(ParamPowerUp, CL_PARAM_POWER_UP);
  • trunk/src/world_entities/power_ups/power_up.cc

    r8350 r9406  
    2424#include "util/loading/load_param.h"
    2525
    26 using namespace std;
     26
    2727
    2828PowerUp::PowerUp(float r, float g, float b)
     
    8585    if (this->pickupBuffer != NULL)
    8686    {
    87       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->getName());
     87      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", pickupSound.c_str(), this->getCName());
    8888    }
    8989    else
    9090    {
    91       PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->getName());
     91      PRINTF(2)("Failed to load sound %s to pickup %s.\n.", pickupSound.c_str(), this->getCName());
    9292    }
    9393  }
     
    106106    if (this->respawnBuffer != NULL)
    107107    {
    108       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->getName());
     108      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", respawnSound.c_str(), this->getCName());
    109109    }
    110110    else
    111111    {
    112       PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->getName());
     112      PRINTF(2)("Failed to load sound %s to respawn %s.\n.", respawnSound.c_str(), this->getCName());
    113113    }
    114114  }
  • trunk/src/world_entities/power_ups/turret_power_up.cc

    r7954 r9406  
    2323#include "primitive_model.h"
    2424
    25 using namespace std;
     25
    2626
    2727CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP);
     
    7474void TurretPowerUp::collidesWith(WorldEntity* entity, const Vector& location)
    7575{
    76  // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     76 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
    7777 if (entity->isA(CL_PLAYABLE))
    7878   this->toList(OM_DEAD);
  • trunk/src/world_entities/power_ups/weapon_power_up.cc

    r7954 r9406  
    2626#include "util/loading/load_param.h"
    2727
    28 using namespace std;
     28
    2929
    3030CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP);
  • trunk/src/world_entities/projectiles/laser.cc

    r9235 r9406  
    2828#include "debug.h"
    2929
    30 using namespace std;
     30
    3131
    3232CREATE_FAST_FACTORY_STATIC(Laser, CL_LASER);
  • trunk/src/world_entities/projectiles/projectile.cc

    r9235 r9406  
    7575    if (this->explosionBuffer != NULL)
    7676    {
    77       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getName());
     77      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", explosionSound.c_str(), this->getCName());
    7878    }
    7979    else
    8080    {
    81       PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getName());
     81      PRINTF(2)("Failed to load sound %s to explosion %s.\n.", explosionSound.c_str(), this->getCName());
    8282    }
    8383  }
     
    9797    if (this->engineBuffer != NULL)
    9898    {
    99       PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getName());
     99      PRINTF(4)("Loaded sound %s to Pickup: %s.\n", engineSound.c_str(), this->getCName());
    100100    }
    101101    else
    102102    {
    103       PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getName());
     103      PRINTF(2)("Failed to load sound %s to engine %s.\n.", engineSound.c_str(), this->getCName());
    104104    }
    105105  }
  • trunk/src/world_entities/projectiles/rail_projectile.cc

    r9235 r9406  
    2828#include "debug.h"
    2929
    30 using namespace std;
     30
    3131
    3232CREATE_FAST_FACTORY_STATIC(RailProjectile, CL_RAIL_PROJECTILE);
  • trunk/src/world_entities/recorder.cc

    r7221 r9406  
    2121#include "state.h"
    2222
    23 using namespace std;
     23
    2424
    2525CREATE_FACTORY(Recorder, CL_RECORDER);
  • trunk/src/world_entities/satellite.cc

    r6222 r9406  
    2424
    2525
    26 using namespace std;
     26
    2727
    2828/**
  • trunk/src/world_entities/script_trigger.cc

    r9298 r9406  
    6363  addToScript = false;
    6464  this->activeOnCreation = false;
    65  
     65
    6666  if(root != NULL)
    6767  {
    68    
     68
    6969    loadParams(root);
    70  
     70
    7171    if(addToScript && scriptIsOk)
    7272    {
    7373      script->addObject( "ScriptTrigger", this->getName());
    7474    }
    75  
    76   }
    77  
     75
     76  }
     77
    7878}
    7979
    8080/**
    8181 * Deletes the ScriptTrigger.
    82  * 
     82 *
    8383 */
    8484ScriptTrigger::~ScriptTrigger()
     
    147147  else
    148148  {
    149     PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassName(), this->getName());
     149    PRINTF(2)("Target %s for %s::%s does not Exist\n", target.c_str(), this->getClassCName(), this->getCName());
    150150  }
    151151}
     
    153153/**
    154154 * Sets the parent of the trigger.
    155  * @param parent The parrent. 
     155 * @param parent The parrent.
    156156 */
    157157void ScriptTrigger::setTriggerParent(const std::string& parent)
     
    166166  else
    167167  {
    168     PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassName(), this->getName());
     168    PRINTF(2)("Parent %s for %s::%s does not Exist\n", parent.c_str(), this->getClassCName(), this->getCName());
    169169  }
    170170}
     
    179179     return;
    180180   }
    181    
     181
    182182  if(triggerRemains && scriptCalled)
    183183  {
     
    185185    return;
    186186  }
    187  
     187
    188188  if( !invert && this->distance(target) < radius)
    189189  {
     
    191191    scriptCalled = true;
    192192    return;
    193  
     193
    194194  }
    195195  else if( invert && this->distance(target) > radius)
    196196  {
    197     executeAction(timestep); 
     197    executeAction(timestep);
    198198    scriptCalled = true;
    199199    return;
     
    207207void ScriptTrigger::executeAction(float timestep)
    208208{
    209  
     209
    210210  if(scriptIsOk)
    211211  {
     
    213213    if(!(script->selectFunction(this->functionName,returnCount)) )
    214214      PRINT(1)("Error ScriptTrigger: Selection of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    215      
     215
    216216    script->pushParam( timestep, this->functionName);
    217      
     217
    218218    if( !(script->executeFunction()) )
    219219      PRINT(1)("Error ScriptTrigger: Execution of %s in %s failed.\n",functionName.c_str(), script->getFileName().c_str());
    220      
     220
    221221    scriptFinished = script->getReturnedBool();
    222222  }
    223      
    224      
     223
     224
    225225}
    226226
     
    268268   float retf = script->getReturnedFloat();
    269269   printf("main returned %f\n",retf);
    270    
     270
    271271
    272272   printf("-------------------------- top of the stack:%i\n",lua_gettop(script->getLuaState()));
  • trunk/src/world_entities/skybox.cc

    r8037 r9406  
    3030
    3131
    32 using namespace std;
     32
    3333
    3434CREATE_FACTORY(SkyBox, CL_SKYBOX);
  • trunk/src/world_entities/skydome.cc

    r9235 r9406  
    2828#define SQR(x) (x*x)
    2929
    30 using namespace std;
     30
    3131
    3232
  • trunk/src/world_entities/skysphere.cc

    r7840 r9406  
    3333
    3434
    35 using namespace std;
     35
    3636
    3737/**
  • trunk/src/world_entities/space_ships/collision_probe.cc

    r8724 r9406  
    2424
    2525
    26 using namespace std;
     26
    2727
    2828CREATE_FACTORY(CollisionProbe, CL_COLLISION_PROBE);
  • trunk/src/world_entities/space_ships/space_ship.cc

    r9235 r9406  
    5252
    5353
    54 using namespace std;
     54
    5555
    5656CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP);
     
    314314  if( entity->isA(CL_PROJECTILE) && entity != ref)
    315315  {
    316     if ( isServer() )
     316    if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
    317317    {
    318318      //TODO handle this
    319319    }
    320320  }
    321   PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     321  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
    322322}
    323323
  • trunk/src/world_entities/space_ships/spacecraft_2d.cc

    r9298 r9406  
    324324
    325325    default:
    326       PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassName());
     326      PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
    327327  }
    328328}
     
    474474
    475475    default:
    476       PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassName());
     476      PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName());
    477477  }
    478478}
  • trunk/src/world_entities/spawning_point.cc

    r9235 r9406  
    3131#include "shared_network_data.h"
    3232
     33
     34/// TODO REMOVE converter.h
     35#include "converter.h"
     36
    3337CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT );
    3438
     
    4145
    4246  this->init();
    43  
     47
    4448  if (root != NULL)
    4549    this->loadParams(root);
     
    5054  this->setClassID(CL_SPAWNING_POINT, "SpawningPoint");
    5155  PRINTF(0)("Created SpawningPoint\n");
    52  
     56
    5357  this->teamId = -1;
    5458  this->localTimer = 0.0f;
    55  
     59
    5660  this->toList( OM_DEAD_TICK );
    57  
     61
    5862  MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL );
    59  
     63
    6064  this->setSynchronized( true );
    6165}
     
    9498  qe.entity = entity;
    9599  qe.respawnTime = this->localTimer + delay;
    96  
     100
    97101  queue.push_back( qe );
    98102}
     
    105109{
    106110  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
    107  
     111
    108112  bool found = false;
    109  
     113
    110114  if ( !list )
    111115    return;
    112    
     116
    113117  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
    114118  {
     
    119123    }
    120124  }
    121  
     125
    122126  if ( !found )
    123127    return;
    124128
    125   PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassName());
     129  PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassCName());
    126130
    127131
    128132  entity->setAbsCoor( this->getAbsCoor() );
    129133  entity->setAbsDir( this->getAbsDir() );
    130  
     134
    131135  //TODO set camera (not smooth)
    132  
     136
    133137  if ( State::getGameRules() )
    134138  {
    135139    (State::getGameRules())->registerSpawn( entity );
    136140  }
    137  
     141
    138142  entity->respawn();
    139143}
     
    157161      //spawn the player
    158162      this->spawn(it->entity);
    159      
     163
    160164      const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
    161  
     165
    162166      bool found = false;
    163  
     167
    164168      if ( !list )
    165169        return;
    166    
     170
    167171      for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ )
    168172      {
     
    173177        }
    174178      }
    175  
    176       if ( found && SharedNetworkData::getInstance()->isGameServer() )
     179
     180      if ( found && SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
    177181        this->sendRespawnMessage( it->entity->getUniqueID() );
    178182
    179183      std::list<QueueEntry>::iterator delit = it;
    180184      it++;
    181      
     185
    182186      queue.erase( delit );
    183      
     187
    184188      continue;
    185189    }
    186    
     190
    187191    it++;
    188192  }
     
    203207void SpawningPoint::sendRespawnMessage( int uniqueId )
    204208{
     209#warning this byte array is not being deleted according to valginrd
    205210  byte * buf = new byte[2*INTSIZE];
    206  
     211
    207212  assert( Converter::intToByteArray( this->getUniqueID(), buf, INTSIZE ) == INTSIZE );
    208213  assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE );
    209  
     214
    210215  MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH );
    211216}
     
    213218bool SpawningPoint::respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
    214219{
    215   if ( SharedNetworkData::getInstance()->isGameServer() )
     220  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
    216221  {
    217222    PRINTF(2)("server received spawn message!\n");
    218223    return true;
    219224  }
    220    
     225
    221226  int spUniqueId;
    222227  int uniqueId;
    223  
     228
    224229  if ( dataLength != 2*INTSIZE )
    225230  {
     
    227232    return true;
    228233  }
    229  
     234
    230235  assert( Converter::byteArrayToInt( data, &spUniqueId ) == INTSIZE );
    231236  assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE );
    232  
     237
    233238  PRINTF(0)("SPAWNMESSAGE %d\n", uniqueId);
    234  
     239
    235240  SpawningPoint * sp = NULL;
    236241  Playable      * playable = NULL;
    237  
     242
    238243  const std::list<BaseObject*> * list = ClassList::getList( CL_SPAWNING_POINT );
    239  
     244
    240245  if ( list )
    241246  {
     
    250255    }
    251256  }
    252  
     257
    253258  if ( !sp )
    254259  {
     
    256261    return false;
    257262  }
    258  
     263
    259264  list = ClassList::getList( CL_PLAYABLE );
    260  
     265
    261266  if ( list )
    262267  {
     
    270275    }
    271276  }
    272  
     277
    273278  if ( !playable )
    274279  {
     
    276281    return false;
    277282  }
    278  
     283
    279284  sp->spawn( playable );
    280  
     285
    281286  return true;
    282287}
  • trunk/src/world_entities/spectator.cc

    r8708 r9406  
    2525
    2626
    27 using namespace std;
     27
    2828
    2929
  • trunk/src/world_entities/terrain.cc

    r8316 r9406  
    3333#include "state.h"
    3434
    35 using namespace std;
     35
    3636
    3737CREATE_FACTORY(Terrain, CL_TERRAIN);
  • trunk/src/world_entities/test_entity.cc

    r9235 r9406  
    3333#include "state.h"
    3434
    35 using namespace std;
     35
    3636
    3737
  • trunk/src/world_entities/weapons/aim.cc

    r7370 r9406  
    2727#include "world_entity.h"
    2828
    29 using namespace std;
     29
    3030
    3131
  • trunk/src/world_entities/weapons/aiming_system.cc

    r9298 r9406  
    2828
    2929
    30 using namespace std;
     30
    3131
    3232
     
    9191
    9292
    93   for( int i = 0; i < this->selectionList.size(); i++)
     93  for(unsigned int i = 0; i < this->selectionList.size(); i++)
    9494  {
    9595    distance = fabs((this->getAbsCoor() - this->selectionList[i]->getAbsCoor()).len());
     
    101101  }
    102102
    103   PRINTF(0)("entity: %s\n", nearestEntity->getClassName());
     103  PRINTF(0)("entity: %s\n", nearestEntity->getClassCName());
    104104    return nearestEntity;
    105105}
     
    115115  if( this->owner != killer)
    116116  {
    117     //PRINTF(0)("real hit: %s\n", killer->getClassName());
     117    //PRINTF(0)("real hit: %s\n", killer->getClassCName());
    118118    this->selectionList.push_back(killer);
    119119  }
  • trunk/src/world_entities/weapons/aiming_turret.cc

    r8777 r9406  
    2929CREATE_FACTORY(AimingTurret, CL_AIMING_TURRET);
    3030
    31 using namespace std;
     31
    3232
    3333
  • trunk/src/world_entities/weapons/ammo_container.cc

    r6846 r9406  
    2222#include <assert.h>
    2323
    24 using namespace std;
     24
    2525
    2626/**
  • trunk/src/world_entities/weapons/cannon.cc

    r8777 r9406  
    3535
    3636
    37 using namespace std;
     37
    3838
    3939CREATE_FACTORY(Cannon, CL_CANNON);
  • trunk/src/world_entities/weapons/crosshair.cc

    r7868 r9406  
    2424#include "material.h"
    2525
    26 using namespace std;
     26
    2727
    2828
  • trunk/src/world_entities/weapons/fps_sniper_rifle.cc

    r9235 r9406  
    3636#include "effects/explosion.h"
    3737
    38 using namespace std;
     38
    3939
    4040
  • trunk/src/world_entities/weapons/hyperblaster.cc

    r8777 r9406  
    3434
    3535
    36 using namespace std;
     36
    3737
    3838CREATE_FACTORY(Hyperblaster, CL_HYPERBLASTER);
  • trunk/src/world_entities/weapons/targeting_turret.cc

    r8777 r9406  
    2929CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET);
    3030
    31 using namespace std;
     31
    3232
    3333
  • trunk/src/world_entities/weapons/turret.cc

    r8777 r9406  
    2929CREATE_FACTORY(Turret, CL_TURRET);
    3030
    31 using namespace std;
     31
    3232
    3333/**
  • trunk/src/world_entities/weapons/weapon.cc

    r8977 r9406  
    3636#include "elements/glgui_energywidget.h"
    3737
    38 using namespace std;
     38
    3939
    4040////////////////////
     
    199199  else
    200200  {
    201     PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->getName());
     201    PRINTF(1)("Projectile %s does not exist for weapon %s\n", projectile.c_str(), this->getCName());
    202202  }
    203203}
     
    213213    projectileFactory->prepare(count);
    214214  else
    215     PRINTF(2)("unable to create %d projectile for Weapon %s (%s)\n", count, this->getName(), this->getClassName());
     215    PRINTF(2)("unable to create %d projectile for Weapon %s::%s\n", count, this->getClassCName(), this->getCName());
    216216}
    217217
     
    234234  else
    235235  {
    236     PRINTF(2)("No projectile defined for Weapon %s(%s) can't return any\n", this->getName(), this->getClassName());
     236    PRINTF(2)("No projectile defined for Weapon %s(%s) can't return any\n", this->getCName(), this->getClassCName());
    237237    return NULL;
    238238  }
     
    313313  {
    314314    this->energyWidget = new OrxGui::GLGuiEnergyWidget();
    315     this->energyWidget->setDisplayedName(this->getClassName());
     315    this->energyWidget->setDisplayedName(this->getClassCName());
    316316    this->energyWidget->setSize2D( 20, 100);
    317317    this->energyWidget->setMaximum(this->getEnergyMax());
     
    442442    this->updateWidgets();
    443443    // activate
    444     PRINTF(4)("Activating the Weapon %s\n", this->getName());
     444    PRINTF(4)("Activating the Weapon %s\n", this->getCName());
    445445    this->activate();
    446446    // setting up for next action
     
    458458  //  if (this->currentState != WS_INACTIVE)
    459459  {
    460     PRINTF(4)("Deactivating the Weapon %s\n", this->getName());
     460    PRINTF(4)("Deactivating the Weapon %s\n", this->getCName());
    461461    // play Sound
    462462    if (this->soundBuffers[WA_DEACTIVATE] != NULL)
     
    527527bool Weapon::reloadW()
    528528{
    529   PRINTF(4)("Reloading Weapon %s\n", this->getName());
     529  PRINTF(4)("Reloading Weapon %s\n", this->getCName());
    530530  if (this->ammoContainer.get() != NULL &&
    531531      unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
     
    632632void Weapon::debug() const
    633633{
    634   PRINT(0)("Weapon-Debug %s, state: %s (duration: %fs), nextAction: %s\n", this->getName(), Weapon::stateToChar(this->currentState), this->stateDuration, Weapon::actionToChar(requestedAction));
     634  PRINT(0)("Weapon-Debug %s, state: %s (duration: %fs), nextAction: %s\n", this->getCName(), Weapon::stateToChar(this->currentState), this->stateDuration, Weapon::actionToChar(requestedAction));
    635635  PRINT(0)("Energy: max: %f; current: %f; chargeMin: %f, chargeMax %f\n",
    636636           this->energyMax, this->energy, this->minCharge, this->maxCharge);
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r8844 r9406  
    8383    // NAMING
    8484    char* tmpName;
    85     if (this->getName())
    86     {
    87       tmpName = new char[strlen(this->getName()) + 10];
    88       sprintf(tmpName, "%s_slot%d", this->getName(), i);
     85    if (!this->getName().empty())
     86    {
     87      tmpName = new char[this->getName().size() + 10];
     88      sprintf(tmpName, "%s_slot%d", this->getCName(), i);
    8989    }
    9090    else
     
    265265  if (configID > 0 && slotID > 0 && this->configs[configID][slotID] != NULL)
    266266  {
    267     PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getName(), weapon->getClassName(), weapon->getName());
     267    PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getCName(), weapon->getClassCName(), weapon->getCName());
    268268    return false;
    269269  }
     
    302302    weapon->setDefaultTarget(this->crosshair);
    303303  }
    304   PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassName(), weapon->getName(), configID, slotID);
     304  PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
    305305  return true;
    306306}
     
    555555    {
    556556      if (this->configs[i][j] != NULL)
    557         PRINT(3)("Slot %d loaded a %s\n", j, this->configs[i][j]->getClassName());
    558     }
    559   }
    560 }
     557        PRINT(3)("Slot %d loaded a %s\n", j, this->configs[i][j]->getClassCName());
     558    }
     559  }
     560}
  • trunk/src/world_entities/world_entity.cc

    r9235 r9406  
    414414bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    415415{
    416   PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassName(), entityB->getClassName());
     416  PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassCName(), entityB->getClassCName());
    417417  // is there any handler listening?
    418418  if( !this->bReactive)
     
    506506   * You can always define a default Action.... don't be affraid just test it :)
    507507   */
    508   //  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z);
     508  //  PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
    509509}
    510510
     
    518518void WorldEntity::collidesWithGround(const Vector& location)
    519519{
    520   PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassName() );
     520  PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassCName() );
    521521}
    522522
     
    524524{
    525525
    526   // PRINTF(0)("BSP_GROUND: Player collides \n", this->getClassName() );
     526  // PRINTF(0)("BSP_GROUND: Player collides \n", this->getClassCName() );
    527527
    528528  Vector v = this->getAbsDirX();
     
    594594void WorldEntity::draw() const
    595595{
    596   //PRINTF(0)("(%s::%s)\n", this->getClassName(), this->getName());
     596  //PRINTF(0)("(%s::%s)\n", this->getClassCName(), this->getName());
    597597  //  assert(!unlikely(this->models.empty()));
    598598  {
     
    676676  if (this->health > this->healthMax)
    677677  {
    678     PRINTF(3)("new maxHealth is bigger as the old health. Did you really intend to do this for (%s::%s)\n", this->getClassName(), this->getName());
     678    PRINTF(3)("new maxHealth is bigger as the old health. Did you really intend to do this for (%s::%s)\n", this->getClassCName(), this->getCName());
    679679    this->health = this->healthMax;
    680680  }
     
    699699  }
    700700  else
    701     PRINTF(3)("Allready created the HealthWidget for %s::%s\n", this->getClassName(), this->getName());
     701    PRINTF(3)("Allready created the HealthWidget for %s::%s\n", this->getClassCName(), this->getCName());
    702702}
    703703
     
    745745  this->decreaseHealth(damage);
    746746
    747   PRINTF(5)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
     747  PRINTF(5)("Hit me: %s::%s now only %f/%f health\n", this->getClassCName(), this->getCName(), this->getHealth(), this->getHealthMax());
    748748
    749749  if( this->getHealth() > 0)
     
    811811void WorldEntity::debugEntity() const
    812812{
    813   PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassName(), this->getName());
     813  PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassCName(), this->getCName());
    814814  this->debugNode();
    815815  PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size());
     
    817817  {
    818818    if (models[i] != NULL)
    819       PRINT(0)(" : %d:%s", i, this->models[i]->getName());
     819      PRINT(0)(" : %d:%s", i, this->models[i]->getCName());
    820820  }
    821821  PRINT(0)("\n");
Note: See TracChangeset for help on using the changeset viewer.