#include "logging.h" #include "gamelist.h" #define DEFAULT_TIMEOUT 180 GameList::GameList(Config& conf) : lastUpdate(0) { int interval = conf.getInteger("global", "game_timeout", DEFAULT_TIMEOUT); TimerService::registerTimer(new Timer(new CleanupEvent(*this), interval)); } GameList::~GameList() { } void GameList::cleanup() { } long GameList::getLastUpdate() { lastUpdate++; return lastUpdate; } Iterator* GameList::createIterator() { return glist.createIterator(); } void GameList::addGame(int gameid, NetPkt* pkt) { char buf[64]; pkt->show(buf, sizeof(buf)); LogSystem::log(LOG_NOTICE, "Adding Game %d: %s", gameid, buf); glist.add(new GameEntry()); }