00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef _CONNECTTHREAD_H
00024
#define _CONNECTTHREAD_H
00025
00026
00027
using iotm::IOMessage;
00028
00029
00030
00031
00032
class EventThread;
00033
class Player;
00034
class Map;
00035
00036
00037 typedef std::map<long,Player *>
players_t;
00038 typedef std::map<long,Map *>
maps_t;
00039
00040
00041 class ConnectThread :
public iotm::IOThread
00042 {
00043
public:
00044
ConnectThread();
00045
ConnectThread(
char *host,
int port = DEFAULT_PORT);
00046
~ConnectThread();
00047
void Run();
00048
00049
unsigned long get_ip(
char *);
00050 IOMessage *
GetClass(IO_IDTYPE);
00051
00052
00053
Player *
AddPlayer(
long);
00054
Player *AddPlayer(
long,
const string &);
00055
Player *
GetPlayer(
long);
00056
00057
void SetSelf(
long num,
const string &);
00058
Player *
GetSelf(
void);
00059
00060
Map *
AddMap(
long x,
long y,Event::Map * = NULL);
00061
Map *
GetMap(
long x,
long y);
00062
00063
00064
private:
00065 short m_connected;
00066 char m_host[256];
00067 int m_port;
00068 unsigned long m_ip;
00069 EventThread *
m_pclEventThread;
00070
#pragma warning("this is where we should cache map, players, overlays, etc")
00071 Player *
m_self;
00072 players_t m_players;
00073 maps_t m_maps;
00074 };
00075
00076
#endif // _CONNECTTHREAD_H