Board logo

标题: [讨论] 做了个收魔币、计时/计步,不遇敌lua内挂。gmsv.exe适用 [打印本页]

作者: ahsin    时间: 2018-3-23 00:28     标题: 做了个收魔币、计时/计步,不遇敌lua内挂。gmsv.exe适用

首先。。。我不是专业lua程序猿,代码都是拼凑和看cgdev的库然后做出来的
2 T5 K4 f: Y# W  Y3 |9 f. M—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート魔力私服,最新魔力宝贝私服技术交流% o& a1 g3 K( D( x1 _2 e& _
代码里有些可能是过度的,高手就不要介意了!
3 h+ I$ n7 J) t* \. s1 f) x" B2 v+ Q" E
* [) s' t4 L) A/ [& k6 K) x6 J—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート总之,用了好多魔力GF内置方法都没能做出一个有效的不遇敌道具。
9 s" S" u3 Q. F7 ^妖城在线论坛
6 p% l8 b1 e# o: V魔力私服,最新魔力宝贝私服技术交流无奈最后只能自己瞎写写了!魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表# Q9 M8 `/ y/ a% a1 f
( C1 K& v6 y, o0 ~& ?; N% M
我VB做得多。。。所以lua让我烦恼了很久,没有timer没有sleep,不过最后还是曲线解决了- -
0 K) E( w4 {& R魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表魔力私服,最新魔力宝贝私服技术交流6 w. C4 w3 \: p, K% C2 L' U
bbs.mocwww.com( O7 }& h0 H, j" T& H
我这里是小公益服,人少,测试一周功能正常。—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート3 v; x9 V( s9 ^0 I2 ^+ S

' r+ z+ H" T6 n妖城在线论坛各位小伙伴可以测试一下
+ C1 I1 V) H2 d( K魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表魔力私服,最新魔力宝贝私服技术交流9 f  }5 U4 ?; y1 P
公布代码如下
复制内容到剪贴板
代码:
--本lua由ahsinsoft.com编写 QQ230236979
if type(Players)~="table" then Players={} end
if type(tab_msg)~="table" then tab_msg={} end
if type(tab_return)~="table" then tab_return={} end
if type(tab_buyudi)~="table" then tab_buyudi={} end
local bydgold= 5555--支付价格
local bydsj= 900--不遇敌有效时间,秒


NL.RegTalkEvent(nil,"ngsupport_TalkEvent");--监视玩家说话内容是否含有关键字
NL.RegLogoutEvent(nil,"ngsupport_LogoutEvent");--监视玩家是否登出,是则清空所有功能参数
--Delegate.
--NL.RegDropEvent(nil,"ngsupport_DropEvent");--监视玩家是否掉线、下线,是则清空所有功能参数

function ngsupport_TalkEvent(player,msg,color,range,size)
       
        if(msg == "/2" or msg == "、2")then
        local CdKey = Char.GetData(player,%对象_账号%);
                if  (Char.GetData(player,%对象_金币%)<bydgold) then
                        NLG.SystemMessage(player, "[系统] 魔币不足["..bydgold.."],无法使用!")
                        return 0
                end
                local kg = Char.GetData(player,%对象_不遇敌开关%);
                if(kg == 0)then
                        Char.AddGold(player,-bydgold);
                        Char.SetData(player,%对象_不遇敌开关%,1);
                        NLG.SystemMessage(player,"不遇敌已经开启,当前时效限定为15分钟!");
                        zoucia = os.time();
                        Char.SetLoopEvent(nil, "bydoff", player, 30000);--伪timer 开启,参数为毫秒
                else
                        Char.SetData(player,%对象_不遇敌开关%,0);
                        zoucia = nil
                        zoucib = nil
                        zoucic = nil
                        Char.SetLoopEvent(nil, "bydoff", player, nil);--伪timer 关闭
                        NLG.SystemMessage(player,"玩家已经主动关闭不遇敌!");
                        return 0
                end
        end
end

function bydoff(player)
--local CdKey = Char.GetData(player,%对象_账号%);
local kgs = Char.GetData(player,%对象_不遇敌开关%);
                zoucib = os.time();
                --zoucic = nil
                if(kgs == 0)then
                        zoucia = nil
                        zoucib = nil
                        zoucic = nil
                        Char.SetLoopEvent(nil, "bydoff", player, nil);--伪timer 关闭
                        return 0
                end
                if(kgs == 1 and zoucib - zoucia > bydsj)then
                        zoucia = nil
                        zoucib = nil
                        zoucic = nil
                        Char.SetLoopEvent(nil, "bydoff", player, nil);--伪timer 关闭
                        Char.SetData(player,%对象_不遇敌开关%,0);
                        NLG.SystemMessage(player,"不遇敌功能有效时间已过,不遇敌关闭!");
                        return 0
                else--if(kgs == 1)then
                        zoucic = zoucib - zoucia
                        zoucid = bydsj - zoucic
                        NLG.SystemMessage(player,"不遇敌功能将在 "..zoucid.." 秒后失效。   -=刷新率:30秒");
                end
end



function ngsupport_LogoutEvent(palyer)
local kgss = Char.GetData(player,%对象_不遇敌开关%);
                if(kgss == 1)then
                        Char.SetData(player,%对象_不遇敌开关%,0);
                        zoucia = nil
                        zoucib = nil
                        zoucic = nil
                        Char.SetLoopEvent(nil, "bydoff", player, nil);--伪timer 关闭
                        NLG.SystemMessage(player,"玩家登出,不遇敌关闭!");
                end
  --return 0;
end
启用方法:
/ x( c4 z9 z7 N& l2 a( R$ k1、把ngsupport.lua放入服务端目录gmsv\lua\Module中
  q' j+ {4 G- G! h1 e; I% K6 S魔力私服,最新魔力宝贝私服技术交流2、服务端目录gmsv\lua中,编辑config.lua,在最后一行新增useModule("ngsupport");妖城在线论坛6 V3 i$ }2 o% V" H: K
3、本内挂热键为/2,若ng.lua中已经有简易版的不遇敌内挂,建议注释掉,以免冲突。高手忽略
8 g5 G4 O; L$ s0 Z5 W: C# i$ Pbbs.mocwww.com
0 F) h% G, N7 C魔力私服,最新魔力宝贝私服技术交流 ngsupport.rar (998 Bytes) 魔力私服,最新魔力宝贝私服技术交流! U# h; t: w' t' G7 G9 k

2 G/ j' J* b% f! O( x" Y[ 本帖最后由 ahsin 于 2018-3-23 00:45 编辑 ]

附件: ngsupport.rar (2018-3-23 00:34, 998 Bytes) / 该附件被下载次数 279
http://bbs.mocwww.com/attachment.php?aid=18600
作者: ahsin    时间: 2018-3-23 00:49

已知bug:
% L# W& P# E& W% N' ^: O—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート1、下线监视代码没完成,但不影响效果。
+ X2 f" k! v- _3 ]2 X9 J: X' g妖城在线论坛2、没找到彻底结束loop的方法,所以30秒监视可能会不准,但对玩家没有影响。假设现在是15分钟有效期,那么玩家可能15分钟后再多30秒后才结束不遇敌。—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート+ p! e3 l- g- e0 U, V7 G* g: j/ a

, J9 {7 t1 ?# w$ Hbbs.mocwww.com求高手协助完善—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート9 G, o  _( x5 a9 |6 i: w2 a
魔力私服,最新魔力宝贝私服技术交流$ F* c& g2 x9 H4 g
0 l# s5 i  z! b
—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート- Z0 B8 h( F  t

+ t* z* [0 `) x! V" v! o—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート魔力私服,最新魔力宝贝私服技术交流+ U( o( ]$ R" A) \! L/ S9 E# L
抱歉。。。计步没备份,被覆盖了哈哈哈魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表" H" P  y& X: e8 B* T
魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表  F! c0 S- z( U2 [* a4 {6 G
有需要找我,必须免费的!原理是相通的,高手自己改。
1 m3 E5 }7 s1 [' s( H魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表妖城在线论坛7 D1 X# O( O) X1 o8 q4 o' d2 a/ @
大致方向为:os.time 替换成 %对象_走次%
: n9 c' [3 M+ Q) ]9 `魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表8 y/ [/ h: [5 f0 F
[ 本帖最后由 ahsin 于 2018-3-23 01:02 编辑 ]
作者: 262070173    时间: 2018-3-26 13:36

不能,顶一下,辛苦了...
作者: ahsin    时间: 2018-3-30 23:13

引用:
原帖由 262070173 于 2018-3-26 13:36 发表 . Z* b& \  ?4 D+ ?
不能,顶一下,辛苦了...
bbs.mocwww.com4 f7 d4 C. ?( B
额?什么不能?
作者: 71336    时间: 2018-4-14 07:55     标题: 顶一下

顶一下。。。辛苦了。。
作者: orochi0531    时间: 2018-4-17 15:33

复制内容到剪贴板
代码:
local limit_time = 10; --两次发喇叭间隔时间,单位秒
--local laba_itemid = 361000; --小喇叭的道具编号
local turn_on_key = "/世界喇叭"; --玩家开启/关闭喇叭开关的命令
--  ***************************************************************************************************** --

tbl_labaPlayer = {};
Delegate.RegDelLoginEvent("labaLoginEvent");
Delegate.RegDelAllOutEvent("labaOutEvent");
--Delegate.RegDelTalkEvent("labaTalkEvent");

--Delegate.RegDelTalkEvent("ng_TalkEvent");

ProtocolDelegate.on(%RECV_TK%,"RECV_TK_Event");--Protocol.OnRecv(nil,"RECV_TK_Event",%RECV_TK%);

function new_labaplayerobject(player)
        local labaplayer =
        {
                index = player;
                isopen = true;
                limit_time = 0;
                VIP = 0;
        };
        return labaplayer;
end

function labaLoginEvent(player)
        tbl_labaPlayer[Playerkey(player)] = new_labaplayerobject(player);

        local playerName = Char.GetData(player,%对象_名字%);
        local playerCDK = Char.GetData(player,%对象_账号%);
        local playerWZ = Char.GetData(player,48);
        local playerLv = Char.GetData(player,%对象_等级%);
        local playerJob = Char.GetData(player,%对象_职业%);
        local ZhanLi = playerLv*10;

        for i=0,7 do
                local _itemindex = Char.GetItemIndex(player,i);
                if(_itemindex>0)then
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_HP%))/10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_MP%))/5);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_攻击%))/2);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_防御%))*0.6);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_敏捷%))*0.6);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_闪躲%))*8);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_命中%))*12);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_必杀%))*12);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_反击%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_精神%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_回复%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_毒抗%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_睡抗%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_石抗%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_醉抗%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_乱抗%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_忘抗%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_属性一值%))*10);
                        ZhanLi = ZhanLi+math.floor(tonumber(Item.GetData(_itemindex,%道具_属性二值%))*10);
                end
        end
        local query = "SELECT Reward,Name,VipLevel FROM tbl_char WHERE CDK='"..playerCDK.."' And Pos='"..playerWZ.."' Limit 1";
        local resset = SQL.Run(query);
        if(type(resset)=="table")then--如果返回结果是table类型的值
                if (resset["0_0"]~="") then
                        NLG.SystemMessage(-1, "欢迎" .. resset["0_0"] ..":".. resset["0_1"] .. "上线了!")
                end
                tbl_labaPlayer[Playerkey(player)].VIP = tonumber(resset["0_2"]);
                local query = "Update tbl_char Set IP = '0',Name = '"..playerName.."',Job="..playerJob..",ZhanLi="..ZhanLi.." WHERE CDK='"..playerCDK.."' And Pos="..playerWZ.."";
                local resset = SQL.Run(query);
        else
                local query = "INSERT INTO tbl_char (CDK,Name,Pos,TitleName,IP) VALUES ('"..playerCDK.."','"..playerName.."',"..playerWZ..",'|','0')";
                local resset = SQL.Run(query);
                tbl_labaPlayer[Playerkey(player)].VIP = 0;
        end
