mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
[Server] Add postInit method and move getPluginListSample in to it
This commit is contained in:
parent
8422ae0ce8
commit
f2b8a939ef
3 changed files with 9 additions and 3 deletions
|
@ -202,8 +202,6 @@ void Networking::update(RakNet::Packet *packet)
|
|||
packetPreInit.setChecksums(&plugins);
|
||||
packetPreInit.Read();
|
||||
|
||||
static auto samples = getPluginListSample();
|
||||
|
||||
auto plugin = plugins.begin();
|
||||
if (samples.size() == plugins.size())
|
||||
{
|
||||
|
@ -501,3 +499,9 @@ void Networking::InitQuery(std::string queryAddr, unsigned short queryPort)
|
|||
{
|
||||
mclient = new MasterClient(peer, queryAddr, queryPort);
|
||||
}
|
||||
|
||||
void Networking::postInit()
|
||||
{
|
||||
Script::Call<Script::CallbackIdentity("OnServerPostInit")>();
|
||||
samples = getPluginListSample();
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace mwmp
|
|||
static const Networking &get();
|
||||
static Networking *getPtr();
|
||||
|
||||
void postInit();
|
||||
private:
|
||||
PacketPreInit::PluginContainer getPluginListSample();
|
||||
std::string serverPassword;
|
||||
|
@ -75,6 +76,7 @@ namespace mwmp
|
|||
|
||||
bool running;
|
||||
int exitCode;
|
||||
PacketPreInit::PluginContainer samples;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
|||
networking.getMasterClient()->Start();
|
||||
}
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnServerPostInit")>();
|
||||
networking.postInit();
|
||||
|
||||
int code = networking.mainLoop();
|
||||
|
||||
|
|
Loading…
Reference in a new issue