Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 31, 2007, 7:40:23 PM (16 years ago)
Author:
rgrieder
Message:
  • added dll support to the network library
  • improved header file dependency in network
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/Client.h

    r774 r777  
    1616#include <string>
    1717
     18#include "NetworkPrereqs.h"
    1819#include "ClientConnection.h"
    1920#include "PacketManager.h"
    2021#include "GameStateClient.h"
    21 #include "core/CoreIncludes.h"
    2222//#include "NetworkFrameListener.h"
    2323
    2424
    25 namespace network{
     25namespace network
     26{
     27  /**
     28  network::Client *client;
     29  * The network/Client class
     30  * This class implements all necessary function for the network communication
     31  * It is the root class of the network module
     32  *
     33  */
     34  class _NetworkExport Client : PacketDecoder{
     35  public:
     36    Client();
     37    Client(std::string address, int port);
     38    Client(const char *address, int port);
    2639
     40    bool establishConnection();
     41    bool closeConnection();
    2742
    28  
    29 /**
    30   network::Client *client;
    31  * The network/Client class
    32  * This class implements all necessary function for the network communication
    33  * It is the root class of the network module
    34  *
    35  */
    36 class Client : PacketDecoder{
    37   public:
    38   Client();
    39   Client(std::string address, int port);
    40   Client(const char *address, int port);
     43    bool sendMouse(double x, double y);
     44    bool sendKeyboard(char key_code);
     45    bool sendChat( std::string message );
    4146
    42   bool establishConnection();
    43   bool closeConnection();
     47    bool addMouse(double x, double y);
     48    bool addKeyboard(char key_code);
    4449
    45   bool sendMouse(double x, double y);
    46   bool sendKeyboard(char key_code);
    47   bool sendChat( std::string message );
     50    bool sendPackets();
    4851
    49   bool addMouse(double x, double y);
    50   bool addKeyboard(char key_code);
    51 
    52   bool sendPackets();
    53  
    54   void tick(float time);
     52    void tick(float time);
    5553
    5654  private:
    57   ClientConnection client_connection;
    58   PacketGenerator pck_gen;
    59   GameStateClient gamestate;
    60   bool isConnected;
    61  
    62   // implement data processing functions of PacketDecoder
    63   void processGamestate( GameStateCompressed *data);
    64   void processClassid(classid *clid);
    65   void processChat( chat *data);
    66 };
     55    ClientConnection client_connection;
     56    PacketGenerator pck_gen;
     57    GameStateClient gamestate;
     58    bool isConnected;
     59
     60    // implement data processing functions of PacketDecoder
     61    void processGamestate( GameStateCompressed *data);
     62    void processClassid(classid *clid);
     63    void processChat( chat *data);
     64  };
    6765
    6866
Note: See TracChangeset for help on using the changeset viewer.