示例#1
0
        public static void Ping(string ip, LuaInterface.LuaFunction func, int funcID)
        {
            if (func == null)
            {
                return;
            }

            NetPing ping = GenPing();

            if (ping == null)
            {
                Debug.LogError("ping num is to much");
                return;
            }

            if (Config.Detail_Debug_Log())
            {
                Debug.Log("----------net ping 0->" + ip);
            }
            CoroutineHelper.CreateCoroutineHelper(ping.PingConnect(ip, (state, delay) =>
            {
                ping.index = -1;
                LuaManager.CallFunc_V(func, state, delay, funcID);
            }));
        }
示例#2
0
        public static void Ping(string ip, NetPingCallBack callback)
        {
            if (callback == null)
            {
                return;
            }
            NetPing ping = GenPing();

            if (ping == null)
            {
                Debug.LogError("ping num is to much");
                return;
            }

            CoroutineHelper.CreateCoroutineHelper(ping.PingConnect(ip, (state, delay) =>
            {
                ping.index = -1;
                callback(state, delay);
            }));
        }