111
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
创建日期:2024-05-01 16:24
|
||||
文件用途:服务端核心类
|
||||
*/
|
||||
Dps_Self_Ip <- "192.168.200.110";
|
||||
function removeBackslashes(str) {
|
||||
local result = "";
|
||||
local index = 0;
|
||||
@@ -91,6 +92,12 @@ class ServerControl {
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
//获得本服务器的IP
|
||||
GatewaySocketPackFuncMap.rawset(10002, function(Jso) {
|
||||
print(Jso);
|
||||
Dps_Self_Ip = Jso.myip;
|
||||
}.bindenv(this));
|
||||
|
||||
|
||||
//给查询指定uid cid列表的玩家信息
|
||||
GatewaySocketPackFuncMap.rawset(2023101902, function(Jso) {
|
||||
@@ -359,8 +366,17 @@ class ServerControl {
|
||||
local ItemId = Jso.itemid;
|
||||
local num = 0;
|
||||
if (SUser) {
|
||||
|
||||
|
||||
local InvenObj = SUser.GetInven();
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
if(ItemId == 0){
|
||||
|
||||
num = InvenObj.GetMoney();
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
||||
|
||||
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
|
||||
@@ -375,7 +391,6 @@ class ServerControl {
|
||||
return;
|
||||
}
|
||||
|
||||
print(num);
|
||||
for (local i = 0; i< 120; i++) {
|
||||
local ItemObj = InvenObj.GetSlot(3, i);
|
||||
if (ItemObj != null && ItemObj.GetIndex() == ItemId) {
|
||||
@@ -387,7 +402,7 @@ class ServerControl {
|
||||
num++;
|
||||
}
|
||||
};
|
||||
print(num);
|
||||
}
|
||||
}
|
||||
|
||||
Jso.Count <- num;
|
||||
@@ -741,9 +756,7 @@ class ServerControl {
|
||||
//给注册玩家通关副本
|
||||
GatewaySocketPackFuncMap.rawset(2023110704, function(Jso) {
|
||||
local RealOp = Jso.realop;
|
||||
print("注册副本了");
|
||||
Cb_ClearDungeon_Enter_Func[RealOp] <- function(arg) {
|
||||
print("通关副本了");
|
||||
local PartyObj = Party(arg[0]);
|
||||
if (PartyObj) {
|
||||
local Bfobj = PartyObj.GetBattleField();
|
||||
@@ -839,6 +852,7 @@ class ServerControl {
|
||||
}
|
||||
Socket.SendGateway(T);
|
||||
}
|
||||
|
||||
//玩家上线
|
||||
Cb_reach_game_world_Func["Rindro_player_reach_game_world"] <- function(SUser) {
|
||||
local T = {
|
||||
@@ -1013,7 +1027,6 @@ class ServerControl {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Cb_GetUserInfo_Leave_Func.ServerControl <- function(args) {
|
||||
if (args.pop() >= 0) {
|
||||
local SUser = User(args[1]);
|
||||
|
||||
Reference in New Issue
Block a user