Skyrider
05-30-2015, 07:50 AM
It's the final thing I really need help on, as I can't figure this out on my own (after really days of playing around with the code). I'll make it as simple as possible.
Oke, here we go. This, is login2.php from the steam plugin made by Disasterpiece
http://pastebin.com/nrn1ZxKz
Coding it, so the pastebin won't be listed for guests. (its unlisted, not public).
Now, see line 197, you'll see the following hook:
($hook = vBulletinHook::fetch_hook('stc_linkuser_complete') ) ? eval($hook) : false;
I'm trying the following plugin, hooked to that hook mentioned above:
// One time check for Steam-linked Validation Users //
// vBulletin Group Movement API
$dataman =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$dataman->set_existing($vbulletin->userinfo);
// Steam Level Information API
$steam_id = get_user_steamid($stc_userinfo);
$steam_info = fetch_steam_info($steam_id, $vbulletin->options['stc_apikey']);
if (!empty($vbulletin->userinfo['steam_link']) AND (!empty($steam_info['EconomyBan']) AND $steam_info['EconomyBan'] == banned AND $vbulletin->userinfo['usergroupid'] == 49))
{
$dataman->set('usergroupid', 40);
$dataman->save();
}
The idea is simple. Check $steam_info['EconomyBan'] and see if the user is banned in it. The problem is however, that $steam_info is not yet available for the hook/plugin to use but only a few micro-seconds after the page reloads saying that the steam link has succeeded. Now, according to kh99 he mentioned to use the following values:
$vbulletin->db->escape_string($steam_id).'|0|0'
calc_steam_code($steam_id)
But no matter where I place them, in the plugin, even add ; at the end of each.. I can't get $steam_info to work.
Now, on line 183 and 184, the steam_id is being calculated and after the complete hook saved. So I thought, lets save it sooner by adding:
$userdata_rank->save();
on line 185. But no luck, steam_info is still not available when my plugin on the hook is being executed.
So, I was wondering if someone could help me out with this final thing. I've included as much information as I could. It is possible that the steam_info is being filled after handle user authenticated (line 220), but I'm unsure. Especially because on line 279 it says to be excluded on user linking.
Oke, here we go. This, is login2.php from the steam plugin made by Disasterpiece
http://pastebin.com/nrn1ZxKz
Coding it, so the pastebin won't be listed for guests. (its unlisted, not public).
Now, see line 197, you'll see the following hook:
($hook = vBulletinHook::fetch_hook('stc_linkuser_complete') ) ? eval($hook) : false;
I'm trying the following plugin, hooked to that hook mentioned above:
// One time check for Steam-linked Validation Users //
// vBulletin Group Movement API
$dataman =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$dataman->set_existing($vbulletin->userinfo);
// Steam Level Information API
$steam_id = get_user_steamid($stc_userinfo);
$steam_info = fetch_steam_info($steam_id, $vbulletin->options['stc_apikey']);
if (!empty($vbulletin->userinfo['steam_link']) AND (!empty($steam_info['EconomyBan']) AND $steam_info['EconomyBan'] == banned AND $vbulletin->userinfo['usergroupid'] == 49))
{
$dataman->set('usergroupid', 40);
$dataman->save();
}
The idea is simple. Check $steam_info['EconomyBan'] and see if the user is banned in it. The problem is however, that $steam_info is not yet available for the hook/plugin to use but only a few micro-seconds after the page reloads saying that the steam link has succeeded. Now, according to kh99 he mentioned to use the following values:
$vbulletin->db->escape_string($steam_id).'|0|0'
calc_steam_code($steam_id)
But no matter where I place them, in the plugin, even add ; at the end of each.. I can't get $steam_info to work.
Now, on line 183 and 184, the steam_id is being calculated and after the complete hook saved. So I thought, lets save it sooner by adding:
$userdata_rank->save();
on line 185. But no luck, steam_info is still not available when my plugin on the hook is being executed.
So, I was wondering if someone could help me out with this final thing. I've included as much information as I could. It is possible that the steam_info is being filled after handle user authenticated (line 220), but I'm unsure. Especially because on line 279 it says to be excluded on user linking.