Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 984


Ignore:
Timestamp:
Apr 3, 2008, 2:56:48 PM (17 years ago)
Author:
dumenim
Message:

some bugfix in GameStateManager.cc, CMakeLists now generates networktest executable, some test functions added

Location:
code/branches/network/src
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/CMakeLists.txt

    r790 r984  
    1111  Server.cc
    1212  Synchronisable.cc
    13   dummyserver3.cc
    1413)
    1514
     
    3130# build those parts only on request.
    3231IF(NETWORK_TESTING_ENABLED)
     32  ##### test for gamestate stuff #####
     33  SET( TEST_SRC_FILES
     34    ConnectionManager.cc
     35    GameStateManager.cc
     36    PacketBuffer.cc
     37    PacketDecoder.cc
     38    PacketGenerator.cc
     39    ClientConnection.cc
     40    ClientInformation.cc
     41    diffTest.cc
     42    GameStateClient.cc
     43    Server.cc
     44    Client.cc 
     45    Synchronisable.cc 
     46  )
     47
     48  ADD_EXECUTABLE(networktest ${TEST_SRC_FILES})
     49  TARGET_LINK_LIBRARIES( networktest
     50    ${OGRE_LIBRARIES}
     51    network
     52    ${ENet_LIBRARY}
     53    ${ZLIB_LIBRARY}
     54    ${WINDOWS_ENET_DEPENDENCIES}
     55  )
     56  ##### end test for gamestate stuff #####
     57ENDIF(NETWORK_TESTING_ENABLED)
     58IF(BLABLA)
    3359  SET( CHATCLIENT_SRC_FILES
    3460    ClientConnection.cc
     
    96122    ${WINDOWS_ENET_DEPENDENCIES}
    97123  )
    98 ENDIF(NETWORK_TESTING_ENABLED)
     124ENDIF(BLABLA)
     125
  • code/branches/network/src/network/GameStateClient.cc

    r912 r984  
    151151  }
    152152
     153  //##### ADDED FOR TESTING PURPOSE #####
     154  GameState* GameStateClient::testDecompress( GameStateCompressed* gc ) {
     155    return decompress( gc );
     156  }
     157 
     158  GameState* GameStateClient::testUndiff( GameState* g_old, GameState* g_diffed ) {
     159    return undiff( g_old, g_diffed );
     160  }
     161  //##### ADDED FOR TESTING PURPOSE #####
     162
    153163  GameState *GameStateClient::decompress(GameStateCompressed *a) {
    154164    int normsize = a->normsize;
  • code/branches/network/src/network/GameStateClient.h

    r905 r984  
    2323    GameStateClient();
    2424    ~GameStateClient();
     25    //#### ADDED FOR TESTING PURPOSE ####
     26    GameState* testDecompress( GameStateCompressed* gc );
     27    GameState* testUndiff( GameState* g_old, GameState* g_diffed );
     28    //#### END TESTING PURPOSE ####
    2529    bool pushGameState(GameStateCompressed *compstate);
    2630  private:
  • code/branches/network/src/network/GameStateManager.cc

    r905 r984  
    140140    COUT(5) << "Gamestate size: " << totalsize << std::endl;
    141141    retval->size=totalsize;
     142    //#### bugfix
     143    retval->diffed = false;
    142144    return retval;
    143145  }
     146
     147  //##### ADDED FOR TESTING PURPOSE #####
     148  GameStateCompressed* GameStateManager::testCompress( GameState* g ) {
     149    return compress_( g );
     150  }
     151
     152  GameState* GameStateManager::testDiff( GameState* a, GameState* b ) {
     153    return diff( a, b );
     154  }
     155  //##### END TESTING PURPOSE #####
    144156
    145157  GameStateCompressed *GameStateManager::encode(GameState *a, GameState *b) {
  • code/branches/network/src/network/GameStateManager.h

    r894 r984  
    4242    GameStateManager(ClientInformation *head);
    4343    ~GameStateManager();
     44    //#### ADDED FOR TESTING PURPOSE ####
     45    GameStateCompressed* testCompress( GameState* g );
     46    GameState* testDiff( GameState* a, GameState* b );
     47    //#### END TESTING PURPOSE ####
    4448    void update();
    4549    GameStateCompressed *popGameState(int clientID);
  • code/branches/network/src/network/PacketDecoder.cc

    r915 r984  
    1 /*
     1  /*
    22*   ORXONOX - the hottest 3D action shooter ever to exist
    33*
  • code/branches/network/src/orxonox/Orxonox.cc

    r934 r984  
    280280   
    281281    server_g->open();
    282    
     282
    283283    startRenderLoop();
    284284  }
Note: See TracChangeset for help on using the changeset viewer.