Raised This Month: $106 Target: $400
 26% 

Fix SteamIDs for the new update


Post New Thread Reply   
 
Thread Tools Display Modes
Phaiz
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 09-01-2014 , 12:55   Re: Fix SteamIDs for the new update
Reply With Quote #31

Quote:
Originally Posted by bottiger View Post
I didn't notice it was broken but to fix it just edit playerinfo_general.php and find the Player profile table and replace it with this.

PHP Code:
                                <tr class="data-table-head">
                                        <td style="vertical-align:top;">Player Profile<br /><br /></td>
                                        <td style="text-align:center; vertical-align:middle;" rowspan="7" id="player_avatar">
                                                <?php
                                                        $db
->query
                                                        
("
                                                                SELECT
                                                                        hlstats_PlayerUniqueIds.uniqueId,
                                                                        CONCAT('[U:1:',hlstats_PlayerUniqueIds.uniqueId,']') AS communityId
                                                                FROM
                                                                        hlstats_PlayerUniqueIds
                                                                WHERE
                                                                        hlstats_PlayerUniqueIds.playerId = '
$player'
                                                        "
);
                                                        list(
$uqid$coid) = $db->fetch_row();
                                                        
$pagedata file_get_contents("http://steamcommunity.com/profiles/$coid?xml=1");
                                                        
preg_match('/<onlineState>(.*?)<\/onlineState>/'$pagedata$results);
                                                        
preg_match('/<avatarFull><!\[CDATA\[(.*?)\]\]><\/avatarFull>/'$pagedata$results2);
                                                        
$status ucwords($results[1]);
                                                        
$avatar_full $results2[1];
                                                        
$avimg getImage("/avatars/$player");
                                                        if (
$avimg)
                                                        {
                                                                
$avatar_full $avimg['url'];
                                                        }
                                                        else if (
$avatar_full == '' || $playerdata['blockavatar'] == '1')
                                                        {
                                                                
$avatar_full IMAGE_PATH."/unknown.jpg";
                                                        }
                                                        if (
$status == '')
                                                                
$status '(Unknown)';
                                                        echo(
"<img src=\"$avatar_full\" style=\"height:158px;width:158px;\" alt=\"Steam Community Avatar\" />");
                                                
?>
                                        </td>
                                </tr>
Thanks for that Bot, it fixed it!
Phaiz is offline
Phaiz
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 09-01-2014 , 13:00   Re: Fix SteamIDs for the new update
Reply With Quote #32

Quote:
Originally Posted by Horsedick View Post
Listen...I'll be blunt as well. I said TEAM - I'm unaware or was unaware it was only you working on it. You act as if I'm attacking you or the project and that is far from it. I understand all to well about a full time job coming first but don't sit here and react like this when this wasn't my intentions and I'm sure others didn't intend to come off that either. If you want help from the community then make a sticky post about it rather wait till someone inquires about a issue and you go off on them with whatever reasons you have.

I use this project and enjoy it...but speak up a little...if the support isn't there then that is fine but you gotta let people know so they can make decisions to do something else or wait.
I have to fully agree with this. This is used on a LOT of communities which are mainly manned by someone like myself who has absolutely no idea how it works much less how to fix it. A lot of us are forced to either let it collect dust or trust that the code some stranger just posted won't break our whole server. In my opinion, the best route for hlstats is an official word on what is broken and/or how to fix x y or z. If it's needed I am sure there are those with enough experience who are able to lend a hand when they have the time.
Phaiz is offline
bobdole
SourceMod Donor
Join Date: May 2008
Location: Houston,Texas
Old 09-01-2014 , 14:52   Re: Fix SteamIDs for the new update
Reply With Quote #33

