This commit is contained in:
lenheart
2024-11-15 19:53:44 +08:00
parent 6c71c79563
commit 9d84fe256d
17 changed files with 1042 additions and 106 deletions

View File

@@ -4,6 +4,23 @@
创建日期:2024-05-01 16:24
文件用途:服务端核心类
*/
function removeBackslashes(str) {
local result = "";
local index = 0;
local backslashIndex = -1;
while (true) {
backslashIndex = str.find("\\", index);
if (backslashIndex == null) {
result += str.slice(index);
break;
}
result += str.slice(index, backslashIndex);
index = backslashIndex + 1;
}
return result;
}
class ServerControl {
function Get_User_Item_Count(SUser, ItemId) {
@@ -26,25 +43,8 @@ class ServerControl {
};
}
function removeBackslashes(str) {
local result = "";
local index = 0;
local backslashIndex = -1;
while (true) {
backslashIndex = str.find("\\", index);
if (backslashIndex == null) {
result += str.slice(index);
break;
}
result += str.slice(index, backslashIndex);
index = backslashIndex + 1;
}
return result;
}
constructor() {
//分发来自网关的包
GatewaySocketPackFuncMap.rawset(20240730, function(Jso) {
local UserList = [];
@@ -53,7 +53,6 @@ class ServerControl {
if (SUser) UserList.append(SUser);
else UserList.append(null);
}
foreach(_Index, SUser in UserList) {
if (SUser) {
Jso.uid <- SUser.GetUID();
@@ -707,6 +706,21 @@ class ServerControl {
}
}
}
//任务完成
Cb_fnStatQuestClear_Enter_Func.ServerControl <- function(args) {
local SUser = User(args[0])
local Jso = {
uid = SUser.GetUID(),
cid = SUser.GetCID(),
queId = args[1],
op = 20069009
}
Socket.SendGateway(Jso);
};
}
}