1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-28 15:09:40 +00:00

[Server] Add OnServerScriptCrash script event

This commit is contained in:
David Cernat 2019-03-10 00:46:40 +02:00
parent a508a0faf8
commit 552a94a0ca
3 changed files with 3 additions and 0 deletions

View file

@ -105,6 +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")>();
if (!mwmp::Networking::getPtr()->getScriptErrorIgnoringState()) if (!mwmp::Networking::getPtr()->getScriptErrorIgnoringState())
throw; throw;

View file

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

View file

@ -307,6 +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")>();
throw; //fall through throw; //fall through
} }