Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2008, 3:54:20 PM (16 years ago)
Author:
rgrieder
Message:
  • @everyone: Do not create a branch until I've added the svn:eol-style property correctly. Otherwise this would cost me another 4 hours or so when we want to merge back.
  • merged network branch back to trunk
  • I had to omit the changes from last evening concerning the line endings
  • might not work yet because of the line endings
  • @beni: script branch is the only branch still open. you probably will have to apply a patch because of inconsistent new lines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/ConnectionManager.h

    r1293 r1502  
    4848#include <enet/enet.h>
    4949#include <boost/thread/thread.hpp>
     50#include <boost/thread/recursive_mutex.hpp>
    5051
    5152#include "PacketBuffer.h"
     
    6162#define NETWORK_PORT 55556
    6263#define NETWORK_MAX_CONNECTIONS 50
    63 #define NETWORK_WAIT_TIMEOUT 5000
    64 #define NETWORK_SEND_WAIT 5
     64#define NETWORK_WAIT_TIMEOUT 1
    6565
    6666  struct ClientList{
     
    7474    ConnectionManager();
    7575    ConnectionManager(ClientInformation *head);
     76    ConnectionManager(ClientInformation *head, int port);
    7677    ConnectionManager(int port, const char *address, ClientInformation *head);
    7778    ConnectionManager(int port, std::string address, ClientInformation *head);
    78     ENetPacket *getPacket(ENetAddress &address); // thread1
    79     ENetPacket *getPacket(int &clientID);
     79    //ENetPacket *getPacket(ENetAddress &address); // thread1
     80    //ENetPacket *getPacket(int &clientID);
     81    ENetEvent *getEvent();
    8082    bool queueEmpty();
    8183    void createListener();
     
    8486    bool addPacket(ENetPacket *packet, int ID);
    8587    bool addPacketAll(ENetPacket *packet);
    86     bool sendPackets(ENetEvent *event);
     88  //  bool sendPackets(ENetEvent *event);
    8789    bool sendPackets();
    88     bool createClient(int clientID);
     90    //bool createClient(int clientID);
    8991    void disconnectClient(ClientInformation *client);
     92    void syncClassid(int clientID);
     93    bool sendWelcome(int clientID, int shipID, bool allowed);
    9094
    9195  private:
    92     bool clientDisconnect(ENetPeer *peer);
    93     bool removeClient(int clientID);
     96//     bool clientDisconnect(ENetPeer *peer);
     97//     bool removeClient(int clientID);
    9498    bool processData(ENetEvent *event);
    95     bool addClient(ENetEvent *event);
     99    //bool addClient(ENetEvent *event);
    96100    void receiverThread();
    97101    void disconnectClients();
    98102    int getClientID(ENetPeer peer);
    99103    int getClientID(ENetAddress address);
    100     void syncClassid(int clientID);
    101104    ENetPeer *getClientPeer(int clientID);
    102     bool createShip(ClientInformation *client);
     105    //bool createShip(ClientInformation *client);
    103106    bool removeShip(ClientInformation *client);
    104     bool sendWelcome(int clientID, int shipID, bool allowed);
    105107    bool addFakeConnectRequest(ENetEvent *ev);
    106108    PacketBuffer buffer;
     
    114116
    115117    boost::thread *receiverThread_;
     118    static boost::recursive_mutex enet_mutex_;
    116119//     int getNumberOfClients();
    117120    //functions to map what object every clients uses
Note: See TracChangeset for help on using the changeset viewer.