[Server] Add error message as argument to OnServerScriptCrash

pull/512/head
David Cernat 6 years ago
parent 552a94a0ca
commit 986528c67d

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

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

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

Loading…
Cancel
Save