mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Code] WebInterfaceList Global to Singleton Cleanup (#4935)
This commit is contained in:
parent
967a13e692
commit
c99bda3f47
@ -36,8 +36,6 @@
|
|||||||
#include "../common/zone_store.h"
|
#include "../common/zone_store.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
extern WebInterfaceList web_interface;
|
|
||||||
|
|
||||||
extern ZSList zoneserver_list;
|
extern ZSList zoneserver_list;
|
||||||
uint32 numplayers = 0; //this really wants to be a member variable of ClientList...
|
uint32 numplayers = 0; //this really wants to be a member variable of ClientList...
|
||||||
|
|
||||||
@ -1613,7 +1611,7 @@ void ClientList::OnTick(EQ::Timer *t)
|
|||||||
Iterator.Advance();
|
Iterator.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
web_interface.SendEvent(out);
|
WebInterfaceList::Instance()->SendEvent(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -100,7 +100,6 @@ uint32 numclients = 0;
|
|||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
const WorldConfig *Config;
|
const WorldConfig *Config;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
WebInterfaceList web_interface;
|
|
||||||
PlayerEventLogs player_event_logs;
|
PlayerEventLogs player_event_logs;
|
||||||
|
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
@ -320,7 +319,7 @@ int main(int argc, char **argv)
|
|||||||
connection->GetUUID()
|
connection->GetUUID()
|
||||||
);
|
);
|
||||||
|
|
||||||
web_interface.AddConnection(connection);
|
WebInterfaceList::Instance()->AddConnection(connection);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -331,7 +330,7 @@ int main(int argc, char **argv)
|
|||||||
connection->GetUUID()
|
connection->GetUUID()
|
||||||
);
|
);
|
||||||
|
|
||||||
web_interface.RemoveConnection(connection);
|
WebInterfaceList::Instance()->RemoveConnection(connection);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,11 @@ public:
|
|||||||
void SendError(const std::string &uuid, const std::string &message);
|
void SendError(const std::string &uuid, const std::string &message);
|
||||||
void SendError(const std::string &uuid, const std::string &message, const std::string &id);
|
void SendError(const std::string &uuid, const std::string &message, const std::string &id);
|
||||||
|
|
||||||
|
static WebInterfaceList* Instance()
|
||||||
|
{
|
||||||
|
static WebInterfaceList instance;
|
||||||
|
return &instance;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
std::map<std::string, std::unique_ptr<WebInterface>> m_interfaces;
|
std::map<std::string, std::unique_ptr<WebInterface>> m_interfaces;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -42,7 +42,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/repositories/buyer_repository.h"
|
#include "../common/repositories/buyer_repository.h"
|
||||||
|
|
||||||
extern uint32 numzones;
|
extern uint32 numzones;
|
||||||
extern WebInterfaceList web_interface;
|
|
||||||
extern ClientList client_list;
|
extern ClientList client_list;
|
||||||
volatile bool UCSServerAvailable_ = false;
|
volatile bool UCSServerAvailable_ = false;
|
||||||
void CatchSignal(int sig_num);
|
void CatchSignal(int sig_num);
|
||||||
@ -889,7 +888,7 @@ void ZSList::OnTick(EQ::Timer *t)
|
|||||||
out["data"].append(outzone);
|
out["data"].append(outzone);
|
||||||
}
|
}
|
||||||
|
|
||||||
web_interface.SendEvent(out);
|
WebInterfaceList::Instance()->SendEvent(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::list<std::unique_ptr<ZoneServer>> &ZSList::getZoneServerList() const
|
const std::list<std::unique_ptr<ZoneServer>> &ZSList::getZoneServerList() const
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user