Resource icon

Steam Authentication & Integration 1.0.7

No permission to download
If you are upgrading from version 1.0.4 to version 1.0.7 in the error log are seen
PHP:
ErrorException: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 2: parser error : XML declaration allowed only at the start of the document - library/Steam/Helper/Steam.php:38
PHP:
simplexml_load_file(http://steamcommunity.com/profiles/76561198047744096/games/?xml=1) [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Unavailable - library/Steam/Helper/Steam.php:49
The option was binding account is as follows
1.webp
 
I tried to login via steam addon and I get "Error during authentication. Please try again." I looked through my logs but nothing.
 
Got this error when tried to install the xml.

Server Error

Mysqli prepare error: Unknown column 'game_hours_recent' in 'field list'
  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  5. Zend_Db_Adapter_Abstract->insert() in Steam/Cron.php at line 38
  6. Steam_Cron::update() in Steam/Manufacture.php at line 95
  7. Steam_Manufacture->_installVersion4() in Steam/Manufacture.php at line 59
  8. Steam_Manufacture::build() in XenForo/Model/AddOn.php at line 214
  9. XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
  10. XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 178
  11. XenForo_ControllerAdmin_AddOn->actionInstall() in XenForo/FrontController.php at line 310
  12. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  13. XenForo_FrontController->run() in /home/pfps/public_html/comunidade/admin.php at line 13
Anyone know how can solve it?
 
Ya I get an Unknown Steam Account as well, which I find it strange, unless Valve did some modifications of it's own in the past couple of days haha.
 
Ya I get an Unknown Steam Account as well, which I find it strange, unless Valve did some modifications of it's own in the past couple of days haha.
I've checked and found that I've got Unknown Steam Account too, login and message user info part work fine ...
 
"If you are talking about the Steam Community xml feeds, then yes, they are now rate limited. From what I read, Valve plans on deprecating these feeds and the new rate limit is there to reduce the load on Steam Community.

Unfortunately not all the community xml feeds have a matching WebAPI, so moving from community XMLs to webAPIs isn't always possible... but I guess they'll add the missing WebAPIs eventually. In the meantime, caching the information you need in these feeds is the way to go."

http://forums.steampowered.com/forums/showthread.php?t=2670201

Sounds like the change was Valve adding a rate limit for xml requests. It also sounds like they want to completely drop support for the xml community data (the way this add-on grabs its information it looks like). Eventually this add-on will need to be coded to allow the use of the SteamWebAPI and access xml data that way. Although, I'm just speculating at this point now, I haven't had a chance to dig through his code and see what's going on.

It looks like this rate limit change may be affecting other websites as well, such as profile badge websites.

http://steamprofile.com/newest/

Once again, just taking a shot in the dark, but it seems this is what may be causing the issue.

EDIT:

PHP:
    public function getUserInfo($steam_id) {
        // cURL
        curl_setopt($this->ch, CURLOPT_URL, "http://steamcommunity.com/profiles/{$steam_id}/?xml=1");
        $result = curl_exec($this->ch);
        $xml = simplexml_load_string($result);
 
        if(!empty($xml)) {
            return array(
                'username' => $xml->steamID,
                'avatar' => $xml->avatarFull,
                'icon' => $xml->avatarIcon,
                'state' => $xml->onlineState
 
            );
        } else {
            return array(
                'username' => "Unknown Steam Account",
                'avatar' => "Ruh Roh!"
            );
        }
    }

It's returning unknown steam account because the xml data it's getting is empty. I'm going to try to change it over to the API key for my website and have somebody test it for me. I'll report back later today.

EDIT 2:

Still not working as intended. Going to have to look at this later when I have more free time. There's something else causing a problem, I don't necessarily think it's an xml limit issue in all cases.
 
I found a solution to fix simplexml_load_string, this post is more relevant now.

Okay, so after a little breather I came back and started to compare what changed from 1.0.4 to 1.0.7. I'm taking this one problem at a time, so the first thing I decided to tackle was the Unknown Steam Account issue in the Steam Integration section. It seems like my second guess was right, it looks like it doesn't have to deal with rate limiting, but something with the code.

For some reason, when using cURL, it's not liking what it's pulling out. I have a sneaking suspicion it has to deal with what @AndyK reported in his error logs

So I decided to try favoring 1.0.4's version way of loading xml data

Boom, steam account names suddenly start working again and I'm not longer getting Unknown Steam Account in Steam Integration (Steam Profile badges still aren't, but baby steps). Now the only problem with this is that I don't know how important the new method of pulling XML data is over the old one. I'm not a php guru, and without any comments on the code, I can't tell if this causes any adverse effects. As far as I can tell, the getUserInfo function only deals with the account page. But obviously, the best bet would be to get the function working as intended using simplexml_load_string instead of simplexml_load_file.

