This commit is contained in:
lenheart
2025-03-27 20:21:11 +08:00
parent 9d84fe256d
commit 4d65103501
33 changed files with 2712 additions and 2069 deletions

View File

@@ -49,6 +49,7 @@ class Luke {
function base_input_hook(CUser, CmdString) {
if (!CUser) return true;
local SUser = User(CUser);
print(111);
//卢克频道
if (Sq_Game_GetConfig().find("19") != null) {
local Localtion = SUser.GetLocation();
@@ -69,6 +70,29 @@ class Luke {
}
}
function base_input_hook2(args) {
local type = args[2];
local SUser = User(args[1]);
local msg = args[3];
if ((type == 8 || type == 3) && Sq_Game_GetConfig().find("19") != null) {
local Localtion = SUser.GetLocation();
if (Localtion.Area <= 1) {
return true;
} else {
local Jso = {
op = 20084027,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
msg = msg
}
Socket.SendGateway(Jso);
}
}
return;
}
//玩家消息分发
function PlayerNotiMsgDistribute(Jso) {
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
@@ -82,7 +106,7 @@ class Luke {
local SUserName = SUser.GetCharacName();
local Type = Jso.type;
Jso.msg = Jso.msg.slice(0, Jso.msg.len() - 11);
Jso.msg = Jso.msg;
if (Type == -1) {
Jso.Name <- SUserName;
foreach(_Index, Value in RealList) {
@@ -183,13 +207,15 @@ class Luke {
//玩家上线
function Login_Hook(SUser) {
//玩家上线发信息包
local evv = {
op = 20084502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
Timer.SetTimeOut(function(SUser) {
//玩家上线发信息包
local evv = {
op = 20084502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
}.bindenv(this), 5, SUser);
local T = {
op = 20084063,
@@ -211,8 +237,9 @@ class Luke {
//注册HOOK
Cb_Insert_User_Func.Luke <- insert_user_hook.bindenv(this); //区域添加角色
Cb_Move_Area_Func.Luke <- move_area_hook.bindenv(this); //区域移动
Base_InputHookFunc_Handle.Luke <- base_input_hook.bindenv(this); //玩家发送消息
//Base_InputHookFunc_Handle.Luke <- base_input_hook.bindenv(this); //玩家发送消息
Cb_reach_game_world_Func.Luke <- Login_Hook.bindenv(this); //上线HOOK
Cb_Server_Chat_Log_Leave_Func.Luke <- base_input_hook2.bindenv(this); //玩家发送消息
//注册收包
GatewaySocketPackFuncMap.rawset(20084010, LukeSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包