Skip to content

Commit

Permalink
Merge pull request #8 from d954mas/patch-1
Browse files Browse the repository at this point in the history
Improve ads error messages
  • Loading branch information
AGulev authored Nov 14, 2023
2 parents a9e4ed9 + 080c911 commit 92df781
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions poki-sdk/src/pokisdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void PokiSdk_InvokeCallback(PokiCallbackType callbackType, int intArg, co
{
if (!dmScript::IsCallbackValid(pokiSdk_Callback))
{
dmLogError("PokiSDK callback is invalid. Use callback function as an argument when show ADS.");
dmLogError("PokiSDK InvokeCallback callback is invalid. Use callback function as an argument when show ADS.");
return;
}

Expand Down Expand Up @@ -126,9 +126,12 @@ static int PokiSdk_CommercialBreak(lua_State* L)
{
int type = lua_type(L, 1);
if (type != LUA_TFUNCTION) {
luaL_error(L, "PokiSDK callback is invalid. Use callback function as an argument when show ADS.");
luaL_error(L, "PokiSDK CommercialBreak callback is invalid. Use callback function as an argument when show ADS.");
return 0;
}
if (pokiSdk_Callback != 0x0) {
dmLogError("PokiSdk_CommercialBreak PokiSDK callback already exist. Rewrite callback");
}
DM_LUA_STACK_CHECK(L, 0);
pokiSdk_Callback = dmScript::CreateCallback(L, 1);
PokiSdkJs_CommercialBreak((CommercialBreakCallback)PokiSdk_CommercialBreakCallback);
Expand All @@ -139,9 +142,12 @@ static int PokiSdk_RewardedBreak(lua_State* L)
{
int type = lua_type(L, 1);
if (type != LUA_TFUNCTION) {
luaL_error(L, "PokiSDK callback is invalid. Use callback function as an argument when show ADS.");
luaL_error(L, "PokiSDK RewardedBreak callback is invalid. Use callback function as an argument when show ADS.");
return 0;
}
if (pokiSdk_Callback != 0x0) {
dmLogError("PokiSdk_RewardedBreak PokiSDK callback already exist. Rewrite callback");
}
DM_LUA_STACK_CHECK(L, 0);
pokiSdk_Callback = dmScript::CreateCallback(L, 1);
PokiSdkJs_RewardedBreak((RewardedBreakCallback)PokiSdk_RewardedBreakCallback);
Expand Down

0 comments on commit 92df781

Please sign in to comment.