From a503d09d9b37a83affda8b3469b9c6e360d1c783 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 23 Mar 2026 03:07:24 -0700 Subject: [PATCH] feat: add friend/ignore management (AddFriend, RemoveFriend, AddIgnore, DelIgnore) AddFriend(name, note) and RemoveFriend(name) manage the friends list. AddIgnore(name) and DelIgnore(name) manage the ignore list. ShowFriends() is a stub (friends panel is ImGui-rendered). All backed by existing GameHandler methods that send the appropriate CMSG_ADD_FRIEND, CMSG_DEL_FRIEND, CMSG_ADD_IGNORE, CMSG_DEL_IGNORE packets to the server. --- src/addons/lua_engine.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index 1fc189d6..52c9f16a 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -5182,6 +5182,36 @@ void LuaEngine::registerCoreAPI() { if (gh) gh->requestPvpLog(); return 0; }}, + // --- Social (Friend/Ignore) --- + {"AddFriend", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + const char* name = luaL_checkstring(L, 1); + const char* note = luaL_optstring(L, 2, ""); + if (gh) gh->addFriend(name, note); + return 0; + }}, + {"RemoveFriend", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + const char* name = luaL_checkstring(L, 1); + if (gh) gh->removeFriend(name); + return 0; + }}, + {"AddIgnore", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + const char* name = luaL_checkstring(L, 1); + if (gh) gh->addIgnore(name); + return 0; + }}, + {"DelIgnore", [](lua_State* L) -> int { + auto* gh = getGameHandler(L); + const char* name = luaL_checkstring(L, 1); + if (gh) gh->removeIgnore(name); + return 0; + }}, + {"ShowFriends", [](lua_State* L) -> int { + (void)L; // Friends panel is shown via ImGui, not Lua + return 0; + }}, // --- Who --- {"GetNumWhoResults", [](lua_State* L) -> int { auto* gh = getGameHandler(L);