Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2010, 6:09:09 PM (13 years ago)
Author:
scheusso
Message:

merged network5 into presentation2 branch (untested)

Location:
code/branches/presentation2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2

  • code/branches/presentation2/src/libraries/network/Host.h

    r7284 r7788  
    3131
    3232#include "NetworkPrereqs.h"
     33#include "GamestateManager.h"
    3334#include "core/CorePrereqs.h"
    3435
     
    4950*       @author Oliver Scheuss
    5051*/
    51 class _NetworkExport Host{
     52class _NetworkExport Host: public GamestateManager
     53{
    5254  private:
    5355    //TODO add these functions or adequate
    5456    //virtual bool processChat(packet::Chat *message, unsigned int clientID)=0;
    5557    //virtual bool sendChat(packet::Chat *chat)=0;
    56     virtual bool queuePacket(ENetPacket *packet, int clientID)=0;
     58    virtual void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID)=0;
    5759    virtual bool chat(const std::string& message)=0;
    5860    virtual bool broadcast(const std::string& message)=0;
     
    7173//     static Host* getInstance(){ return instance_; }
    7274    static bool running(){ return instances_s.size(); }
    73     static bool addPacket(ENetPacket *packet, int clientID=0);
     75    static void addPacket(ENetPacket* packet, int clientID = NETWORK_PEER_ID_SERVER, uint8_t channelID = 0);
    7476    //static bool chat(std::string& message);
    7577//     static bool receiveChat(packet::Chat *message, unsigned int clientID);
    7678    static unsigned int getPlayerID(){ return clientID_s; }
    77     static unsigned int getShipID(){return shipID_s;}
    7879    static void setClientID(unsigned int id){ clientID_s = id; }
    79     static void setShipID(unsigned int id){ shipID_s = id; }
    8080    static bool isServer();
    8181    static void Chat(const std::string& message);
     
    8686  private:
    8787    static uint32_t clientID_s;
    88     static uint32_t shipID_s;
    8988    static std::vector<Host*> instances_s;
    9089    bool bIsActive_;
Note: See TracChangeset for help on using the changeset viewer.