else --如果在常规地图内掉线或者登出
suss_Message = "您的连线已经恢复,";
end
suss_Message = suss_Message.."原地登录次数剩余:"..tbl_dropinfo[_playerkey].leftCount.."次。";
if(In_situ_login_on_off == "on" and suss_link == true ) then
--NLG.SystemMessage(player,Drop_list.MapType.." "..Drop_list.MapId.." "..Drop_list.X.." "..Drop_list.Y.." "..Drop_list.DengonName);
Char.Warp(player,Drop_list.MapType,Drop_list.MapId,Drop_list.X,Drop_list.Y);
NLG.SystemMessage(player,suss_Message);
end
--NLG.SystemMessage(player,Drop_list.MapType.." "..Drop_list.MapId.." "..Drop_list.X.." "..Drop_list.Y.." "..Drop_list.DengonName);
end
function MyLogin_OutEvent(player)
local Playerinfo = new_tbl_dropinfoobject(player);
if(Playerinfo.MapType == 0) then --如果不在迷宫内,则保存常规地图信息。
Playerinfo.leftCount = tonumber(tbl_dropinfo[Playerkey(player)].leftCount); --保存当前原地登录次数
--print("key is "..Playerkey(player));
--print("value is "..tbl_dropinfo[Playerkey(player)].leftCount);
tbl_dropinfo[Playerkey(player)] = Playerinfo;
return;
end
function MyLogin_WarpEvent(player)
--[[
local dropinfo = new_tbl_dropinfoobject(player);
if(dropinfo.MapType == 0) then
dropinfo.leftCount = tonumber(tbl_dropinfo[Playerkey(player)].leftCount);
tbl_dropinfo[Playerkey(player)] = dropinfo;
end--]]
local partyNum = Char.PartyNum(player); --保存所有队员进入迷宫前的位置信息
for i=0,partyNum do
local this_player = Char.GetPartyMember(player,i);
if(VaildChar(this_player))then
local dropinfo = new_tbl_dropinfoobject(this_player);
if(dropinfo.MapType == 0) then
tbl_dropinfo[Playerkey(this_player)] = dropinfo;
--NLG.SystemMessage(this_player,dropinfo.X);
end
end
end
end
function inityddlNpc_Init(index)
print("原地登录npc_index = " .. index);
return 1;
end
function inityddlNpc()
if (yddlnpc == nil) then
yddlnpc = NL.CreateNpc("lua/Module/myLogin.lua", "inityddlNpc_Init");
Char.SetData(yddlnpc,%对象_形象%,NPCPoint[1]);
Char.SetData(yddlnpc,%对象_原形%,NPCPoint[1]);
Char.SetData(yddlnpc,%对象_X%,NPCPoint[3]);
Char.SetData(yddlnpc,%对象_Y%,NPCPoint[4]);
Char.SetData(yddlnpc,%对象_地图%,NPCPoint[2]);
Char.SetData(yddlnpc,%对象_方向%,NPCPoint[5]);
Char.SetData(yddlnpc,%对象_原名%,NPCName);
NLG.UpChar(yddlnpc);
--这里是与Npc说话的时候,调用ChangePassMsg函数
Char.SetTalkedEvent("lua/Module/myLogin.lua","yddlnpcMsg", yddlnpc);
end
end
function yddlnpcMsg(_me,_tome)
if (NLG.CanTalk(_me,_tome) == true) then
str_ChangeWindow = "\\n\\n 勇者,您的原地登出次数已重置为"..tbl_In_situsetting.defcount.."次!\\n\\n 登出超过30分钟将返回记录点。";
tbl_dropinfo[Playerkey(_tome)].leftCount = tbl_In_situsetting.defcount;
NLG.ShowWindowTalked(_tome,_me,%窗口_信息框%,%按钮_关闭%,1,str_ChangeWindow);
return;
end
end
function inityddltable_cleanNpc_Init(index)
print("原地登录内存回收员npc_index = " .. index);
return 1;
end
function inittable_cleanNpc()
if (table_cleanNpc == nil) then
table_cleanNpc = NL.CreateNpc("lua/Module/myLogin.lua", "inityddltable_cleanNpc_Init");
Char.SetData(table_cleanNpc,%对象_形象%,231088);
Char.SetData(table_cleanNpc,%对象_原形%,231088);
Char.SetData(table_cleanNpc,%对象_X%,47);
Char.SetData(table_cleanNpc,%对象_Y%,47);
Char.SetData(table_cleanNpc,%对象_地图%,777);
Char.SetData(table_cleanNpc,%对象_方向%,4);
Char.SetData(table_cleanNpc,%对象_原名%,"内存回收员");
NLG.UpChar(table_cleanNpc);
--这里是与Npc说话的时候,调用ChangePassMsg函数
Char.SetLoopEvent("lua/Module/myLogin.lua","table_cleanNpcLoopEvent", table_cleanNpc,1800); --30分钟执行一次table清理。
end
end
function table_cleanNpcLoopEvent(index)
--原地登录table清理相关
--解释:如果超时,那么直接清理掉相关此玩家drop信息。
for i,v in pairs(tbl_dropinfo) do
if(os.time() - v.time > tbl_In_situsetting.timeout )then
tbl_dropinfo[i] = nil;