Inheritance: UnityEngine.MonoBehaviour, IDisposable
Example #1
0
 static public int Send(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(Hugula.Net.Msg)))
         {
             Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
             Hugula.Net.Msg  a1;
             checkType(l, 2, out a1);
             self.Send(a1);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(System.Byte[])))
         {
             Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
             System.Byte[]   a1;
             checkArray(l, 2, out a1);
             self.Send(a1);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #2
0
 static public int Receive(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         self.Receive();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #3
0
 static public int get_onConnectionTimeoutFn(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.onConnectionTimeoutFn);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #4
0
 static public int get_Port(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.Port);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #5
0
 static public int get_timeoutMiliSecond(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.timeoutMiliSecond);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #6
0
        public static LNet New()
        {
            if (lNetObj == null)
            {
                lNetObj = new GameObject("LNet");
            }
            var cnet = lNetObj.AddComponent <LNet>();

            if (_main == null)
            {
                _main = cnet;
            }
            return(cnet);
        }
Example #7
0
 static public int set_onIntervalFn(IntPtr l)
 {
     try {
         Hugula.Net.LNet  self = (Hugula.Net.LNet)checkSelf(l);
         SLua.LuaFunction v;
         checkType(l, 2, out v);
         self.onIntervalFn = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #8
0
 static public int set_timeoutMiliSecond(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         System.Int32    v;
         checkType(l, 2, out v);
         self.timeoutMiliSecond = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #9
0
 static public int set_pingDelay(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         System.Single   v;
         checkType(l, 2, out v);
         self.pingDelay = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #10
0
 static public int SendErro(IntPtr l)
 {
     try {
         Hugula.Net.LNet self = (Hugula.Net.LNet)checkSelf(l);
         System.String   a1;
         checkType(l, 2, out a1);
         System.String a2;
         checkType(l, 3, out a2);
         self.SendErro(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #11
0
 public static LNet New()
 {
     if (lNetObj == null) lNetObj = new GameObject("LNet");
     var cnet = lNetObj.AddComponent<LNet>();
     if (_main == null) _main = cnet;
     return cnet;
 }