end

function labaOutEvent(player)
        tbl_labaPlayer[Playerkey(player)] = nil;

        local playerCDK = Char.GetData(player,%对象_CDK%);
        local playerWZ = Char.GetData(player,48);
        local query = "Update tbl_char Set IP = '' WHERE CDK='"..playerCDK.."' And Pos="..playerWZ.."";
        local resset = SQL.Run(query);
end

function RECV_TK_Event( _fd, _head, _packet)
                local _player = Protocol.GetCharByFd(_fd);
                local pos1,pos2 = string.find(_packet,"|");
                local _str1 = string.sub(_packet,pos1+1);
               
                if(_player == -1)then
                        return 0;
                end;
                if string.find(_str1,"^/t") then
                        local msg2 = Split(_str1,"t");
                        local msg3 = Split(msg2[2],":");
                        local msg4 = "";
                        if string.find(msg3[1],"S") then
                        else
                                msg4 = string.sub(msg3[1], 1);
                                if CheckNumber(msg4) then
                                        NLG.SystemMessage(_player,"离线挂机开启。");
                                        NLG.SetOfflinePlayer(_player, msg4);
                                else
                                        NLG.SystemMessage(_player,"输入的时间必须为数字!(单位:秒,最小为1秒,最大为10800秒)");
                                end
                        end
                        if string.find(msg3[1],"^S") then
                        else
                                msg4 = string.sub(msg3[1], 3);
                                if CheckNumber(msg4) then
                                        NLG.SystemMessage(_player,"离线挂机开启。");
                                        NLG.SetOfflinePlayer(_player, msg4);
                                else
                                        NLG.SystemMessage(_player,"输入的时间必须为数字!(单位:秒,最小为1秒,最大为10800秒)");
                                end
                        end
                        return 1;
                end
                if string.find(_str1,"^/item") or string.find(_str1,"^/整理") or string.find(_str1,"^/整理包包") then
                        NLG.SystemMessage(_player,"包包已經整理。");
                        NLG.SortItem(_player);
                        return 1;
                end
                if string.find(_str1,"^/1") or string.find(_str1,"^/步步遇敌") then  -- or string.find(_str1,"^"..turn_off_key.."")
                        local getXiangVar1 = Char.GetData(_player,%对象_香步数%);
                        local getXiangVar2 = Char.GetData(_player,%对象_香上限%);
                        if(getXiangVar1 > 0)then
                                Char.SetData(_player,%对象_香步数%,0);
                                Char.SetData(_player,%对象_香上限%,0);
                                NLG.SystemMessage(_player,"步步遇敌已经关闭!");
                        else
                                Char.SetData(_player,%对象_香步数%,999);
                                Char.SetData(_player,%对象_香上限%,999);
                                NLG.SystemMessage(_player,"步步遇敌已经开启!");
                        end
                        return 1;
                end
                if string.find(_str1,"^/2") or string.find(_str1,"^/不遇敌") then
                        local kg = Char.GetData(_player,%对象_不遇敌开关%);
                        if(kg == 0)then
                                Char.SetData(_player,%对象_不遇敌开关%,1);
                                NLG.SystemMessage(_player,"不遇敌已经开启!");
                        else
                                Char.SetData(_player,%对象_不遇敌开关%,0);
                                NLG.SystemMessage(_player,"不遇敌已经关闭!");
                        end
                        return 1;
                end
                if string.find(_str1,"^"..turn_on_key.."") and (tbl_labaPlayer[Playerkey(_player)].isopen == false or tbl_labaPlayer[Playerkey(_player)].isopen == nil) then
                        tbl_labaPlayer[Playerkey(_player)].isopen = true;
                        NLG.SystemMessage(_player,"世界喇叭功能已经开启。");
                        return 1;
                end
                if string.find(_str1,"^"..turn_on_key.."") and tbl_labaPlayer[Playerkey(_player)].isopen == true then
                        tbl_labaPlayer[Playerkey(_player)].isopen = false;
                        NLG.SystemMessage(_player,"世界喇叭功能已经关闭。");
                        return 1;
                end
                if string.find(_str1,"^>") and tbl_labaPlayer[Playerkey(_player)].isopen == true then
                        local myLabaNum = fieldget(_player,"LabaNum");
                        local litime = tbl_labaPlayer[Playerkey(_player)].limit_time;       
                        if (os.time() - litime < limit_time )then
                                NLG.SystemMessage(_player,limit_time.."秒内禁止重复发喇叭。");
                                return 1;
                        end

                        if(myLabaNum > 0)then
                                local msg2 = Split(_str1,":");
                                local msg3 = string.sub(msg2[1],2);
                                NLG.SystemMessage(-1,"[世界喇叭]"..Char.GetData(_player,%对象_名字%)..": "..msg3);
                                fieldadd(_player,"LabaNum",-1);
                                myLabaNum = fieldget(_player,"LabaNum");
                                NLG.SystemMessage(_player,"世界喇叭发送成功!"..Char.GetData(_player,%对象_名字%).."身上还剩"..myLabaNum.."个喇叭。");
                                tbl_labaPlayer[Playerkey(_player)].limit_time = os.time();
                        else
                                NLG.SystemMessage(_player,"对不起您的喇叭不足!请使用喇叭道具进行充值!");
                        end
                        return 1;
                end
                if string.find(_str1,"^>") and (tbl_labaPlayer[Playerkey(_player)].isopen == false or tbl_labaPlayer[Playerkey(_player)].isopen == nil) then
                        NLG.SystemMessage(_player,"对不起您没有开启世界喇叭功能!");
                        return 1;
                end
               
                return 0; -- 通过该封包
