diff options
author | Maya <malte.hoermeyer@web.de> | 2022-11-13 04:01:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 03:01:14 +0000 |
commit | 23fda0b842560d2f3cf64ecf9a57d5ad2861e488 (patch) | |
tree | 9527c91bd744fb0562963e43e212c1bc5536847d /NorthstarDLL/serverchathooks.cpp | |
parent | d237401bb97c1fa2d6ee87220d49e4b3343e7201 (diff) | |
download | NorthstarLauncher-23fda0b842560d2f3cf64ecf9a57d5ad2861e488.tar.gz NorthstarLauncher-23fda0b842560d2f3cf64ecf9a57d5ad2861e488.zip |
Squirrel functions auto bind (#299)
* Add defines to auto add squirrel funcs
it brokey
* Make it Work
changed all squirrel function definitions to this system
* Add defines to auto add squirrel funcs
it brokey
Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com>
* Make it Work
changed all squirrel function definitions to this system
Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com>
* Formatting
* Good old Formatting commit
* HelloGecko
* Formatting Finalv2ForRealThisTime
* idk anymore
* i hate formatting
* Rename some
* Rename macro
* Change function names to more human-readable
* Revert to using old ScriptContext definition
* Formatting
Co-authored-by: RoyalBlue1 <realEmail@veryRealURL.com>
Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com>
Co-authored-by: Emma Miler <emma.pi@protonmail.com>
Co-authored-by: BobTheBob <32057864+BobTheBob9@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/serverchathooks.cpp')
-rw-r--r-- | NorthstarDLL/serverchathooks.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/NorthstarDLL/serverchathooks.cpp b/NorthstarDLL/serverchathooks.cpp index 31844c67..d97f1ebf 100644 --- a/NorthstarDLL/serverchathooks.cpp +++ b/NorthstarDLL/serverchathooks.cpp @@ -115,8 +115,7 @@ void ChatBroadcastMessage(int fromPlayerIndex, int toPlayerIndex, const char* te CRecipientFilter__Destruct(&filter); } -// void function NSSendMessage( int playerIndex, string text, bool isTeam ) -SQRESULT SQ_SendMessage(HSquirrelVM* sqvm) +ADD_SQFUNC("void", NSSendMessage, "int playerIndex, string text, bool isTeam", "", ScriptContext::SERVER) { int playerIndex = g_pSquirrel<ScriptContext::SERVER>->getinteger(sqvm, 1); const char* text = g_pSquirrel<ScriptContext::SERVER>->getstring(sqvm, 2); @@ -127,8 +126,12 @@ SQRESULT SQ_SendMessage(HSquirrelVM* sqvm) return SQRESULT_NULL; } -// void function NSBroadcastMessage( int fromPlayerIndex, int toPlayerIndex, string text, bool isTeam, bool isDead, int messageType ) -SQRESULT SQ_BroadcastMessage(HSquirrelVM* sqvm) +ADD_SQFUNC( + "void", + NSBroadcastMessage, + "int fromPlayerIndex, int toPlayerIndex, string text, bool isTeam, bool isDead, int messageType", + "", + ScriptContext::SERVER) { int fromPlayerIndex = g_pSquirrel<ScriptContext::SERVER>->getinteger(sqvm, 1); int toPlayerIndex = g_pSquirrel<ScriptContext::SERVER>->getinteger(sqvm, 2); @@ -170,14 +173,4 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerChatHooks, ServerSquirrel, (CModule mod MessageWriteByte = module.Offset(0x158A90).As<void(__fastcall*)(int)>(); MessageWriteString = module.Offset(0x158D00).As<void(__fastcall*)(const char*)>(); MessageWriteBool = module.Offset(0x158A00).As<void(__fastcall*)(bool)>(); - - // Chat sending functions - g_pSquirrel<ScriptContext::SERVER>->AddFuncRegistration( - "void", "NSSendMessage", "int playerIndex, string text, bool isTeam", "", SQ_SendMessage); - g_pSquirrel<ScriptContext::SERVER>->AddFuncRegistration( - "void", - "NSBroadcastMessage", - "int fromPlayerIndex, int toPlayerIndex, string text, bool isTeam, bool isDead, int messageType", - "", - SQ_BroadcastMessage); } |