[Server] Add OnServerScriptCrash script event

0.7.0-alpha
David Cernat 6 years ago
parent a508a0faf8
commit 552a94a0ca

@ -105,6 +105,7 @@ public:
catch (std::exception &e)
{
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what());
Script::Call<Script::CallbackIdentity("OnServerScriptCrash")>();
if (!mwmp::Networking::getPtr()->getScriptErrorIgnoringState())
throw;

@ -156,6 +156,7 @@ public:
{"OnServerInit", Callback<>()},
{"OnServerPostInit", Callback<>()},
{"OnServerExit", Callback<bool>()},
{"OnServerScriptCrash", Callback<>()},
{"OnPlayerConnect", Callback<unsigned short>()},
{"OnPlayerDisconnect", Callback<unsigned short>()},
{"OnPlayerDeath", Callback<unsigned short>()},

@ -307,6 +307,7 @@ int main(int argc, char *argv[])
catch (std::exception &e)
{
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what());
Script::Call<Script::CallbackIdentity("OnServerScriptCrash")>();
throw; //fall through
}

Loading…
Cancel
Save