end

--[[如果str仅由数字组成,则返回true,否则返回false。]]
function CheckNumber(_data,_max,_min)
        if _max == nil then
                _max = 10800;
        end
        if _min == nil then
                _min = 1;
        end
        if string.find(_data,"^[-]?[1-9]%d*$") then
                if tonumber(_data) > _max then
                        return false;
                elseif tonumber(_data) < _min then
                        return false;
                else
                        return true;
                end
        else
                return false;
        end
end
这样设置的tk的效果是可以不显示/1/2之类的东东的哦。你的不支持功能复用,看我的这个再改改吧。下边是封包的复用。
复制内容到剪贴板
代码:
--[[

将本文件放置于Module目录,并在Config.lua加入如下内容:
                useModule("OnRecv");--封包复用   --注:无需添加文件后缀".lua"并放于最上边
--]]
if (_G.ProtocolDelegate) then
    return _G.ProtocolDelegate;
end

local Module = {}

--注册全局函数
_G.ikki_OnRecv = function(Fd, Head, Packet)
    return Module.emit(Head, Fd, Head, Packet);
end
--注册全局变量
_G.ProtocolDelegate = Module;

--错误处理函数
local hanldeError = _G.hanldeError;
if (hanldeError == nil) then
    hanldeError = function(e)
        print("runtime error: " .. (e or "") .. "\n" .. debug.traceback())
        return e;
    end
