[Quest API] Add GetIPExemption(), GetIPString(), and SetIPExemption(exemption_amount) to Perl/Lua.

- Add $client->GetIPExemption() to Perl.
- Add $client->GetIPString() to Perl.
- Add $client->SetIPExemption(exemption_amount) to Perl.
- Add client:GetIPExemption() to Lua.
- Add client:GetIPString() to Lua.
- Add client:SetIPExemption(exemption_amount) to Lua.

Will make plugin::IP unnecessary and allow people to get readable IP string easier, as well as set/get IP exemptions from Perl and Lua.
This commit is contained in:
Kinglykrab
2021-10-02 13:39:32 -04:00
committed by GitHub
parent 93acf50bb4
commit b3e9e2099a
7 changed files with 124 additions and 1 deletions
+18
View File
@@ -2229,6 +2229,21 @@ void Lua_Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client) {
self->UntrainDiscBySpellID(spell_id, update_client);
}
int Lua_Client::GetIPExemption() {
Lua_Safe_Call_Int();
return self->GetIPExemption();
}
std::string Lua_Client::GetIPString() {
Lua_Safe_Call_String();
return self->GetIPString();
}
void Lua_Client::SetIPExemption(int exemption_amount) {
Lua_Safe_Call_Void();
self->SetIPExemption(exemption_amount);
}
void Lua_Client::ReadBookByName(std::string book_name, uint8 book_type) {
Lua_Safe_Call_Void();
self->ReadBookByName(book_name, book_type);
@@ -2632,6 +2647,9 @@ luabind::scope lua_register_client() {
.def("CountItem", (int(Lua_Client::*)(uint32))&Lua_Client::CountItem)
.def("RemoveItem", (void(Lua_Client::*)(uint32))&Lua_Client::RemoveItem)
.def("RemoveItem", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::RemoveItem)
.def("GetIPExemption", (int(Lua_Client::*)(void))&Lua_Client::GetIPExemption)
.def("GetIPString", (std::string(Lua_Client::*)(void))&Lua_Client::GetIPString)
.def("SetIPExemption", (void(Lua_Client::*)(int))&Lua_Client::SetIPExemption)
.def("ReadBookByName", (void(Lua_Client::*)(std::string,uint8))&Lua_Client::ReadBookByName)
.def("SetGMStatus", (void(Lua_Client::*)(int32))&Lua_Client::SetGMStatus)
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16))&Lua_Client::UntrainDiscBySpellID)