/// <summary> /// 客户端创建sn /// </summary> /// <returns></returns> private string CreateSnByNow() { long microsecond = TimeConverter.ConvertDateTimeLong(DateTime.Now) / 10; string ret = String.Format("{0}{1}{2}", microsecond, UnityEngine.Random.Range(0, 10), UnityEngine.Random.Range(0, 10)); return(ret); }
static int ConvertDateTimeLong(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); System.DateTime arg0 = StackTraits <System.DateTime> .Check(L, 1); long o = TimeConverter.ConvertDateTimeLong(arg0); LuaDLL.tolua_pushint64(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private static int ConvertDateTimeLong(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 1); DateTime time = (DateTime)ToLua.CheckObject(L, 1, typeof(DateTime)); long n = TimeConverter.ConvertDateTimeLong(time); LuaDLL.tolua_pushint64(L, n); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }