Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1960


Ignore:
Timestamp:
Oct 19, 2008, 11:53:31 PM (16 years ago)
Author:
landauf
Message:
  • some unsigned int conversions (except gamestatemanager)
  • small fix in Test
Location:
code/branches/objecthierarchy/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/network/ClientInformation.cc

    r1955 r1960  
    173173      return gamestateID_;
    174174    else
    175       return -1;
     175      return (unsigned int)-1;
    176176  }
    177177
     
    180180      return partialGamestateID_;
    181181    else
    182       return -1;
     182      return (unsigned int)-1;
    183183  }
    184184
  • code/branches/objecthierarchy/src/network/ClientInformation.h

    r1955 r1960  
    4646#include <boost/thread/recursive_mutex.hpp>
    4747
    48 #define GAMESTATEID_INITIAL -1
    49 
    5048// WATCH OUT: THE CLIENTINFORMATION LIST IS NOT THREADSAFE ANYMORE
    5149
    5250namespace network
    5351{
     52  static const unsigned int GAMESTATEID_INITIAL = (unsigned int)-1;
    5453  static const unsigned int CLIENTID_UNKNOWN = (unsigned int)-2;
    5554
  • code/branches/objecthierarchy/src/network/GamestateManager.cc

    r1944 r1960  
    6464    return getSnapshot();
    6565  }
    66  
     66
    6767  bool GamestateManager::add(packet::Gamestate *gs, int clientID){
    6868    assert(gs);
     
    7575    return true;
    7676  }
    77  
     77
    7878  bool GamestateManager::processGamestates(){
    7979    std::map<int, packet::Gamestate*>::iterator it;
     
    8787    return true;
    8888  }
    89  
    90  
     89
     90
    9191  bool GamestateManager::getSnapshot(){
    9292    reference = new packet::Gamestate();
     
    9797    return true;
    9898  }
    99  
     99
    100100  /**
    101101   * this function is used to keep the memory usage low
    102102   * it tries to delete all the unused gamestates
    103    * 
    104    * 
     103   *
     104   *
    105105   */
    106106/*  void GamestateManager::cleanup(){
     
    160160    return gs;
    161161  }
    162  
    163  
     162
     163
    164164  bool GamestateManager::ack(int gamestateID, int clientID) {
    165165    ClientInformation *temp = ClientInformation::findClient(clientID);
    166166    assert(temp);
    167167    int curid = temp->getGamestateID();
    168    
     168
    169169    if(gamestateID == 0){
    170170      temp->setGamestateID(GAMESTATEID_INITIAL);
    171171      return true;
    172172    }
    173    
     173
    174174    assert(curid<gamestateID);
    175175    COUT(4) << "acking gamestate " << gamestateID << " for clientid: " << clientID << " curid: " << curid << std::endl;
     
    194194    gamestateMap_.erase(clientMap);
    195195  }
    196  
     196
    197197  bool GamestateManager::processGamestate(packet::Gamestate *gs){
    198198    if(gs->isCompressed())
  • code/branches/objecthierarchy/src/network/packet/Packet.cc

    r1952 r1960  
    135135Packet *Packet::createPacket(ENetPacket *packet, ENetPeer *peer){
    136136  uint8_t *data = packet->data;
    137   assert(ClientInformation::findClient(&peer->address)->getID()!=-2 || !Host::isServer());
     137  assert(ClientInformation::findClient(&peer->address)->getID() != (unsigned int)-2 || !Host::isServer());
    138138  unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
    139139  Packet *p;
  • code/branches/objecthierarchy/src/orxonox/objects/Test.cc

    r1958 r1960  
    4646        Test::~Test()
    4747        {
    48                
     48
    4949        }
    5050
     
    6767          COUT(1) << "V1 changed: " << v1 << std::endl;
    6868        }
    69        
     69
    7070        void Test::checkV2(){
    71           COUT(1) << "V2 changed: " << v1 << std::endl;
     71          COUT(1) << "V2 changed: " << v2 << std::endl;
    7272        }
    73        
     73
    7474        void Test::checkV3(){
    75           COUT(1) << "V3 changed: " << v1 << std::endl;
     75          COUT(1) << "V3 changed: " << v3 << std::endl;
    7676        }
    77        
    78        
     77
     78
    7979}
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/PositionableEntity.cc

    r1947 r1960  
    4040
    4141        this->registerVariables();
    42 
    43         std::cout << "##### created pos-entity" << std::endl;
    4442    }
    4543
Note: See TracChangeset for help on using the changeset viewer.