I'm not seeing any errors from it yet, but I haven't had time to really test it to know if what I changed is completely stable.

I'm also going to try this with the way it pulls steam game information to see if those errors go away in the error log. That will take a little time to see.
 
Okay another update.

I decided to use the bleeding edge version of steamprofile out on github and reconfigure the xml distributed with this addon to include the new javascript path. Great news so far: all steam badges are functional! No more HTTP 302 errors.

(Example working thread that used to have errors: http://ragecagegaming.com/threads/guild-wars-2-thread.290/)

Now I'm willing to roll this out as a file to you guys, but I want to make sure everything is clean before I do that. I would like you guys to sign up on my website through steam and give this a rigorous testing. I want to make sure we're not generating any weird errors with these changes.

http://ragecagegaming.com

Side note: With the new code, apparently the profile badges load as you view the page. So you get that loading bar in the top right corner until all the profiles are scrolled past. Or something to that effect. (Then again, could just be building the cache)

EDIT 2:

I went back and fixed cURL. It's using simplexml_load_string and working. This should increase performance in loading the xml data.

EDIT 3:
Working out a tiny bug, please refrain from downloading until it's sorted

http://xenforo.com/community/threads/steam-authentication-integration.27790/page-9#post-353451
 
in my forum dont work:

Server Error

simplexml_load_string() [function.simplexml-load-string]: Entity: line 2: parser error : XML declaration allowed only at the start of the document
  1. XenForo_Application::handlePhpError()
  2. simplexml_load_string() in Steam/Helper/Steam.php at line 40
  3. Steam_Helper_Steam->getUserInfo() in Steam/ControllerPublic/Account.php at line 53
  4. Steam_ControllerPublic_Account->actionSteam() in XenForo/FrontController.php at line 310
  5. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  6. XenForo_FrontController->run() in /home/tg/public_html/tgforos/index.php at line 13
iLdytDTh4xhiv.png
 
@fix above,

if the host has php open_basedir protection, this will not work and continue to error 302. I do have root access since my host is me, and I could turn it off on my domain, but other users might not be so luckey.
 
Actually, it looks like it's grabbing the XML, but I just realized, I still had the trim commented out. I'm wondering of the XML has whitespace. Can you try this file for me Binari0?

You'll need to place it in library/Steam/Helper

I'm wondering if I didn't catch this problem because my CDN cached the xml file. In either event, worst case we just go back to loading it as a file instead of a string. Not as efficient, but it's a sure fire thing that'll work.

EDIT:
But yeah, it may be a good idea for total compatibility to allow for simplexml_load_file over the way it was originally set to simplexml_load_string.

EDIT 2:
Working on a fix for database issues... looks like I found a bug in the original code for new installs.
 
I'm also having some problems and this may be from what Bubka3 mentioned with the open_basedir enabled

steam.webp
 
I'm also having some problems and this may be from what Bubka3 mentioned with the open_basedir enabled

View attachment 28909


Yep that's it. Alright, I'm going to revert back to the simplexml_load_file logic. Hang in there Once I get Binari0's database bug hammered out (which will help people like @Gabriel Pinho) I'll release the addon again.

It won't require a reinstall for you @Qwk86gn, just a file replacement. :)

EDIT: To shed some light on what I'm working on, it looks like the original code had a cron job that filled information. It must have been edited between 1.0.4 and 1.0.7 to include a new column that was introduced in 1.0.7. The problem is, the cron runs before that column is added, causing an error.

EDIT 2:
Tried and tested a open_basedir compatibility fix. Here's the file. All you need to change @Qwk86gn is upload the following file (and overwrite):

upload/library/Steam/Helper/Steam.php
to
/library/Steam/Helper/Steam.php

EDIT 3:
Files here
http://xenforo.com/community/threads/steam-authentication-integration.27790/page-9#post-353451
 
Top Bottom