295 lines
10 KiB
C#
295 lines
10 KiB
C#
#if USE_UNI_LUA
|
|
using LuaAPI = UniLua.Lua;
|
|
using RealStatePtr = UniLua.ILuaState;
|
|
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
|
#else
|
|
using LuaAPI = XLua.LuaDLL.Lua;
|
|
using RealStatePtr = System.IntPtr;
|
|
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
|
#endif
|
|
|
|
using XLua;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace XLua.CSObjectWrap
|
|
{
|
|
using Utils = XLua.Utils;
|
|
public class IronSourceAdInfoWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(IronSourceAdInfo);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 1, 12, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToString", _m_ToString);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "auctionId", _g_get_auctionId);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "adUnit", _g_get_adUnit);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "country", _g_get_country);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "ab", _g_get_ab);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "segmentName", _g_get_segmentName);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "adNetwork", _g_get_adNetwork);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "instanceName", _g_get_instanceName);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "instanceId", _g_get_instanceId);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "revenue", _g_get_revenue);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "precision", _g_get_precision);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "lifetimeRevenue", _g_get_lifetimeRevenue);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "encryptedCPM", _g_get_encryptedCPM);
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
if(LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _json = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = new IronSourceAdInfo(_json);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to IronSourceAdInfo constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ToString(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.ToString( );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_auctionId(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.auctionId);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_adUnit(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.adUnit);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_country(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.country);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_ab(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.ab);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_segmentName(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.segmentName);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_adNetwork(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.adNetwork);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_instanceName(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.instanceName);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_instanceId(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.instanceId);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_revenue(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
translator.PushAny(L, gen_to_be_invoked.revenue);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_precision(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.precision);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_lifetimeRevenue(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
translator.PushAny(L, gen_to_be_invoked.lifetimeRevenue);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_encryptedCPM(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
IronSourceAdInfo gen_to_be_invoked = (IronSourceAdInfo)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.encryptedCPM);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|