diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 6cc6367ad..97cfa23ce 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -36,12 +36,12 @@ Networking::Networking(RakNet::RakPeerInterface *peer) running = true; exitCode = 0; - Script::Call(); + Script::Call(); } Networking::~Networking() { - Script::Call(false); + Script::Call(false); sThis = 0; delete playerController; @@ -86,7 +86,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) { LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", player->getId()); - //KickPlayer(player->guid); + //kickPlayer(player->guid); return; } @@ -94,7 +94,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) { player->setLoadState(Player::LOADED); - static constexpr unsigned int ident = Script::CallbackIdentity("OnPlayerConnect"); + static constexpr unsigned int ident = Script::CallbackIdentity("onPlayerConnect"); Script::CallBackReturn result = true; Script::Call(result, Players::getPlayer(packet->guid)->getId()); @@ -160,7 +160,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) player->GetCell()->getDescription().c_str()); myPacket->Send(player, true); //send to other clients - Script::Call(player->getId()); + Script::Call(player->getId()); } else { @@ -178,7 +178,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) myPacket->Read(player); myPacket->Send(player, true); - Script::Call(player->getId()); + Script::Call(player->getId()); } break; @@ -191,7 +191,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) myPacket->Read(player); myPacket->Send(player, true); - Script::Call(player->getId()); + Script::Call(player->getId()); } break; @@ -204,7 +204,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) myPacket->Read(player); myPacket->Send(player, true); - Script::Call(player->getId()); + Script::Call(player->getId()); } break; @@ -216,7 +216,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) myPacket->Read(player); myPacket->Send(player, true); - Script::Call(player->getId()); + Script::Call(player->getId()); break; } @@ -226,7 +226,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) DEBUG_PRINTF("ID_GAME_INVENTORY\n"); myPacket->Read(player); - Script::Call(player->getId()); + Script::Call(player->getId()); break; } @@ -295,7 +295,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) player->CreatureStats()->mDead = true; myPacket->Send(player, true); - Script::Call(player->getId(), reason, killer->getId()); + Script::Call(player->getId(), reason, killer->getId()); break; } @@ -303,13 +303,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) case ID_GAME_RESURRECT: { DEBUG_PRINTF("ID_GAME_RESURRECT\n"); - //packetResurrect.Read(player); player->CreatureStats()->mDead = false; myPacket->Send(player, true); playerController->GetPacket(ID_GAME_POS)->RequestData(player->guid); playerController->GetPacket(ID_GAME_CELL)->RequestData(player->guid); - Script::Call(player->getId()); + Script::Call(player->getId()); break; } @@ -326,8 +325,8 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) { DEBUG_PRINTF("ID_CHAT_MESSAGE\n"); myPacket->Read(player); - Script::CallBackReturn result = true; - Script::Call(result, player->getId(), player->ChatMessage()->c_str()); + Script::CallBackReturn result = true; + Script::Call(result, player->getId(), player->ChatMessage()->c_str()); if (result) { @@ -345,7 +344,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) if (player->CharGenStage()->current == player->CharGenStage()->end && player->CharGenStage()->current != 0) { - Script::Call(player->getId()); + Script::Call(player->getId()); cout << "RACE: " << player->Npc()->mRace << endl; } break; @@ -356,7 +355,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) DEBUG_PRINTF("ID_GUI_MESSAGEBOX\n"); myPacket->Read(player); - Script::Call(player->getId(), (int)player->guiMessageBox.id, + Script::Call(player->getId(), (int)player->guiMessageBox.id, player->guiMessageBox.data.c_str()); break; } @@ -741,7 +740,7 @@ void Networking::disconnectPlayer(RakNet::RakNetGUID guid) Player *player = Players::getPlayer(guid); if (!player) return; - Script::Call(player->getId()); + Script::Call(player->getId()); playerController->GetPacket(ID_USER_DISCONNECTED)->Send(player, true); Players::deletePlayer(guid); } diff --git a/apps/openmw-mp/Script/API/PublicFnAPI.hpp b/apps/openmw-mp/Script/API/PublicFnAPI.hpp index cd49185cf..14872b866 100644 --- a/apps/openmw-mp/Script/API/PublicFnAPI.hpp +++ b/apps/openmw-mp/Script/API/PublicFnAPI.hpp @@ -26,7 +26,7 @@ private: public: template - static void MakePublic(Args &&... args) + static void makePublic(Args &&... args) { new Public(std::forward(args)...); } static boost::any Call(const std::string &name, const std::vector &args); diff --git a/apps/openmw-mp/Script/API/TimerAPI.cpp b/apps/openmw-mp/Script/API/TimerAPI.cpp index 90e4c06aa..b6e5b1a21 100644 --- a/apps/openmw-mp/Script/API/TimerAPI.cpp +++ b/apps/openmw-mp/Script/API/TimerAPI.cpp @@ -78,7 +78,7 @@ int TimerAPI::pointer = 0; std::unordered_map TimerAPI::timers; #if defined(ENABLE_PAWN) -int TimerAPI::CreateTimerPAWN(AMX *amx, ScriptFuncPAWN callback, long msec, const string& def, std::vector args) +int TimerAPI::createTimerPAWN(AMX *amx, ScriptFuncPAWN callback, long msec, const string& def, std::vector args) { int id = -1; @@ -102,7 +102,7 @@ int TimerAPI::CreateTimerPAWN(AMX *amx, ScriptFuncPAWN callback, long msec, cons #endif #if defined(ENABLE_LUA) -int TimerAPI::CreateTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, const std::string& def, std::vector args) +int TimerAPI::createTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, const std::string& def, std::vector args) { int id = -1; @@ -126,7 +126,7 @@ int TimerAPI::CreateTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, #endif -int TimerAPI::CreateTimer(ScriptFunc callback, long msec, const std::string &def, std::vector args) +int TimerAPI::createTimer(ScriptFunc callback, long msec, const std::string &def, std::vector args) { int id = -1; @@ -148,7 +148,7 @@ int TimerAPI::CreateTimer(ScriptFunc callback, long msec, const std::string &def return id; } -void TimerAPI::FreeTimer(int timerid) +void TimerAPI::freeTimer(int timerid) { try @@ -165,7 +165,7 @@ void TimerAPI::FreeTimer(int timerid) } } -void TimerAPI::ResetTimer(int timerid, long msec) +void TimerAPI::resetTimer(int timerid, long msec) { try { @@ -177,7 +177,7 @@ void TimerAPI::ResetTimer(int timerid, long msec) } } -void TimerAPI::StartTimer(int timerid) +void TimerAPI::startTimer(int timerid) { try { @@ -192,7 +192,7 @@ void TimerAPI::StartTimer(int timerid) } } -void TimerAPI::StopTimer(int timerid) +void TimerAPI::stopTimer(int timerid) { try { @@ -204,7 +204,7 @@ void TimerAPI::StopTimer(int timerid) } } -bool TimerAPI::IsEndTimer(int timerid) +bool TimerAPI::isEndTimer(int timerid) { bool ret = false; try diff --git a/apps/openmw-mp/Script/API/TimerAPI.hpp b/apps/openmw-mp/Script/API/TimerAPI.hpp index eec896f6e..82d915f3a 100644 --- a/apps/openmw-mp/Script/API/TimerAPI.hpp +++ b/apps/openmw-mp/Script/API/TimerAPI.hpp @@ -46,17 +46,17 @@ namespace mwmp { public: #if defined(ENABLE_PAWN) - static int CreateTimerPAWN(AMX *amx, ScriptFuncPAWN callback, long msec, const std::string& def, std::vector args); + static int createTimerPAWN(AMX *amx, ScriptFuncPAWN callback, long msec, const std::string& def, std::vector args); #endif #if defined(ENABLE_LUA) - static int CreateTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, const std::string& def, std::vector args); + static int createTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, const std::string& def, std::vector args); #endif - static int CreateTimer(ScriptFunc callback, long msec, const std::string& def, std::vector args); - static void FreeTimer(int timerid); - static void ResetTimer(int timerid, long msec); - static void StartTimer(int timerid); - static void StopTimer(int timerid); - static bool IsEndTimer(int timerid); + static int createTimer(ScriptFunc callback, long msec, const std::string& def, std::vector args); + static void freeTimer(int timerid); + static void resetTimer(int timerid, long msec); + static void startTimer(int timerid); + static void stopTimer(int timerid); + static bool isEndTimer(int timerid); static void Terminate(); diff --git a/apps/openmw-mp/Script/Functions/Chat.cpp b/apps/openmw-mp/Script/Functions/Chat.cpp index 3ae58e9ab..c047f14a8 100644 --- a/apps/openmw-mp/Script/Functions/Chat.cpp +++ b/apps/openmw-mp/Script/Functions/Chat.cpp @@ -6,7 +6,7 @@ #include #include -void ScriptFunctions::SendMessage(unsigned short pid, const char *message, bool broadcast) noexcept +void ScriptFunctions::sendMessage(unsigned short pid, const char *message, bool broadcast) noexcept { Player *player; GET_PLAYER(pid, player,); @@ -20,12 +20,12 @@ void ScriptFunctions::SendMessage(unsigned short pid, const char *message, bool mwmp::Networking::get().getPlayerController()->GetPacket(ID_CHAT_MESSAGE)->Send(player, true); } -void ScriptFunctions::CleanChat(unsigned short pid) +void ScriptFunctions::cleanChat(unsigned short pid) { } -void ScriptFunctions::CleanChat() +void ScriptFunctions::cleanChat() { } diff --git a/apps/openmw-mp/Script/Functions/Timer.cpp b/apps/openmw-mp/Script/Functions/Timer.cpp index 7a3b5eaea..cc5ecc6ed 100644 --- a/apps/openmw-mp/Script/Functions/Timer.cpp +++ b/apps/openmw-mp/Script/Functions/Timer.cpp @@ -11,39 +11,39 @@ using namespace std; using namespace mwmp; -int ScriptFunctions::CreateTimer(ScriptFunc callback, int msec) noexcept +int ScriptFunctions::createTimer(ScriptFunc callback, int msec) noexcept { return -1; } -int ScriptFunctions::CreateTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept +int ScriptFunctions::createTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept { return -1; } -void ScriptFunctions::StartTimer(int timerId) noexcept +void ScriptFunctions::startTimer(int timerId) noexcept { - TimerAPI::StartTimer(timerId); + TimerAPI::startTimer(timerId); } -void ScriptFunctions::StopTimer(int timerId) noexcept +void ScriptFunctions::stopTimer(int timerId) noexcept { - TimerAPI::StopTimer(timerId); + TimerAPI::stopTimer(timerId); } -void ScriptFunctions::RestartTimer(int timerId, int msec) noexcept +void ScriptFunctions::restartTimer(int timerId, int msec) noexcept { - TimerAPI::ResetTimer(timerId, msec); + TimerAPI::resetTimer(timerId, msec); } -void ScriptFunctions::FreeTimer(int timerId) noexcept +void ScriptFunctions::freeTimer(int timerId) noexcept { - TimerAPI::FreeTimer(timerId); + TimerAPI::freeTimer(timerId); } -bool ScriptFunctions::IsTimerElapsed(int timerId) noexcept +bool ScriptFunctions::isTimerElapsed(int timerId) noexcept { - return TimerAPI::IsEndTimer(timerId); + return TimerAPI::isEndTimer(timerId); } diff --git a/apps/openmw-mp/Script/LangLua/LangLua.cpp b/apps/openmw-mp/Script/LangLua/LangLua.cpp index a85ea2a47..10a09839d 100644 --- a/apps/openmw-mp/Script/LangLua/LangLua.cpp +++ b/apps/openmw-mp/Script/LangLua/LangLua.cpp @@ -73,10 +73,10 @@ struct F_ }; -template<> struct F_<0> { static constexpr LuaFuctionData F{"CreateTimer", LangLua::CreateTimer}; }; -template<> struct F_<1> { static constexpr LuaFuctionData F{"CreateTimerEx", LangLua::CreateTimerEx}; }; -template<> struct F_<2> { static constexpr LuaFuctionData F{"MakePublic", LangLua::MakePublic}; }; -template<> struct F_<3> { static constexpr LuaFuctionData F{"CallPublic", LangLua::CallPublic}; }; +template<> struct F_<0> { static constexpr LuaFuctionData F{"createTimer", LangLua::createTimer}; }; +template<> struct F_<1> { static constexpr LuaFuctionData F{"createTimerEx", LangLua::createTimerEx}; }; +template<> struct F_<2> { static constexpr LuaFuctionData F{"makePublic", LangLua::makePublic}; }; +template<> struct F_<3> { static constexpr LuaFuctionData F{"callPublic", LangLua::callPublic}; }; template inline LuaFuctionData *LangLua::functions(indices) @@ -135,7 +135,7 @@ boost::any LangLua::Call(const char *name, const char *argl, int buf, ...) va_start(vargs, buf); std::vector args; - ScriptFunctions::GetArguments(args, vargs, argl); + ScriptFunctions::getArguments(args, vargs, argl); return Call(name, argl, args); } diff --git a/apps/openmw-mp/Script/LangLua/LangLua.hpp b/apps/openmw-mp/Script/LangLua/LangLua.hpp index 04e7d4046..cc19402de 100644 --- a/apps/openmw-mp/Script/LangLua/LangLua.hpp +++ b/apps/openmw-mp/Script/LangLua/LangLua.hpp @@ -39,11 +39,11 @@ public: LangLua(); LangLua(lua_State *lua); ~LangLua(); - static int MakePublic(lua_State *lua) noexcept; - static int CallPublic(lua_State *lua); + static int makePublic(lua_State *lua) noexcept; + static int callPublic(lua_State *lua); - static int CreateTimer(lua_State *lua) noexcept; - static int CreateTimerEx(lua_State *lua); + static int createTimer(lua_State *lua) noexcept; + static int createTimerEx(lua_State *lua); virtual void LoadProgram(const char *filename) override; virtual int FreeProgram() override; diff --git a/apps/openmw-mp/Script/LangLua/LuaFunc.cpp b/apps/openmw-mp/Script/LangLua/LuaFunc.cpp index 19db059e0..8ada2a438 100644 --- a/apps/openmw-mp/Script/LangLua/LuaFunc.cpp +++ b/apps/openmw-mp/Script/LangLua/LuaFunc.cpp @@ -64,19 +64,19 @@ inline vector DefToVec(lua_State *lua, string types, int args_begin, return args; } -int LangLua::MakePublic(lua_State *lua) noexcept +int LangLua::makePublic(lua_State *lua) noexcept { const char * callback = luabridge::Stack::get(lua, 1); const char * name = luabridge::Stack::get(lua, 2); char ret_type = luabridge::Stack::get(lua, 3); const char * def = luabridge::Stack::get(lua, 4); - Public::MakePublic(callback, lua, name, ret_type, def); + Public::makePublic(callback, lua, name, ret_type, def); return 0; } -int LangLua::CallPublic(lua_State *lua) +int LangLua::callPublic(lua_State *lua) { const char * name = luabridge::Stack::get(lua, 1); @@ -104,18 +104,18 @@ int LangLua::CallPublic(lua_State *lua) return 1; } -int LangLua::CreateTimer(lua_State *lua) noexcept +int LangLua::createTimer(lua_State *lua) noexcept { const char * callback= luabridge::Stack::get(lua, 1); int msec = luabridge::Stack::get(lua, 2); - int id = mwmp::TimerAPI::CreateTimerLua(lua, callback, msec, "", vector()); + int id = mwmp::TimerAPI::createTimerLua(lua, callback, msec, "", vector()); luabridge::push(lua, id); return 1; } -int LangLua::CreateTimerEx(lua_State *lua) +int LangLua::createTimerEx(lua_State *lua) { const char * callback = luabridge::Stack::get(lua, 1); int msec = luabridge::Stack::get(lua, 2); @@ -176,7 +176,7 @@ int LangLua::CreateTimerEx(lua_State *lua) } - int id = mwmp::TimerAPI::CreateTimerLua(lua, callback, msec, types, args); + int id = mwmp::TimerAPI::createTimerLua(lua, callback, msec, types, args); luabridge::push(lua, id); return 1; } \ No newline at end of file diff --git a/apps/openmw-mp/Script/LangPawn/LangPAWN.cpp b/apps/openmw-mp/Script/LangPawn/LangPAWN.cpp index f80d72532..01707ee8d 100644 --- a/apps/openmw-mp/Script/LangPawn/LangPAWN.cpp +++ b/apps/openmw-mp/Script/LangPawn/LangPAWN.cpp @@ -172,10 +172,10 @@ static typename enable_if struct F_ { static constexpr AMX_NATIVE_INFO F{ScriptFunctions::functions[I].name, wrapper}; }; -template<> struct F_<0> { static constexpr AMX_NATIVE_INFO F{"CreateTimer", LangPAWN::CreateTimer}; }; -template<> struct F_<1> { static constexpr AMX_NATIVE_INFO F{"CreateTimerEx", LangPAWN::CreateTimerEx}; }; -template<> struct F_<2> { static constexpr AMX_NATIVE_INFO F{"MakePublic", LangPAWN::MakePublic}; }; -template<> struct F_<3> { static constexpr AMX_NATIVE_INFO F{"CallPublic", LangPAWN::CallPublic}; }; +template<> struct F_<0> { static constexpr AMX_NATIVE_INFO F{"createTimer", LangPAWN::createTimer}; }; +template<> struct F_<1> { static constexpr AMX_NATIVE_INFO F{"createTimerEx", LangPAWN::createTimerEx}; }; +template<> struct F_<2> { static constexpr AMX_NATIVE_INFO F{"makePublic", LangPAWN::makePublic}; }; +template<> struct F_<3> { static constexpr AMX_NATIVE_INFO F{"callPublic", LangPAWN::callPublic}; }; void LangPAWN::LoadProgram(const char *filename) { diff --git a/apps/openmw-mp/Script/LangPawn/LangPAWN.hpp b/apps/openmw-mp/Script/LangPawn/LangPAWN.hpp index 396970ad1..5f8dd7a19 100644 --- a/apps/openmw-mp/Script/LangPawn/LangPAWN.hpp +++ b/apps/openmw-mp/Script/LangPawn/LangPAWN.hpp @@ -30,10 +30,10 @@ public: LangPAWN(); LangPAWN(AMX *amx); ~LangPAWN(); - static cell MakePublic(AMX *amx, const cell *params) noexcept; - static cell CallPublic(AMX *amx, const cell *params) noexcept; - static cell CreateTimer(AMX *amx, const cell *params) noexcept; - static cell CreateTimerEx(AMX *amx, const cell *params) noexcept; + static cell makePublic(AMX *amx, const cell *params) noexcept; + static cell callPublic(AMX *amx, const cell *params) noexcept; + static cell createTimer(AMX *amx, const cell *params) noexcept; + static cell createTimerEx(AMX *amx, const cell *params) noexcept; virtual void LoadProgram(const char *filename) override; virtual int FreeProgram() override; diff --git a/apps/openmw-mp/Script/LangPawn/PawnFunc.cpp b/apps/openmw-mp/Script/LangPawn/PawnFunc.cpp index 890bae9ad..56062b75f 100644 --- a/apps/openmw-mp/Script/LangPawn/PawnFunc.cpp +++ b/apps/openmw-mp/Script/LangPawn/PawnFunc.cpp @@ -8,7 +8,7 @@ using namespace std; -cell LangPAWN::MakePublic(AMX *amx, const cell *params) noexcept +cell LangPAWN::makePublic(AMX *amx, const cell *params) noexcept { int len; cell* source; @@ -39,12 +39,12 @@ cell LangPAWN::MakePublic(AMX *amx, const cell *params) noexcept - Public::MakePublic(&real[0], amx, &name[0], ret_type, &def[0]); + Public::makePublic(&real[0], amx, &name[0], ret_type, &def[0]); return 1; } -cell LangPAWN::CallPublic(AMX *amx, const cell *params) noexcept +cell LangPAWN::callPublic(AMX *amx, const cell *params) noexcept { int len; cell* source; @@ -143,12 +143,12 @@ cell LangPAWN::CallPublic(AMX *amx, const cell *params) noexcept return ret; } -cell LangPAWN::CreateTimer(AMX *amx, const cell *params) noexcept +cell LangPAWN::createTimer(AMX *amx, const cell *params) noexcept { } -cell LangPAWN::CreateTimerEx(AMX *amx, const cell *params) noexcept +cell LangPAWN::createTimerEx(AMX *amx, const cell *params) noexcept { } \ No newline at end of file diff --git a/apps/openmw-mp/Script/ScriptFunctions.cpp b/apps/openmw-mp/Script/ScriptFunctions.cpp index 771fbd3a3..6afe75e56 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.cpp +++ b/apps/openmw-mp/Script/ScriptFunctions.cpp @@ -18,7 +18,7 @@ constexpr ScriptCallbackData ScriptFunctions::callbacks[]; using namespace std; -void ScriptFunctions::GetArguments(std::vector ¶ms, va_list args, const std::string &def) +void ScriptFunctions::getArguments(std::vector ¶ms, va_list args, const std::string &def) { params.reserve(def.length()); @@ -84,12 +84,12 @@ void ScriptFunctions::GetArguments(std::vector ¶ms, va_list args va_end(args); } -void ScriptFunctions::MakePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept +void ScriptFunctions::makePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept { - Public::MakePublic(_public, name, ret_type, def); + Public::makePublic(_public, name, ret_type, def); } -boost::any ScriptFunctions::CallPublic(const char *name, ...) noexcept +boost::any ScriptFunctions::callPublic(const char *name, ...) noexcept { vector params; @@ -99,7 +99,7 @@ boost::any ScriptFunctions::CallPublic(const char *name, ...) noexcept va_list args; va_start(args, name); - GetArguments(params, args, def); + getArguments(params, args, def); va_end(args); return Public::Call(name, params); @@ -109,30 +109,30 @@ boost::any ScriptFunctions::CallPublic(const char *name, ...) noexcept return 0; } -void ScriptFunctions::StopServer(int code) noexcept +void ScriptFunctions::stopServer(int code) noexcept { mwmp::Networking::getPtr()->stopServer(code); } -void ScriptFunctions::Kick(unsigned short pid) noexcept +void ScriptFunctions::kick(unsigned short pid) noexcept { Player *player; GET_PLAYER(pid, player,); mwmp::Networking::getPtr()->kickPlayer(player->guid); } -const char *ScriptFunctions::GetServerVersion() noexcept +const char *ScriptFunctions::getServerVersion() noexcept { return TES3MP_VERSION; } -const char *ScriptFunctions::GetProtocolVersion() noexcept +const char *ScriptFunctions::getProtocolVersion() noexcept { static string version = to_string(TES3MP_PROTO_VERSION); return version.c_str(); } -int ScriptFunctions::GetAvgPing(unsigned short pid) noexcept +int ScriptFunctions::getAvgPing(unsigned short pid) noexcept { Player *player; GET_PLAYER(pid, player,-1); diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 674f1e054..bd81a8e3e 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -22,7 +22,7 @@ pl = Players::getPlayer(pid); \ if (player == 0) {\ fprintf(stderr, "%s: Player with pid \'%d\' not found\n", __PRETTY_FUNCTION__, pid);\ - /*ScriptFunctions::StopServer(1);*/ \ + /*ScriptFunctions::stopServer(1);*/ \ return retvalue;\ } @@ -31,16 +31,16 @@ class ScriptFunctions { public: - static void GetArguments(std::vector ¶ms, va_list args, const std::string &def); + static void getArguments(std::vector ¶ms, va_list args, const std::string &def); - static void StopServer(int code) noexcept; + static void stopServer(int code) noexcept; - static void MakePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept; - static boost::any CallPublic(const char *name, ...) noexcept; + static void makePublic(ScriptFunc _public, const char *name, char ret_type, const char *def) noexcept; + static boost::any callPublic(const char *name, ...) noexcept; - static void SendMessage(unsigned short pid, const char *message, bool broadcast) noexcept; - static void CleanChat(unsigned short pid); - static void CleanChat(); + static void sendMessage(unsigned short pid, const char *message, bool broadcast) noexcept; + static void cleanChat(unsigned short pid); + static void cleanChat(); /** * \brief Create timer @@ -48,41 +48,40 @@ public: * \param msec * \return return timer id */ - static int CreateTimer(ScriptFunc callback, int msec) noexcept; - static int CreateTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept; + static int createTimer(ScriptFunc callback, int msec) noexcept; + static int createTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept; - static void StartTimer(int timerId) noexcept; - static void StopTimer(int timerId) noexcept; - static void RestartTimer(int timerId, int msec) noexcept; - static void FreeTimer(int timerId) noexcept; - static bool IsTimerElapsed(int timerId) noexcept; + static void startTimer(int timerId) noexcept; + static void stopTimer(int timerId) noexcept; + static void restartTimer(int timerId, int msec) noexcept; + static void freeTimer(int timerId) noexcept; + static bool isTimerElapsed(int timerId) noexcept; - static void Kick(unsigned short pid) noexcept; - static const char *GetServerVersion() noexcept; - static const char *GetProtocolVersion() noexcept; - static int GetAvgPing(unsigned short pid) noexcept; + static void kick(unsigned short pid) noexcept; + static const char *getServerVersion() noexcept; + static const char *getProtocolVersion() noexcept; + static int getAvgPing(unsigned short pid) noexcept; static constexpr ScriptFunctionData functions[]{ - {"CreateTimer", ScriptFunctions::CreateTimer}, - {"CreateTimerEx", reinterpret_cast>(ScriptFunctions::CreateTimerEx)}, - {"MakePublic", ScriptFunctions::MakePublic}, - {"CallPublic", reinterpret_cast>(ScriptFunctions::CallPublic)}, + {"createTimer", ScriptFunctions::createTimer}, + {"createTimerEx", reinterpret_cast>(ScriptFunctions::createTimerEx)}, + {"makePublic", ScriptFunctions::makePublic}, + {"callPublic", reinterpret_cast>(ScriptFunctions::callPublic)}, - {"StartTimer", ScriptFunctions::StartTimer}, - {"StopTimer", ScriptFunctions::StopTimer}, - {"RestartTimer", ScriptFunctions::RestartTimer}, - {"FreeTimer", ScriptFunctions::FreeTimer}, - {"IsTimerElapsed", ScriptFunctions::IsTimerElapsed}, + {"startTimer", ScriptFunctions::startTimer}, + {"stopTimer", ScriptFunctions::stopTimer}, + {"restartTimer", ScriptFunctions::restartTimer}, + {"freeTimer", ScriptFunctions::freeTimer}, + {"isTimerElapsed", ScriptFunctions::isTimerElapsed}, - {"StopServer", ScriptFunctions::StopServer}, + {"stopServer", ScriptFunctions::stopServer}, -// {"Cast", ScriptFunctions::Cast}, - {"SendMessage", ScriptFunctions::SendMessage}, - {"Kick", ScriptFunctions::Kick}, - {"GetServerVersion", ScriptFunctions::GetServerVersion}, - {"GetProtocolVersion", ScriptFunctions::GetProtocolVersion}, - {"GetAvgPing", ScriptFunctions::GetAvgPing}, + {"sendMessage", ScriptFunctions::sendMessage}, + {"kick", ScriptFunctions::kick}, + {"getServerVersion", ScriptFunctions::getServerVersion}, + {"getProtocolVersion", ScriptFunctions::getProtocolVersion}, + {"getAvgPing", ScriptFunctions::getAvgPing}, TRANSLOCATIONFUNCTIONS, STATSFUNCTIONS, @@ -96,21 +95,21 @@ public: static constexpr ScriptCallbackData callbacks[]{ {"Main", Function()}, - {"OnServerInit", Function()}, - {"OnServerExit", Function()}, - {"OnPlayerConnect", Function()}, - {"OnPlayerDisconnect", Function()}, - {"OnPlayerDeath", Function()}, - {"OnPlayerResurrect", Function()}, - {"OnPlayerChangeCell", Function()}, - {"OnPlayerChangeAttributes", Function()}, - {"OnPlayerChangeSkills", Function()}, - {"OnPlayerChangeLevel", Function()}, - {"OnPlayerChangeEquipment", Function()}, - {"OnPlayerChangeInventory", Function()}, - {"OnPlayerSendMessage", Function()}, - {"OnPlayerEndCharGen", Function()}, - {"OnGUIAction", Function()} + {"onServerInit", Function()}, + {"onServerExit", Function()}, + {"onPlayerConnect", Function()}, + {"onPlayerDisconnect", Function()}, + {"onPlayerDeath", Function()}, + {"onPlayerResurrect", Function()}, + {"onPlayerChangeCell", Function()}, + {"onPlayerChangeAttributes", Function()}, + {"onPlayerChangeSkills", Function()}, + {"onPlayerChangeLevel", Function()}, + {"onPlayerChangeEquipment", Function()}, + {"onPlayerChangeInventory", Function()}, + {"onPlayerSendMessage", Function()}, + {"onPlayerEndCharGen", Function()}, + {"onGuiAction", Function()} }; };