Quote:
Originally Posted by Phaiz View Post
I have to fully agree with this. This is used on a LOT of communities which are mainly manned by someone like myself who has absolutely no idea how it works much less how to fix it. A lot of us are forced to either let it collect dust or trust that the code some stranger just posted won't break our whole server. In my opinion, the best route for hlstats is an official word on what is broken and/or how to fix x y or z. If it's needed I am sure there are those with enough experience who are able to lend a hand when they have the time.
Strangely seeing as this project has its own subfourm its rather easy for users to post the problems they are having (o wait that already happening strange) rather than trying to get someone (who's already time and time again explained how busy he is) try to find each and every little thing that's wrong with a large project like this (which i'll make it easy for you the only main problems are anything related to steamIDs, which as i believe multiple quick patches have already been posted by helpfull people)

If its needed people will lend a hand? well first let me point out that Maverick only took over the project because the original team who worked on it moved on to other things and with life and HE didnt want it to die. As such i guess its something to point out (which should be obvious to anyone with knowledge enough to be able to help knows) the project is hosted on BitBucket meaning anyone who wants to help has complete ability to add to the project by cloning the project and making pull requests with their changes. Something that seeing as noone has done this, it seems that most people who is able to do something mealy doesn't care about this project.
bobdole is offline
bottiger
AlliedModders Donor
Join Date: Dec 2010
Old 09-04-2014 , 02:32   Re: Fix SteamIDs for the new update
Reply With Quote #34

HLstats needs to be rewritten from the ground up. The code is not pretty or efficient, that's why no one is forking it.

I would rewrite it myself but I don't really have the time and I can't justify it given how poorly community servers are being treated by Valve now.

I've already provided the code you need to switch to the new SteamIDs though.
__________________
bottiger is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 09-06-2014 , 00:53   Re: Fix SteamIDs for the new update
Reply With Quote #35

Quote:
Originally Posted by Phaiz View Post
Thanks for that Bot, it fixed it!
Wait, will that make it assume all SteamID's for all game-servers logging to that instance of HLStatsX:CE are using the new Steam3 format? I have several different games (mixture of Source-based and GoldSrc-based at that) all using the same system.
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, YouTube Channel, Stats, Twitter
Weasel is offline
Phaiz
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 09-08-2014 , 12:21   Re: Fix SteamIDs for the new update
Reply With Quote #36

Quote:
Originally Posted by Weasel View Post
Wait, will that make it assume all SteamID's for all game-servers logging to that instance of HLStatsX:CE are using the new Steam3 format? I have several different games (mixture of Source-based and GoldSrc-based at that) all using the same system.
The edit Bot posted was just to fix the missing avatars on profile pages, at least as far as I know.

I do think Bot is right though, some form of a rewrite would be beneficial. Currently, I'll try to explain this in the least confusing way possible, my hlstats is using the old steam ID format but it has given players a NEW steam ID with the old format but it somehow linked the old to the new. Sourcebans for example is still tracking their old steam IDs but the hlstats changes we made are making it work strangely BUT IT DOES WORK, even if it isn't pretty.
Phaiz is offline
Horsedick
AlliedModders Donor
Join Date: Sep 2011
Old 09-12-2014 , 10:32   Re: Fix SteamIDs for the new update
Reply With Quote #37

Ok I used the changes in the first post just because I figure what the hell.... now when I see notices of points in the game sometimes it shows the original stats numbers of the player on some kills and whatever and on others it appears as if it tried to restart them?
Horsedick is offline
bottiger
AlliedModders Donor
Join Date: Dec 2010
Old 09-15-2014 , 00:20   Re: Fix SteamIDs for the new update
Reply With Quote #38

The code in the first post converts steam3 to steam2.

My fixes assume steam3 everywhere.

If you want to convert steam2 to steam3 I think you can use something like this instead. I haven't tested this yet so it might have some syntax errors.

Code:
$uniqueid =~ s!STEAM_0:([01]):(\d+)!'[U:1:'.int($1)+int($2)*2.']'!eg;
__________________
bottiger is offline
sadam_unike
New Member
Join Date: Dec 2012
Old 01-01-2015 , 20:10   Re: Fix SteamIDs for the new update
Reply With Quote #39

Hello!

Please help me I did everything Nikkii sent but did not work the players continue to appear two times in the Hlstasx page.

Best Regards
sadam_unike is offline
C00ller
Junior Member
Join Date: Sep 2007
Old 01-02-2015 , 03:59   Re: Fix SteamIDs for the new update
Reply With Quote #40

Quote:
Originally Posted by sadam_unike View Post
Hello!

the players continue to appear two times in the Hlstasx page.

Best Regards

Assuming you prefer old SteamIDs, you should get rid of player records stored with new SteamIDs meanwhile, by query like this:

Code:
DELETE FROM hlstats_PlayerUniqueIds WHERE INSTR(uniqueId, 'U') > 0
And, of course, use Sourcemod snapshot 4558 or newer (to utilize old SteamIDs)

Last edited by C00ller; 01-02-2015 at 04:05.
C00ller is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:58.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode