Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2007, 4:21:30 PM (17 years ago)
Author:
rgrieder
Message:
  • adjusted the entire source to compile under windows visual studio too:
  • added some ugly conversions
  • changed some illegal code pieces (gcc however accepted it)
  • added a few files from reto's framework to evade linker errors (no more dynamic linking)
  • inserted some 'return true' to justify the return type
  • excluded the levelLoader in the orxonox.cc (couldn't make it work, parsing error)
  • wrote about 5 code #branches to compensate for missing usleep() under windows
Location:
code/branches/FICN
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN

    • Property svn:ignore set to
      FICN.sln
      FICN.ncb
      FICN.vcproj
      FICN.vcproj.RGRIEDERT60.rgrieder.user
      FICN.suo
      obj
  • code/branches/FICN/src/network/ClientConnection.cc

    r337 r346  
    1212#include "ClientConnection.h"
    1313
     14// workaround for usleep(int) under windows
     15#ifdef WIN32
     16#include "winbase.h"
     17#endif
     18
    1419namespace network{
    1520
    16   boost::thread_group network_threads;
     21  static boost::thread_group network_threads;
    1722
    1823  ClientConnection::ClientConnection(int port, std::string address){
     
    3439  bool ClientConnection::waitEstablished(int milisec){
    3540    for(int i=0; i<=milisec && !established; i++)
     41// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     42#ifdef WIN32
     43      Sleep(1);
     44#else
    3645      usleep(1000);
     46#endif
    3747    return established;
    3848  }
  • code/branches/FICN/src/network/GameStateManager.cc

    r337 r346  
    106106  }
    107107 
    108  
     108  return true;
    109109}
    110110
     
    115115 */
    116116// orxonox::Iterator<Synchronisable> removeObject(orxonox::Iterator<Synchronisable> it){
    117 void removeObject(orxonox::Iterator<Synchronisable> &it){
     117void GameStateManager::removeObject(orxonox::Iterator<Synchronisable> &it){
    118118  orxonox::Iterator<Synchronisable> temp=it;
    119119  ++it;
  • code/branches/FICN/src/network/GameStateManager.h

    r337 r346  
    4444  bool loadSnapshot(GameState state);
    4545private:
    46   bool removeObject(orxonox::Iterator<Synchronisable> it);
     46  void removeObject(orxonox::Iterator<Synchronisable> &it);
    4747
    4848};
  • code/branches/FICN/src/network/PacketBufferTest.cc

    r337 r346  
    1414    p.data=i*i;
    1515    std::cout << i << ": pushing " << p.data << std::endl;
    16     test.push(p);
     16    test.push((ENetEvent*)&p);
    1717  }
    1818  std::cout << std::endl << "queue.print()" << std::endl;
    1919  test.print();
    2020  while(!test.isEmpty()){
    21     int i=test.pop().data;
     21    int i = (int)test.pop()->data;
    2222    std::cout << "We popped the value " << i << std::endl;
    2323  }
  • code/branches/FICN/src/network/PacketBufferTestExt.cc

    r337 r346  
    77
    88using namespace network;
     9
     10// workaround for usleep(int) under windows
     11#ifdef WIN32
     12#include "winbase.h"
     13#endif
    914
    1015
     
    1823ENET_PACKET_FLAG_RELIABLE);
    1924    std::cout << i << ": pushing " << packet->data << std::endl;
    20     test->push(packet);
     25    test->push((ENetEvent*)packet);
    2126    if(i==5)
     27// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     28#ifdef WIN32
     29      Sleep(200);
     30#else
    2231      usleep(200000);
     32#endif
    2333  }
    2434  test->setClosed(true);
  • code/branches/FICN/src/network/Synchronisable.cc

    r337 r346  
    2121{
    2222  datasize=0;
    23   registerAllVariables();
     23  //registerAllVariables();
    2424}
    2525
  • code/branches/FICN/src/network/Synchronisable.h

    r337 r346  
    5252  int getSize();
    5353  bool updateData(syncData vars);
    54   virtual void registerAllVariables();
     54  virtual void registerAllVariables() = 0;
    5555
    5656private:
  • code/branches/FICN/src/network/dummyclient.cc

    r337 r346  
    88#include <enet/enet.h>
    99#include "PacketManager.h"
     10
     11// workaround for usleep(int) under windows
     12#ifdef WIN32
     13#include "winbase.h"
     14#endif
     15
    1016
    1117using namespace std;
     
    6773      cout << "failed sending" << endl;
    6874    }
     75// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     76#ifdef WIN32
     77    Sleep(1000);
     78#else
    6979    usleep(1000000);
     80#endif
    7081  }
    7182
  • code/branches/FICN/src/network/dummyserver.cc

    r341 r346  
    99#include "ConnectionManager.h"
    1010#include "PacketManager.h"
     11
     12// workaround for usleep(int) under windows
     13#ifdef WIN32
     14#include "winbase.h"
     15#endif
     16
    1117
    1218using namespace network;
     
    2329  while(!quit){
    2430    if(server.queueEmpty())
     31// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     32// Warning: Sleep(1) is ten times longer than usleep(100)!
     33#ifdef WIN32
     34      Sleep(1);
     35#else
    2536      usleep(100);
     37#endif
    2638    else{
    2739      ENetAddress addr;
Note: See TracChangeset for help on using the changeset viewer.