hlswmaster-ng/gamescanner.h

46 lines
788 B
C
Raw Normal View History

2006-02-02 16:55:44 +01:00
#ifndef _GAMESCANNER_H_
#define _GAMESCANNER_H_
#include "thread.h"
#include "config.h"
#include "modulelist.h"
#include "timerservice.h"
2006-02-19 18:45:56 +01:00
#include "multisock.h"
#include "semaphore.h"
#include "list.h"
#include "netpkt.h"
2006-02-02 16:55:44 +01:00
2006-02-19 18:45:56 +01:00
class GameScanner : public Thread {
2006-02-02 16:55:44 +01:00
public:
GameScanner(Config& conf, ModuleList& modList);
2006-02-02 16:55:44 +01:00
~GameScanner();
2006-03-05 02:28:19 +01:00
2006-02-02 16:55:44 +01:00
int execute(void* arg);
2006-02-19 18:45:56 +01:00
void scan();
2006-02-02 16:55:44 +01:00
NetPkt* getPkt();
2006-02-02 16:55:44 +01:00
protected:
GameScanner(const GameScanner& hs);
GameScanner& operator=(const GameScanner& hs);
private:
2006-02-20 21:58:59 +01:00
class ScanEvent : public Event {
2006-02-02 16:55:44 +01:00
public:
2006-02-20 21:58:59 +01:00
ScanEvent(GameScanner& gs) : gs(gs) {}
2006-02-02 16:55:44 +01:00
~ScanEvent() {}
2006-02-20 21:58:59 +01:00
void execute() { gs.scan(); }
2006-03-05 02:28:19 +01:00
2006-02-02 16:55:44 +01:00
private:
2006-02-20 21:58:59 +01:00
GameScanner& gs;
2006-03-05 02:28:19 +01:00
};
2006-02-02 16:55:44 +01:00
ModuleList& modList;
MultiSock* msock;
Semaphore pktCount;
LockedList<NetPkt> pktList;
2006-02-02 16:55:44 +01:00
};
#endif // _SCANNER_H_