diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 0330b7c80..fcfff6844 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,12 +303,13 @@ 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; } @@ -325,8 +326,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) { @@ -344,7 +345,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; @@ -355,7 +356,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; } @@ -740,7 +741,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 14872b866..cd49185cf 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 b6e5b1a21..90e4c06aa 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 82d915f3a..eec896f6e 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 c047f14a8..3ae58e9ab 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 cc5ecc6ed..7a3b5eaea 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 10a09839d..a85ea2a47 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 cc19402de..04e7d4046 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 8ada2a438..19db059e0 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 01707ee8d..f80d72532 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 5f8dd7a19..396970ad1 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 56062b75f..890bae9ad 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 6afe75e56..771fbd3a3 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 bd81a8e3e..674f1e054 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,40 +48,41 @@ 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}, - {"sendMessage", ScriptFunctions::sendMessage}, - {"kick", ScriptFunctions::kick}, - {"getServerVersion", ScriptFunctions::getServerVersion}, - {"getProtocolVersion", ScriptFunctions::getProtocolVersion}, - {"getAvgPing", ScriptFunctions::getAvgPing}, +// {"Cast", ScriptFunctions::Cast}, + {"SendMessage", ScriptFunctions::SendMessage}, + {"Kick", ScriptFunctions::Kick}, + {"GetServerVersion", ScriptFunctions::GetServerVersion}, + {"GetProtocolVersion", ScriptFunctions::GetProtocolVersion}, + {"GetAvgPing", ScriptFunctions::GetAvgPing}, TRANSLOCATIONFUNCTIONS, STATSFUNCTIONS, @@ -95,21 +96,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()} }; };