Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 285


Ignore:
Timestamp:
Nov 27, 2007, 11:30:17 PM (17 years ago)
Author:
nicolasc
Message:

cleaned up network, builds with CML

Location:
code/branches/merger/src
Files:
1 added
18 edited

Legend:

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

    r280 r285  
    1212ADD_SUBDIRECTORY(orxonox)
    1313ADD_SUBDIRECTORY(loader)
     14ADD_SUBDIRECTORY(network)
  • code/branches/merger/src/network/Client.cc

    r278 r285  
    22// C++ Implementation: Client
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    1111//
    1212
    13 #include "network/Client.h"
     13#include "Client.h"
    1414
    1515namespace network{
    16  
     16
    1717  /**
    1818   * Constructor for the Client class
     
    2525    isConnected=false;
    2626  }
    27  
     27
    2828  /**
    2929   * Constructor for the Client class
     
    3636    isConnected=false;
    3737  }
    38  
     38
    3939  /**
    4040   * Constructor for the Client class
     
    4747    isConnected=false;
    4848  }
    49  
     49
    5050  /**
    5151   * Establish the Connection to the Server
     
    5656    return isConnected;
    5757  }
    58  
     58
    5959  /**
    6060   * closes the Connection to the Server
     
    6565    return client_connection.closeConnection();
    6666  }
    67  
     67
    6868  /**
    6969   * submits a MouseAction to the server
     
    8484      return false;
    8585  }
    86  
     86
    8787  /**
    8888   * submits a Keystrike to the server
     
    102102      return false;
    103103  }
    104  
     104
    105105  /**
    106106   * Adds a MouseAction to the PacketQueue
     
    116116      return false;
    117117  }
    118  
     118
    119119  /**
    120120   * Adds a Keystrike to the PacketQueue
     
    130130      return false;
    131131  }
    132  
     132
    133133  /**
    134134   * Performs a GameState update
     
    136136  void Client::update(){
    137137    // to be implemented ==================
    138    
    139    
     138
     139
    140140  }
    141  
     141
    142142}
  • code/branches/merger/src/network/Client.h

    r278 r285  
    22// C++ Interface: Client
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    1616#include <string>
    1717
    18 #include "network/ClientConnection.h"
    19 #include "network/PacketManager.h"
     18#include "ClientConnection.h"
     19#include "PacketManager.h"
    2020
    2121
     
    2626 * This class implements all necessary function for the network communication
    2727 * It is the root class of the network module
    28  * 
     28 *
    2929 */
    3030class Client : PacketDecoder{
     
    3333  Client(std::string address, int port);
    3434  Client(const char *address, int port);
    35  
     35
    3636  bool establishConnection();
    3737  bool closeConnection();
    38  
     38
    3939  bool sendMouse(double x, double y);
    4040  bool sendKeyboard(char key_code);
    41  
     41
    4242  bool addMouse(double x, double y);
    4343  bool addKeyboard(char key_code);
    44  
     44
    4545  void update();
    46  
     46
    4747  private:
    4848  ClientConnection client_connection;
    4949  PacketGenerator pck_gen;
    50  
     50
    5151  //const char *server_address;
    5252  //int port;
  • code/branches/merger/src/network/ClientConnection.cc

    r278 r285  
    22// C++ Interface: ClientConnection
    33//
    4 // Description: The Class ClientConnection manages the servers conenctions to the clients. 
    5 // each connection is provided by a new process. communication between master process and 
     4// Description: The Class ClientConnection manages the servers conenctions to the clients.
     5// each connection is provided by a new process. communication between master process and
    66// connection processes is provided by ...
    77//
     
    1010//
    1111
    12 #include "network/ClientConnection.h"
     12#include "ClientConnection.h"
    1313
    1414namespace network{
    15  
     15
    1616  boost::thread_group network_threads;
    17  
     17
    1818  ClientConnection::ClientConnection(int port, std::string address){
    1919    quit=false;
     
    2323    established=false;
    2424  }
    25  
     25
    2626  ClientConnection::ClientConnection(int port, const char *address){
    2727    quit=false;
     
    3131    established=false;
    3232  }
    33  
     33
    3434  bool ClientConnection::waitEstablished(int milisec){
    3535    for(int i=0; i<=milisec && !established; i++)
     
    3737    return established;
    3838  }
    39  
    40  
     39
     40
    4141  ENetPacket *ClientConnection::getPacket(ENetAddress &address){
    4242    if(!buffer.isEmpty())
     
    4545        return NULL;
    4646  }
    47  
     47
    4848  bool ClientConnection::queueEmpty(){
    4949    return buffer.isEmpty();
    5050  }
    51  
     51
    5252  bool ClientConnection::createConnection(){
    5353    network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
     
    5555    return waitEstablished(10000);
    5656  }
    57  
     57
    5858  bool ClientConnection::closeConnection(){
    5959    quit=true;
     
    6262    return true;
    6363  }
    64  
    65  
     64
     65
    6666  bool ClientConnection::addPacket(ENetPacket *packet){
    6767    if(server==NULL)
     
    7272      return true;
    7373  }
    74  
     74
    7575  bool ClientConnection::sendPackets(ENetEvent *event){
    7676    if(server==NULL)
     
    7878    if(enet_host_service(client, event, NETWORK_SEND_WAIT)>=0)
    7979      return true;
    80     else 
     80    else
    8181      return false;
    8282  }
    83  
     83
    8484  bool ClientConnection::sendPackets(){
    8585    ENetEvent event;
     
    8888    if(enet_host_service(client, &event, NETWORK_SEND_WAIT)>=0)
    8989      return true;
    90     else 
     90    else
    9191      return false;
    9292  }
    93  
     93
    9494  void ClientConnection::receiverThread(){
    9595    // what about some error-handling here ?
     
    123123    }
    124124    // now disconnect
    125    
    126     if(!disconnectConnection()) 
     125
     126    if(!disconnectConnection())
    127127    // if disconnecting failed destroy conn.
    128128      enet_peer_reset(server);
    129129    return;
    130130  }
    131  
     131
    132132  bool ClientConnection::disconnectConnection(){
    133133    ENetEvent event;
     
    145145    enet_peer_reset(server);
    146146  }
    147  
     147
    148148  bool ClientConnection::establishConnection(){
    149149    ENetEvent event;
     
    161161      return false;
    162162  }
    163  
     163
    164164  bool ClientConnection::processData(ENetEvent *event){
    165165    // just add packet to the buffer
     
    167167    return buffer.push(event);
    168168  }
    169  
    170  
     169
     170
    171171}
  • code/branches/merger/src/network/ClientConnection.h

    r278 r285  
    22// C++ Interface: ClientConnection
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    2121#include <boost/bind.hpp>
    2222// headerfile
    23 #include "network/ClientConnection.h"
    24 #include "network/PacketBuffer.h"
     23#include "ClientConnection.h"
     24#include "PacketBuffer.h"
    2525
    2626namespace network{
     
    3131#define NETWORK_SEND_WAIT 5
    3232#define NETWORK_CLIENT_CHANNELS 2
    33  
    34  
     33
     34
    3535  class ClientConnection{
    3636    public:
     
    6767    ENetPeer *server;
    6868  };
    69  
    70  
    71  
    72  
    73  
    74  
    75  
    76  
     69
     70
     71
     72
     73
     74
     75
     76
    7777}
    7878
  • code/branches/merger/src/network/ConnectionManager.cc

    r278 r285  
    22// C++ Interface: ConnectionManager
    33//
    4 // Description: The Class ConnectionManager manages the servers conenctions to the clients. 
    5 // each connection is provided by a new process. communication between master process and 
     4// Description: The Class ConnectionManager manages the servers conenctions to the clients.
     5// each connection is provided by a new process. communication between master process and
    66// connection processes is provided by ...
    77//
     
    1010//
    1111
    12 #include "network/ConnectionManager.h"
     12#include "ConnectionManager.h"
    1313
    1414namespace network{
    15  
     15
    1616  boost::thread_group network_threads;
    17  
     17
    1818  void test(){
    1919    return;
    2020  }
    21  
     21
    2222  ConnectionManager::ConnectionManager(){
    2323    quit=false;
     
    2626    bindAddress.port = NETWORK_PORT;
    2727  }
    28  
     28
    2929  ConnectionManager::ConnectionManager(int port, std::string address){
    3030    quit=false;
     
    3333    bindAddress.port = NETWORK_PORT;
    3434  }
    35  
     35
    3636  ConnectionManager::ConnectionManager(int port, const char *address){
    3737    quit=false;
     
    4040    bindAddress.port = NETWORK_PORT;
    4141  }
    42  
     42
    4343  ENetPacket *ConnectionManager::getPacket(ENetAddress &address){
    4444    if(!buffer.isEmpty())
     
    4747        return NULL;
    4848  }
    49  
     49
    5050  bool ConnectionManager::queueEmpty(){
    5151    return buffer.isEmpty();
    5252  }
    53  
     53
    5454  void ConnectionManager::createListener(){
    5555    network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
     
    5757    return;
    5858  }
    59  
     59
    6060  bool ConnectionManager::quitListener(){
    6161    quit=true;
     
    6363    return true;
    6464  }
    65  
     65
    6666  bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer){
    6767    if(client=NULL)
     
    7777    return true;
    7878  }
    79  
     79
    8080  bool ConnectionManager::addPacket(ENetPacket *packet, int ID){
    8181    if(client==NULL)
     
    9292      return true;
    9393  }
    94  
     94
    9595  bool ConnectionManager::addPacketAll(ENetPacket *packet){
    9696    ClientList *temp=client;
     
    101101    return true;
    102102  }
    103  
     103
    104104  bool ConnectionManager::sendPackets(ENetEvent *event){
    105105    if(server==NULL)
     
    107107    if(enet_host_service(server, event, NETWORK_SEND_WAIT)>=0)
    108108      return true;
    109     else 
    110       return false;
    111   }
    112  
     109    else
     110      return false;
     111  }
     112
    113113  void ConnectionManager::receiverThread(){
    114114    // what about some error-handling here ?
     
    120120      // add some error handling here ==========================
    121121      quit=true;
    122    
     122
    123123    while(!quit){
    124124      if(enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT)<0){
     
    144144    enet_host_destroy(server);
    145145  }
    146  
     146
    147147  bool ConnectionManager::processData(ENetEvent *event){
    148148    // just add packet to the buffer
     
    150150    return buffer.push(event);
    151151  }
    152  
     152
    153153  bool ConnectionManager::clientDisconnect(ENetPeer *peer){
    154154    ClientList *temp=client;
     
    177177    return false;
    178178  }
    179  
     179
    180180  bool ConnectionManager::addClient(ENetEvent *event){
    181    
     181
    182182    // first client?
    183183    if(client==NULL){
     
    202202    return true;
    203203  }
    204  
    205  
     204
     205
    206206}
  • code/branches/merger/src/network/ConnectionManager.h

    r278 r285  
    22// C++ Interface: ConnectionManager
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    2121#include <boost/bind.hpp>
    2222// headerfile
    23 #include "network/ConnectionManager.h"
    24 #include "network/PacketBuffer.h"
     23#include "ConnectionManager.h"
     24#include "PacketBuffer.h"
    2525
    2626namespace network{
     
    3535// #define ENetAddress std::ENetAddress
    3636// #define ENetPeer std::ENetPeer
    37  
     37
    3838  struct ClientList{
    3939    ENetEvent *event;
     
    4141    ClientList *next;
    4242  };
    43  
     43
    4444  class ConnectionManager{
    4545    public:
     
    7979//     boost::thread_group threads;
    8080  };
    81  
    82  
    83  
    84  
    85  
    86  
    87  
    88  
     81
     82
     83
     84
     85
     86
     87
     88
    8989}
    9090
  • code/branches/merger/src/network/Makefile

    r278 r285  
    1 CC=g++
    2 MAIN_INC=..
    3 INC=-I ${MAIN_INC}
    4 
    5 all: server client
    6 
    7 # Link command:
    8 server: PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o
    9         ${CC} PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
    10 
    11 dummyserver.o: dummyserver.cc
    12         ${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
    13 # Compilation commands:
    14 ConnectionManager.o: ConnectionManager.cc ConnectionManager.h
    15         ${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
    16 ClientConnection.o: ClientConnection.cc ClientConnection.h
    17         ${CC} -c ClientConnection.cc -o ClientConnection.o -g ${INC}
    18 
    19 PacketBuffer.o: PacketBuffer.cc
    20         ${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
    21 PacketGenerator.o: PacketGenerator.cc
    22         ${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
    23 PacketDecoder.o: PacketDecoder.cc
    24         ${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
    25 Client.o: Client.cc
    26         ${CC} -c Client.cc -g ${INC}
    27 Server.o: Server.cc
    28         ${CC} -c Server.cc -g ${INC}
    29 Synchronisable.o: Synchronisable.cc
    30         ${CC} -c Synchronisable.cc -g ${INC}
    31 GameStateManager.o: GameStateManager.cc
    32         ${CC} -c GameStateManager.cc -g ${INC}
    33 
     1# CMAKE generated file: DO NOT EDIT!
     2# Generated by "Unix Makefiles" Generator, CMake Version 2.4
     3
     4# Default target executed when no arguments are given to make.
     5default_target: all
     6
     7#=============================================================================
     8# Special targets provided by cmake.
     9
     10# Disable implicit rules so canoncical targets will work.
     11.SUFFIXES:
     12
     13.SUFFIXES: .hpux_make_needs_suffix_list
     14
     15# Produce verbose output by default.
     16VERBOSE = 1
     17
     18# Suppress display of executed commands.
     19$(VERBOSE).SILENT:
     20
     21# A target that is always out of date.
     22cmake_force:
     23
     24#=============================================================================
     25# Set environment variables for the build.
     26
     27# The shell in which to execute make rules.
     28SHELL = /bin/sh
     29
     30# The CMake executable.
     31CMAKE_COMMAND = /usr/bin/cmake
     32
     33# The command to remove a file.
     34RM = /usr/bin/cmake -E remove -f
     35
     36# The program to use to edit the cache.
     37CMAKE_EDIT_COMMAND = /usr/bin/ccmake
     38
     39# The top-level source directory on which CMake was run.
     40CMAKE_SOURCE_DIR = /home/nicolasc/development/orxonoxV2/branches/merger
     41
     42# The top-level build directory on which CMake was run.
     43CMAKE_BINARY_DIR = /home/nicolasc/development/orxonoxV2/branches/merger
     44
     45# Include the progress variables for this target.
     46include CMakeFiles/progress.make
     47
     48#=============================================================================
     49# Targets provided globally by CMake.
     50
     51# Special rule for the target edit_cache
     52edit_cache:
     53        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
     54        cd /home/nicolasc/development/orxonoxV2/branches/merger/src/network && /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
     55
     56# Special rule for the target edit_cache
     57edit_cache/fast: edit_cache
     58
     59# Special rule for the target rebuild_cache
     60rebuild_cache:
     61        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
     62        cd /home/nicolasc/development/orxonoxV2/branches/merger/src/network && /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
     63
     64# Special rule for the target rebuild_cache
     65rebuild_cache/fast: rebuild_cache
     66
     67# The main all target
     68all: cmake_check_build_system
     69        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(CMAKE_COMMAND) -E cmake_progress_start /home/nicolasc/development/orxonoxV2/branches/merger/CMakeFiles $(CMAKE_ALL_PROGRESS)
     70        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f CMakeFiles/Makefile2 src/network/all
     71        $(CMAKE_COMMAND) -E cmake_progress_start /home/nicolasc/development/orxonoxV2/branches/merger/CMakeFiles 0
     72
     73# The main clean target
    3474clean:
    35         rm -rf *.o
    36 
    37 client_old: PacketGenerator.o dummyclient.cc
    38         ${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
    39 client: PacketGenerator.o ClientConnection.o PacketBuffer.o dummyclient2.cc
    40         ${CC} dummyclient2.cc PacketGenerator.o PacketBuffer.o ClientConnection.o -o client -lenet -lboost_thread -g ${INC}
     75        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f CMakeFiles/Makefile2 src/network/clean
     76
     77# The main clean target
     78clean/fast: clean
     79
     80# Prepare targets for installation.
     81preinstall: all
     82        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f CMakeFiles/Makefile2 src/network/preinstall
     83
     84# Prepare targets for installation.
     85preinstall/fast:
     86        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f CMakeFiles/Makefile2 src/network/preinstall
     87
     88# clear depends
     89depend:
     90        $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
     91
     92# Convenience name for target.
     93src/network/CMakeFiles/network.dir/rule:
     94        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f CMakeFiles/Makefile2 src/network/CMakeFiles/network.dir/rule
     95
     96# Convenience name for target.
     97network: src/network/CMakeFiles/network.dir/rule
     98
     99# fast build rule for target.
     100network/fast:
     101        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/build
     102
     103# target to build an object file
     104Client.o:
     105        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Client.o
     106
     107# target to preprocess a source file
     108Client.i:
     109        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Client.i
     110
     111# target to generate assembly for a file
     112Client.s:
     113        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Client.s
     114
     115# target to build an object file
     116ClientConnection.o:
     117        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/ClientConnection.o
     118
     119# target to preprocess a source file
     120ClientConnection.i:
     121        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/ClientConnection.i
     122
     123# target to generate assembly for a file
     124ClientConnection.s:
     125        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/ClientConnection.s
     126
     127# target to build an object file
     128ConnectionManager.o:
     129        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/ConnectionManager.o
     130
     131# target to preprocess a source file
     132ConnectionManager.i:
     133        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/ConnectionManager.i
     134
     135# target to generate assembly for a file
     136ConnectionManager.s:
     137        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/ConnectionManager.s
     138
     139# target to build an object file
     140GameStateManager.o:
     141        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/GameStateManager.o
     142
     143# target to preprocess a source file
     144GameStateManager.i:
     145        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/GameStateManager.i
     146
     147# target to generate assembly for a file
     148GameStateManager.s:
     149        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/GameStateManager.s
     150
     151# target to build an object file
     152PacketBuffer.o:
     153        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketBuffer.o
     154
     155# target to preprocess a source file
     156PacketBuffer.i:
     157        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketBuffer.i
     158
     159# target to generate assembly for a file
     160PacketBuffer.s:
     161        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketBuffer.s
     162
     163# target to build an object file
     164PacketDecoder.o:
     165        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketDecoder.o
     166
     167# target to preprocess a source file
     168PacketDecoder.i:
     169        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketDecoder.i
     170
     171# target to generate assembly for a file
     172PacketDecoder.s:
     173        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketDecoder.s
     174
     175# target to build an object file
     176PacketGenerator.o:
     177        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketGenerator.o
     178
     179# target to preprocess a source file
     180PacketGenerator.i:
     181        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketGenerator.i
     182
     183# target to generate assembly for a file
     184PacketGenerator.s:
     185        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/PacketGenerator.s
     186
     187# target to build an object file
     188Server.o:
     189        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Server.o
     190
     191# target to preprocess a source file
     192Server.i:
     193        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Server.i
     194
     195# target to generate assembly for a file
     196Server.s:
     197        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Server.s
     198
     199# target to build an object file
     200Synchronisable.o:
     201        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Synchronisable.o
     202
     203# target to preprocess a source file
     204Synchronisable.i:
     205        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Synchronisable.i
     206
     207# target to generate assembly for a file
     208Synchronisable.s:
     209        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/Synchronisable.s
     210
     211# target to build an object file
     212dummyclient.o:
     213        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyclient.o
     214
     215# target to preprocess a source file
     216dummyclient.i:
     217        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyclient.i
     218
     219# target to generate assembly for a file
     220dummyclient.s:
     221        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyclient.s
     222
     223# target to build an object file
     224dummyclient2.o:
     225        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyclient2.o
     226
     227# target to preprocess a source file
     228dummyclient2.i:
     229        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyclient2.i
     230
     231# target to generate assembly for a file
     232dummyclient2.s:
     233        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyclient2.s
     234
     235# target to build an object file
     236dummyserver.o:
     237        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyserver.o
     238
     239# target to preprocess a source file
     240dummyserver.i:
     241        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyserver.i
     242
     243# target to generate assembly for a file
     244dummyserver.s:
     245        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(MAKE) -f src/network/CMakeFiles/network.dir/build.make src/network/CMakeFiles/network.dir/dummyserver.s
     246
     247# Help Target
     248help::
     249        @echo "The following are some of the valid targets for this Makefile:"
     250        @echo "... all (the default if no target is provided)"
     251        @echo "... clean"
     252        @echo "... depend"
     253        @echo "... edit_cache"
     254        @echo "... network"
     255        @echo "... rebuild_cache"
     256        @echo "... Client.o"
     257        @echo "... Client.i"
     258        @echo "... Client.s"
     259        @echo "... ClientConnection.o"
     260        @echo "... ClientConnection.i"
     261        @echo "... ClientConnection.s"
     262        @echo "... ConnectionManager.o"
     263        @echo "... ConnectionManager.i"
     264        @echo "... ConnectionManager.s"
     265        @echo "... GameStateManager.o"
     266        @echo "... GameStateManager.i"
     267        @echo "... GameStateManager.s"
     268        @echo "... PacketBuffer.o"
     269        @echo "... PacketBuffer.i"
     270        @echo "... PacketBuffer.s"
     271        @echo "... PacketDecoder.o"
     272        @echo "... PacketDecoder.i"
     273        @echo "... PacketDecoder.s"
     274        @echo "... PacketGenerator.o"
     275        @echo "... PacketGenerator.i"
     276        @echo "... PacketGenerator.s"
     277        @echo "... Server.o"
     278        @echo "... Server.i"
     279        @echo "... Server.s"
     280        @echo "... Synchronisable.o"
     281        @echo "... Synchronisable.i"
     282        @echo "... Synchronisable.s"
     283        @echo "... dummyclient.o"
     284        @echo "... dummyclient.i"
     285        @echo "... dummyclient.s"
     286        @echo "... dummyclient2.o"
     287        @echo "... dummyclient2.i"
     288        @echo "... dummyclient2.s"
     289        @echo "... dummyserver.o"
     290        @echo "... dummyserver.i"
     291        @echo "... dummyserver.s"
     292
     293
     294
     295#=============================================================================
     296# Special targets to cleanup operation of make.
     297
     298# Special rule to run CMake to check the build system integrity.
     299# No rule that depends on this can have commands that come from listfiles
     300# because they might be regenerated.
     301cmake_check_build_system:
     302        cd /home/nicolasc/development/orxonoxV2/branches/merger && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
     303
  • code/branches/merger/src/network/PacketBuffer.cc

    r278 r285  
    77
    88#include <iostream>
    9 #include "network/PacketBuffer.h"
     9#include "PacketBuffer.h"
    1010
    1111namespace network{
    12  
     12
    1313   boost::mutex networkPacketBufferMutex;
    14  
     14
    1515PacketBuffer::PacketBuffer(){
    1616  closed=false;
     
    1919}
    2020    //this is needed in order to make the packetbuffer threadsafe
    21  
     21
    2222
    2323bool PacketBuffer::push(ENetEvent *ev){
     
    8787    temp=temp->next;
    8888  }
    89  
     89
    9090}
    9191
  • code/branches/merger/src/network/PacketBufferTest.cc

    r278 r285  
    1 #include "network/PacketBuffer.h"
    2 #include "network/PacketBuffer.cc"
     1#include "PacketBuffer.h"
     2#include "PacketBuffer.cc"
    33#include <iostream>
    44#include <string>
  • code/branches/merger/src/network/PacketBufferTestExt.cc

    r278 r285  
    33#include <enet/enet.h>
    44#include <boost/thread/thread.hpp>
    5 #include "network/PacketBuffer.h"
    6 #include "network/PacketBuffer.cc"
     5#include "PacketBuffer.h"
     6#include "PacketBuffer.cc"
    77
    88using namespace network;
     
    1515  for(int i=0; i<10; i++){
    1616    std::string temp = "packet ";
    17     packet = enet_packet_create("packet", strlen("packet ")+1, 
     17    packet = enet_packet_create("packet", strlen("packet ")+1,
    1818ENET_PACKET_FLAG_RELIABLE);
    1919    std::cout << i << ": pushing " << packet->data << std::endl;
     
    4343  boost::thread thrd1(boost::bind(&write, &test));
    4444  boost::thread thrd2(boost::bind(&read, &test));
    45    
     45
    4646  thrd1.join();
    4747  thrd2.join();
    48  
     48
    4949  return 0;
    5050}
  • code/branches/merger/src/network/Server.cc

    r278 r285  
    22// C++ Implementation: Server
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    1212
    1313
    14 #include "network/Server.h"
     14#include "Server.h"
    1515
    1616namespace network{
    17  
     17
    1818  /**
    1919   * Constructor for default values (bindaddress is set to ENET_HOST_ANY
    20    * 
     20   *
    2121   */
    2222  Server::Server(){
    23    
    24    
     23
     24
    2525  }
    26  
     26
    2727  /**
    2828   * Constructor
     
    3131   */
    3232  Server::Server(int port, std::string bindAddress) : connection(port, bindAddress){
    33    
    34    
     33
     34
    3535  }
    36  
     36
    3737  /**
    3838   * Constructor
     
    4141   */
    4242  Server::Server(int port, const char *bindAddress) : connection(port, bindAddress){
    43    
    44    
    45    
    46    
     43
     44
     45
     46
    4747  }
    48  
    49  
    50  
    51  
    52  
     48
     49
     50
     51
     52
    5353}
  • code/branches/merger/src/network/Server.h

    r278 r285  
    22// C++ Interface: Server
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    1616#include <string>
    1717
    18 #include "network/ConnectionManager.h"
    19 #include "network/PacketManager.h"
     18#include "ConnectionManager.h"
     19#include "PacketManager.h"
    2020
    2121
    2222namespace network{
    23  
     23
    2424  /**
    2525   * This class is the root class of the network module for a server.
     
    3131    Server(int port, std::string bindAddress);
    3232    Server(int port, const char *bindAddress);
    33    
     33
    3434    private:
    3535    ConnectionManager connection;
    36    
    37    
    38    
    39    
    40    
    41    
    42    
     36
     37
     38
     39
     40
     41
     42
    4343  };
    44  
    45  
    46  
    47  
    48  
     44
     45
     46
     47
     48
    4949}
    5050
  • code/branches/merger/src/network/Synchronisable.cc

    r278 r285  
    22// C++ Implementation: synchronisable
    33//
    4 // Description: 
     4// Description:
    55//
    66//
     
    1010//
    1111
    12 #include "network/Synchronisable.h"
     12#include "Synchronisable.h"
    1313
    1414namespace network {
     
    2727Synchronisable::~Synchronisable()
    2828{
    29  
     29
    3030}
    3131
     
    7272  int n=0;
    7373  for(i=syncList.begin(); n<totalsize && i!=syncList.end(); i++){
    74         //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID* 
     74        //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID*
    7575    std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int));
    7676    n+=sizeof(int);
     
    102102  int n=0;
    103103  for(i=syncList.begin(); n<datasize && i!=syncList.end(); i++){
    104         //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID* 
     104        //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID*
    105105    std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int));
    106106    n+=sizeof(int);
  • code/branches/merger/src/network/dummyclient.cc

    r278 r285  
    77#include <string>
    88#include <enet/enet.h>
    9 #include "network/PacketManager.h"
     9#include "PacketManager.h"
    1010
    1111using namespace std;
     
    2020  enet_initialize();
    2121  atexit(enet_deinitialize);
    22  
     22
    2323  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
    2424  string str;
     
    2727  if(str.compare("")==0)
    2828    str="127.0.0.1";
    29  
     29
    3030  enet_address_set_host(&address, str.c_str());
    3131  address.port = 55556;
     
    8787  enet_peer_reset(peer);
    8888
    89  
    90  
     89
     90
    9191  return 0;
    9292}
  • code/branches/merger/src/network/dummyclient2.cc

    r278 r285  
    77#include <string>
    88#include <enet/enet.h>
    9 #include "network/PacketManager.h"
    10 #include "network/ClientConnection.h"
     9#include "PacketManager.h"
     10#include "ClientConnection.h"
    1111
    1212using namespace network;
     
    2525
    2626  client.createConnection();
    27  
     27
    2828  if(client.waitEstablished(10000))
    2929    std::cout << "Connection established" << std::endl;
    3030  else
    3131    std::cout << "Connection failed" << std::endl;
    32  
     32
    3333  ENetPacket *packet;
    3434  ENetEvent event;
    35  
    36  
    37  
     35
     36
     37
    3838  for(int i=0; i<10; i++){
    3939        // weihnachtsmann bringt packete
  • code/branches/merger/src/network/dummyserver.cc

    r278 r285  
    77#include <iostream>
    88#include "enet/enet.h"
    9 #include "network/ConnectionManager.h"
    10 #include "network/PacketManager.h"
     9#include "ConnectionManager.h"
     10#include "PacketManager.h"
    1111
    1212using namespace network;
     
    1818  ENetEvent event;
    1919  server.createListener();
    20  
     20
    2121  PacketDecoder dec;
    22  
     22
    2323  while(!quit){
    2424    if(server.queueEmpty())
  • code/branches/merger/src/orxonox/CMakeLists.txt

    r280 r285  
    77ADD_EXECUTABLE(../../bin/main ${SRC_FILES} ${INC_FILES})
    88
    9 TARGET_LINK_LIBRARIES(../../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES} core objects loader)
     9TARGET_LINK_LIBRARIES(../../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES} core objects loader network)
    1010
    1111
Note: See TracChangeset for help on using the changeset viewer.