180 lines
5.7 KiB
C#
180 lines
5.7 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 comadjustsdkAdjustPlayStoreSubscriptionWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(com.adjust.sdk.AdjustPlayStoreSubscription);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 3, 0, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "setPurchaseTime", _m_setPurchaseTime);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "addCallbackParameter", _m_addCallbackParameter);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "addPartnerParameter", _m_addPartnerParameter);
|
|
|
|
|
|
|
|
|
|
|
|
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) == 7 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 5) || LuaAPI.lua_type(L, 5) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 6) || LuaAPI.lua_type(L, 6) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 7) || LuaAPI.lua_type(L, 7) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _price = LuaAPI.lua_tostring(L, 2);
|
|
string _currency = LuaAPI.lua_tostring(L, 3);
|
|
string _sku = LuaAPI.lua_tostring(L, 4);
|
|
string _orderId = LuaAPI.lua_tostring(L, 5);
|
|
string _signature = LuaAPI.lua_tostring(L, 6);
|
|
string _purchaseToken = LuaAPI.lua_tostring(L, 7);
|
|
|
|
var gen_ret = new com.adjust.sdk.AdjustPlayStoreSubscription(_price, _currency, _sku, _orderId, _signature, _purchaseToken);
|
|
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 com.adjust.sdk.AdjustPlayStoreSubscription constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_setPurchaseTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
com.adjust.sdk.AdjustPlayStoreSubscription gen_to_be_invoked = (com.adjust.sdk.AdjustPlayStoreSubscription)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _purchaseTime = LuaAPI.lua_tostring(L, 2);
|
|
|
|
gen_to_be_invoked.setPurchaseTime( _purchaseTime );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_addCallbackParameter(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
com.adjust.sdk.AdjustPlayStoreSubscription gen_to_be_invoked = (com.adjust.sdk.AdjustPlayStoreSubscription)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _key = LuaAPI.lua_tostring(L, 2);
|
|
string _value = LuaAPI.lua_tostring(L, 3);
|
|
|
|
gen_to_be_invoked.addCallbackParameter( _key, _value );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_addPartnerParameter(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
com.adjust.sdk.AdjustPlayStoreSubscription gen_to_be_invoked = (com.adjust.sdk.AdjustPlayStoreSubscription)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _key = LuaAPI.lua_tostring(L, 2);
|
|
string _value = LuaAPI.lua_tostring(L, 3);
|
|
|
|
gen_to_be_invoked.addPartnerParameter( _key, _value );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|