end

--注册事件
function Module.on(event, fn)
    print("On package: " .. event, fn);

    if (Module["_" .. event] == nil) then   --第一次注册封包函数
        Module["_" .. event] = {}
        if (Module["_m_" .. event] ~= true) then    --第一次注册Protocol
            Module["_m_" .. event] = true
            Protocol.OnRecv(nil, "ikki_OnRecv", event);
        end
    end
    local m = Module["_" .. event];
    for i, v in ipairs(m) do
        if (v == fn) then
            return
        end
    end

    table.insert(m, fn);
end

--反注册事件
function Module.off(event, fn)
    if (Module["_" .. event] ~= nil) then
        for i, v in ipairs(Module["_" .. event]) do
            if (v == fn) then
                table.remove(Module["_" .. event], i)
                return
            end
        end
    end
end

--反注册所有
function Module.offAll(event)
    Module["_" .. event] = nil;
end

--触发事件
function Module.emit(event, fd, head, data)
    if (event == nil) then
        print("emit package is nil\n" .. debug.traceback())
    end
    --print("emit package: " .. event, fd, head, data);
    local ret = {};
    if (Module["_" .. event]) then
        for i, fn in ipairs(Module["_" .. event]) do  --循环处理
            if (ret[2] == true) then                  --阻止继续调用
                break;
            end
            local r, e = xpcall(function(fn, ret, fd, head, data)   --xpcall 没有fn的return值只好用个ret保存了,顺便加个break变量
                if (type(fn)=="string") then            --兼容字符串
                    fn = _G[fn]
                end
                ret[1] = fn(fd, head, data, ret);                   --调用注册进来的函数
            end, hanldeError, fn, ret, fd, head, data);
            if (r ~= true) then                         --出错啦
                print("Raise " .. event .. " event error: " .. e);
                return
            end
        end
    end
    if (ret[1] ~= nil) then     --null会在出错或者没注册的时候出现所以返回0不过滤封包
        return ret[1];
    end
    return 0;
end

function Module.init()
    --    Test Code
    -- local fn1 = function(...)
        -- --print("recv 1 ", "return " .. 0, ...);
        -- return 0;
    -- end
    -- local fn2 = function(...)
        -- --print("recv 2 ", "return " .. 1, ...);
        -- return 1;
    -- end
    -- local k = 0;
    -- local fn3 = function(...)
        -- k = k + 1;
        -- if (k > 3) then
            -- k = 0;
            -- --print("recv 3 ", "return " .. 0, ...);
            -- return 0;
        -- end
        -- --print("recv 3 ", "return " .. 1, ...);
        -- return 1;
    -- end
    -- Module.on(0, fn1);
    -- Module.on(0, fn2);
    -- Module.on(0, fn3);
end

return Module;





欢迎光临 妖城在线论坛 (http://bbs.mocwww.com/) Powered by Discuz! 6.0.0