Skip to content

Commit

Permalink
Merge pull request #362 from Jan200101/PR/api-key-check
Browse files Browse the repository at this point in the history
check if newgroups api key actually exists before creating core
  • Loading branch information
ninjamuffin99 authored Feb 11, 2021
2 parents a4b79ab + a0cc962 commit 7958699
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions source/NGio.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,22 @@ class NGio
trace('INIT NOLOGIN');
GAME_VER = "v" + Application.current.meta.get('version');

NG.create(api);

new FlxTimer().start(2, function(tmr:FlxTimer)
if (api.length != 0)
{
var call = NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response:Response<GetCurrentVersionResult>)
NG.create(api);

new FlxTimer().start(2, function(tmr:FlxTimer)
{
GAME_VER = response.result.data.current_version;
trace('CURRENT NG VERSION: ' + GAME_VER);
gotOnlineVer = true;
});
var call = NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response:Response<GetCurrentVersionResult>)
{
GAME_VER = response.result.data.current_version;
trace('CURRENT NG VERSION: ' + GAME_VER);
gotOnlineVer = true;
});

call.send();
});
call.send();
});
}
}

public function new(api:String, encKey:String, ?sessionId:String)
Expand Down

0 comments on commit 7958699

Please sign in to comment.