From 55f84c7cabca6c5a26100204fcd81b454c737ed1 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Wed, 22 Mar 2023 17:49:04 +0100 Subject: [PATCH] MINOR: hlua/event_hdl: expose proxy_uuid variable in server events Adding proxy_uuid to ServerEvent class. proxy_uuid contains the uuid of the proxy to which the server belongs --- doc/lua-api/index.rst | 4 ++++ src/hlua.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst index f25f9dce1..1bb49978d 100644 --- a/doc/lua-api/index.rst +++ b/doc/lua-api/index.rst @@ -1405,6 +1405,10 @@ ServerEvent class Contains the name of the proxy to which the server belongs +.. js:attribute:: ServerEvent.proxy_uuid + + Contains the uuid of the proxy to which the server belongs + .. js:attribute:: ServerEvent.reference Reference to the live server (A :ref:`server_class`). diff --git a/src/hlua.c b/src/hlua.c index e6856c822..747e6e865 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -9059,6 +9059,10 @@ __LJMP static int hlua_event_hdl_cb_data_push_args(struct hlua_event_sub *hlua_s lua_pushstring(hlua->T, "proxy_name"); lua_pushstring(hlua->T, e_server->safe.proxy_name); lua_settable(hlua->T, -3); + /* Add server proxy uuid */ + lua_pushstring(hlua->T, "proxy_uuid"); + lua_pushinteger(hlua->T, e_server->safe.proxy_uuid); + lua_settable(hlua->T, -3); /* attempt to provide reference server object * (if it wasn't removed yet, SERVER_DEL will never succeed here)