private static int GetSessionId(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 2); PlatformUtil platformUtil = (PlatformUtil)ToLua.CheckObject(L, 1, typeof(PlatformUtil)); bool reGenerate = LuaDLL.luaL_checkboolean(L, 2); string sessionId = platformUtil.GetSessionId(reGenerate); LuaDLL.lua_pushstring(L, sessionId); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }