Пример #1
0
 public override void Initialize(params object[] args)
 {
     m_NetworkComponent = GameEntry.GetComponent <NetworkComponent>();
     if (m_NetworkComponent == null)
     {
         Log.Fatal("Network component is invalid.");
         return;
     }
 }
 static int GetAllNetworkChannels(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityGameFramework.Runtime.NetworkComponent obj = (UnityGameFramework.Runtime.NetworkComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.NetworkComponent));
         GameFramework.Network.INetworkChannel[]     o   = obj.GetAllNetworkChannels();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int DestroyNetworkChannel(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityGameFramework.Runtime.NetworkComponent obj = (UnityGameFramework.Runtime.NetworkComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.NetworkComponent));
         string arg0 = ToLua.CheckString(L, 2);
         bool   o    = obj.DestroyNetworkChannel(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int CreateNetworkChannel(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityGameFramework.Runtime.NetworkComponent obj = (UnityGameFramework.Runtime.NetworkComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.NetworkComponent));
         string arg0 = ToLua.CheckString(L, 2);
         GameFramework.Network.INetworkChannelHelper arg1 = (GameFramework.Network.INetworkChannelHelper)ToLua.CheckObject(L, 3, typeof(GameFramework.Network.INetworkChannelHelper));
         GameFramework.Network.INetworkChannel       o    = obj.CreateNetworkChannel(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_NetworkChannelCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityGameFramework.Runtime.NetworkComponent obj = (UnityGameFramework.Runtime.NetworkComponent)o;
            int ret = obj.NetworkChannelCount;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index NetworkChannelCount on a nil value" : e.Message));
        }
    }
 static int GetIPType(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UnityGameFramework.Runtime.NetworkComponent obj = (UnityGameFramework.Runtime.NetworkComponent)ToLua.CheckObject(L, 1, typeof(UnityGameFramework.Runtime.NetworkComponent));
         string arg0 = ToLua.CheckString(L, 2);
         string arg1 = ToLua.CheckString(L, 3);
         string arg2 = null;
         System.Net.Sockets.AddressFamily arg3;
         obj.GetIPType(arg0, arg1, out arg2, out arg3);
         LuaDLL.lua_pushstring(L, arg2);
         ToLua.Push(L, arg3);
         return(2);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }