diff --git a/_DPS_/_Core/BaseClass/Socket/SocketBase.nut b/_DPS_/_Core/BaseClass/Socket/SocketBase.nut index 8c66ece..e7745d1 100644 --- a/_DPS_/_Core/BaseClass/Socket/SocketBase.nut +++ b/_DPS_/_Core/BaseClass/Socket/SocketBase.nut @@ -27,10 +27,13 @@ if (!getroottable().rawin("OnGatewaySocketConnectFunc")) OnGatewaySocketConnectF //插件网关建立连接时 function OnGatewaySocketConnect() { print("\x1b[96m" + "############双端插件连接建立############" + "\x1b[0m"); - print("\x1b[96m" + "############双端插件连接建立############" + "\x1b[0m"); - print("\x1b[96m" + "############双端插件连接建立############" + "\x1b[0m"); - print("\x1b[96m" + "############双端插件连接建立############" + "\x1b[0m"); - print("\x1b[96m" + "############双端插件连接建立############" + "\x1b[0m"); + + //获得本服务器的IP + GatewaySocketPackFuncMap.rawset(10002, function(Jso) { + getroottable().Dps_Self_Ip <- Jso.myip; + print("\x1b[96m" + "############双端插件初始化成功############" + "\x1b[0m"); + }); + local Jso = { op = 10001, channel = Sq_Game_GetConfig(), diff --git a/_DPS_/_Core/Interface.nut b/_DPS_/_Core/Interface.nut index dba320f..a4acc22 100644 --- a/_DPS_/_Core/Interface.nut +++ b/_DPS_/_Core/Interface.nut @@ -205,3 +205,15 @@ if (getroottable().rawin("DP_S_VERSION") && DP_S_VERSION >= 25.329 && DP_S_VERSI } ); } + +if (!getroottable().rawin("Dps_Self_Ip")) Dps_Self_Ip <- ""; + Haker.LoadHook("0x081E8C78", ["pointer", "pointer", "pointer", "int"], + function(args) { + local SUser = User(args[1]); + local SNU = Memory.allocUtf8String(getroottable().Dps_Self_Ip); + SUser.SendBlob(SNU); + return null; + }, + function(args) { + return null; + }); \ No newline at end of file diff --git a/_DPS_/_Core/ServerControl/ServerControl.nut b/_DPS_/_Core/ServerControl/ServerControl.nut index e616a20..3d11d55 100644 --- a/_DPS_/_Core/ServerControl/ServerControl.nut +++ b/_DPS_/_Core/ServerControl/ServerControl.nut @@ -4,8 +4,6 @@ 创建日期:2024-05-01 16:24 文件用途:服务端核心类 */ -if (!getroottable().rawin("Dps_Self_Ip")) Dps_Self_Ip <- ""; - function removeBackslashes(str) { local result = ""; local index = 0; @@ -93,23 +91,6 @@ class ServerControl { }.bindenv(this)); - //获得本服务器的IP - GatewaySocketPackFuncMap.rawset(10002, function(Jso) { - getroottable().Dps_Self_Ip <- Jso.myip; - - Haker.LoadHook("0x081E8C78", ["pointer", "pointer", "pointer", "int"], - function(args) { - local SUser = User(args[1]); - local SNU = Memory.allocUtf8String(Dps_Self_Ip); - SUser.SendBlob(SNU); - return null; - }, - function(args) { - return null; - }); - }.bindenv(this)); - - //给查询指定uid cid列表的玩家信息 GatewaySocketPackFuncMap.rawset(2023101902, function(Jso) { local UserList = [];