Raised This Month: $12 Target: $400
 3% 

[TF2 Stats] With Web Ranking and Item Logger [v9.1.0]


Post New Thread Reply   
 
Thread Tools Display Modes
DrWagstaff
SourceMod Donor
Join Date: Apr 2010
Location: Livermore
Old 05-18-2010 , 14:16   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #501

Quote:
Originally Posted by DarthNinja View Post
It has to do with importing from sqlite.
You need to set them to default to "0" and not "null"
How do I do so? And can I batch fix the entries that are null'd? There's .. a lot of them. At least a thousand new players.
DrWagstaff is offline
Send a message via AIM to DrWagstaff
Sobuno
Member
Join Date: Aug 2009
Old 05-18-2010 , 15:09   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #502

Quote:
Originally Posted by DrWagstaff View Post
How do I do so? And can I batch fix the entries that are null'd? There's .. a lot of them. At least a thousand new players.
For batch fixing:
The structure is like this: "Update Player set field_name = 0 where field_name = NULL"

Do that for each field name, there might be an easier way, but I am not even supposed to lurk here anymore so what do I know ;)

Last edited by Sobuno; 05-18-2010 at 15:15. Reason: Clarification
Sobuno is offline
DrWagstaff
SourceMod Donor
Join Date: Apr 2010
Location: Livermore
Old 05-18-2010 , 15:15   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #503

Is that a mysql query? I mean obviously not a complete one, but is that on the mysql end or the sourcemod end? I really, really, tried teaching myself sourcemod scripting and whatnot, but I still just don't get it. Also, never understood mysql. It makes sense when I look at it, but I can't write it to save my life.
DrWagstaff is offline
Send a message via AIM to DrWagstaff
Sobuno
Member
Join Date: Aug 2009
Old 05-18-2010 , 15:19   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #504

Quote:
Originally Posted by DrWagstaff View Post
Is that a mysql query? I mean obviously not a complete one, but is that on the mysql end or the sourcemod end? I really, really, tried teaching myself sourcemod scripting and whatnot, but I still just don't get it. Also, never understood mysql. It makes sense when I look at it, but I can't write it to save my life.
It is an SQL query, yes, use it through phpMyAdmin or similar. Remember to change the field name to the real ones.

Or you can wait five minutes and let me make a bunch of SQL queries that will do it all
Sobuno is offline
DrWagstaff
SourceMod Donor
Join Date: Apr 2010
Location: Livermore
Old 05-18-2010 , 15:21   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #505

I'll wait I really appreciate you helping me. This is highly .. annoying. I wonder why it's setting new stuff to null in the first place. Don't know how to fix it.
DrWagstaff is offline
Send a message via AIM to DrWagstaff
Sobuno
Member
Join Date: Aug 2009
Old 05-18-2010 , 15:35   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #506

I take no responsibility for the following piece of code, it is completely untested on real data and you are advised to back up your database before running it:

Fixing the structure of the table:
Code:
ALTER TABLE `Player` CHANGE `STEAMID` `STEAMID` varchar(25) NOT  NULL,CHANGE `NAME` `NAME` varchar(30) NOT NULL,CHANGE `POINTS` `POINTS`  int(25) NOT NULL default '0',CHANGE `PLAYTIME` `PLAYTIME` int(25) NOT  NULL default '0',CHANGE `LASTONTIME` `LASTONTIME` int(25) NOT NULL  default '0',CHANGE `KILLS` `KILLS` int(11) NOT NULL default '0',CHANGE  `Death` `Death` int(11) NOT NULL default '0',CHANGE `KillAssist`  `KillAssist` int(11) NOT NULL default '0',CHANGE `KillAssistMedic`  `KillAssistMedic` int(11) NOT NULL default '0',CHANGE `BuildSentrygun`  `BuildSentrygun` int(11) NOT NULL default '0',CHANGE `BuildDispenser`  `BuildDispenser` int(11) NOT NULL default '0',CHANGE `HeadshotKill`  `HeadshotKill` int(11) NOT NULL default '0',CHANGE `KOSentrygun`  `KOSentrygun` int(11) NOT NULL default '0',CHANGE `Domination`  `Domination` int(11) NOT NULL default '0',CHANGE `Overcharge`  `Overcharge` int(11) NOT NULL default '0',CHANGE `KOSapper` `KOSapper`  int(11) NOT NULL default '0',CHANGE `BOTeleporterentrace`  `BOTeleporterentrace` int(11) NOT NULL default '0',CHANGE `KODispenser`  `KODispenser` int(11) NOT NULL default '0',CHANGE `BOTeleporterExit`  `BOTeleporterExit` int(11) NOT NULL default '0',CHANGE `CPBlocked`  `CPBlocked` int(11) NOT NULL default '0',CHANGE `CPCaptured`  `CPCaptured` int(11) NOT NULL default '0',CHANGE `FileCaptured`  `FileCaptured` int(11) NOT NULL default '0',CHANGE `ADCaptured`  `ADCaptured` int(11) NOT NULL default '0',CHANGE `KOTeleporterExit`  `KOTeleporterExit` int(11) NOT NULL default '0',CHANGE  `KOTeleporterEntrace` `KOTeleporterEntrace` int(11) NOT NULL default  '0',CHANGE `BOSapper` `BOSapper` int(11) NOT NULL default '0',CHANGE  `Revenge` `Revenge` int(11) NOT NULL default '0',CHANGE `KW_Axe`  `KW_Axe` int(11) NOT NULL default '0',CHANGE `KW_Bnsw` `KW_Bnsw` int(11)  NOT NULL default '0',CHANGE `KW_Bt` `KW_Bt` int(11) NOT NULL default  '0',CHANGE `KW_Bttl` `KW_Bttl` int(11) NOT NULL default '0',CHANGE  `KW_Cg` `KW_Cg` int(11) NOT NULL default '0',CHANGE `KW_Fsts` `KW_Fsts`  int(11) NOT NULL default '0',CHANGE `KW_Ft` `KW_Ft` int(11) NOT NULL  default '0',CHANGE `KW_Gl` `KW_Gl` int(11) NOT NULL default '0',CHANGE  `KW_Kn` `KW_Kn` int(11) NOT NULL default '0',CHANGE `KW_Mctte`  `KW_Mctte` int(11) NOT NULL default '0',CHANGE `KW_Mgn` `KW_Mgn` int(11)  NOT NULL default '0',CHANGE `KW_Ndl` `KW_Ndl` int(11) NOT NULL default  '0',CHANGE `KW_Pistl` `KW_Pistl` int(11) NOT NULL default '0',CHANGE  `KW_Rkt` `KW_Rkt` int(11) NOT NULL default '0',CHANGE `KW_Sg` `KW_Sg`  int(11) NOT NULL default '0',CHANGE `KW_Sky` `KW_Sky` int(11) NOT NULL  default '0',CHANGE `KW_Smg` `KW_Smg` int(11) NOT NULL default '0',CHANGE  `KW_Spr` `KW_Spr` int(11) NOT NULL default '0',CHANGE `KW_Stgn`  `KW_Stgn` int(11) NOT NULL default '0',CHANGE `KW_Wrnc` `KW_Wrnc`  int(11) NOT NULL default '0',CHANGE `KW_Sntry` `KW_Sntry` int(11) NOT  NULL default '0',CHANGE `KW_Shvl` `KW_Shvl` int(11) NOT NULL default  '0',CHANGE `KW_Ubersaw` `KW_Ubersaw` int(11) NOT NULL default '0',CHANGE  `KW_Flaregun` `KW_Flaregun` int(11) NOT NULL default '0',CHANGE  `KW_Axtinguisher` `KW_Axtinguisher` int(11) NOT NULL default '0',CHANGE  `KW_taunt_pyro` `KW_taunt_pyro` int(11) NOT NULL default '0',CHANGE  `KW_taunt_heavy` `KW_taunt_heavy` int(11) NOT NULL default '0',CHANGE  `KW_gloves` `KW_gloves` int(11) NOT NULL default '0',CHANGE  `KW_backburner` `KW_backburner` int(11) NOT NULL default '0',CHANGE  `KW_natascha` `KW_natascha` int(11) NOT NULL default '0',CHANGE  `KW_blutsauger` `KW_blutsauger` int(11) NOT NULL default '0',CHANGE  `KW_deflect_rocket` `KW_deflect_rocket` int(11) NOT NULL default  '0',CHANGE `KW_deflect_promode` `KW_deflect_promode` int(11) NOT NULL  default '0',CHANGE `KW_deflect_sticky` `KW_deflect_sticky` int(11) NOT  NULL default '0',CHANGE `KW_world` `KW_world` int(11) NOT NULL default  '0',CHANGE `KW_bat_wood` `KW_bat_wood` int(11) NOT NULL default  '0',CHANGE `player_stunned` `player_stunned` int(11) NOT NULL default  '0',CHANGE `drunk_bonk` `drunk_bonk` int(11) NOT NULL default '0',CHANGE  `player_stealsandvich` `player_stealsandvich` int(11) NOT NULL default  '0',CHANGE `chat_status` `chat_status` int(11) NOT NULL default  '0',CHANGE `KW_tf_projectile_arrow` `KW_tf_projectile_arrow` int(11) NOT  NULL default '0',CHANGE `KW_ambassador` `KW_ambassador` int(11) NOT  NULL default '0',CHANGE `KW_taunt_sniper` `KW_taunt_sniper` int(11) NOT  NULL default '0',CHANGE `KW_taunt_spy` `KW_taunt_spy` int(11) NOT NULL  default '0',CHANGE `player_extinguished` `player_extinguished` int(11)  NOT NULL default '0',CHANGE `player_teleported` `player_teleported`  int(11) NOT NULL default '0',CHANGE `player_feigndeath`  `player_feigndeath` int(11) NOT NULL default '0',CHANGE  `KW_force_a_nature` `KW_force_a_nature` int(11) NOT NULL default  '0',CHANGE `KW_sandman` `KW_sandman` int(11) NOT NULL default '0',CHANGE  `K_backstab` `K_backstab` int(11) NOT NULL default '0',CHANGE  `KW_compound_bow` `KW_compound_bow` int(11) NOT NULL default '0',CHANGE  `KW_taunt_scout` `KW_taunt_scout` int(11) NOT NULL default '0',CHANGE  `KW_deflect_arrow` `KW_deflect_arrow` int(11) NOT NULL default  '0',CHANGE `KW_rocketlauncher_directhit` `KW_rocketlauncher_directhit`  int(11) NOT NULL default '0',CHANGE `KW_telefrag` `KW_telefrag` int(11)  NOT NULL default '0',CHANGE `KW_deflect_flare` `KW_deflect_flare`  int(11) NOT NULL default '0',CHANGE `KW_taunt_soldier`  `KW_taunt_soldier` int(11) NOT NULL default '0',CHANGE `KW_pickaxe`  `KW_pickaxe` int(11) NOT NULL default '0',CHANGE `KW_demoshield`  `KW_demoshield` int(11) NOT NULL default '0',CHANGE `KW_sword`  `KW_sword` int(11) NOT NULL default '0',CHANGE `KW_taunt_demoman`  `KW_taunt_demoman` int(11) NOT NULL default '0',CHANGE  `KW_sticky_resistance` `KW_sticky_resistance` int(11) NOT NULL default  '0',CHANGE `KW_jar` `KW_jar` int(11) NOT NULL default '0'
Batch fixing the entries to work in the future (Might not be needed, but I have no data to test with):
Code:
UPDATE `Player` SET `STEAMID` =0 WHERE `STEAMID` = NULL; UPDATE `Player`  SET `NAME` =0 WHERE `NAME` = NULL; UPDATE `Player` SET `POINTS` =0  WHERE `POINTS` = NULL; UPDATE `Player` SET `PLAYTIME` =0 WHERE  `PLAYTIME` = NULL; UPDATE `Player` SET `LASTONTIME` =0 WHERE  `LASTONTIME` = NULL; UPDATE `Player` SET `KILLS` =0 WHERE `KILLS` =  NULL; UPDATE `Player` SET `Death` =0 WHERE `Death` = NULL; UPDATE  `Player` SET `KillAssist` =0 WHERE `KillAssist` = NULL; UPDATE `Player`  SET `KillAssistMedic` =0 WHERE `KillAssistMedic` = NULL; UPDATE `Player`  SET `BuildSentrygun` =0 WHERE `BuildSentrygun` = NULL; UPDATE `Player`  SET `BuildDispenser` =0 WHERE `BuildDispenser` = NULL; UPDATE `Player`  SET `HeadshotKill` =0 WHERE `HeadshotKill` = NULL; UPDATE `Player` SET  `KOSentrygun` =0 WHERE `KOSentrygun` = NULL; UPDATE `Player` SET  `Domination` =0 WHERE `Domination` = NULL; UPDATE `Player` SET  `Overcharge` =0 WHERE `Overcharge` = NULL; UPDATE `Player` SET  `KOSapper` =0 WHERE `KOSapper` = NULL; UPDATE `Player` SET  `BOTeleporterentrace` =0 WHERE `BOTeleporterentrace` = NULL; UPDATE  `Player` SET `KODispenser` =0 WHERE `KODispenser` = NULL; UPDATE  `Player` SET `BOTeleporterExit` =0 WHERE `BOTeleporterExit` = NULL;  UPDATE `Player` SET `CPBlocked` =0 WHERE `CPBlocked` = NULL; UPDATE  `Player` SET `CPCaptured` =0 WHERE `CPCaptured` = NULL; UPDATE `Player`  SET `FileCaptured` =0 WHERE `FileCaptured` = NULL; UPDATE `Player` SET  `ADCaptured` =0 WHERE `ADCaptured` = NULL; UPDATE `Player` SET  `KOTeleporterExit` =0 WHERE `KOTeleporterExit` = NULL; UPDATE `Player`  SET `KOTeleporterEntrace` =0 WHERE `KOTeleporterEntrace` = NULL; UPDATE  `Player` SET `BOSapper` =0 WHERE `BOSapper` = NULL; UPDATE `Player` SET  `Revenge` =0 WHERE `Revenge` = NULL; UPDATE `Player` SET `KW_Axe` =0  WHERE `KW_Axe` = NULL; UPDATE `Player` SET `KW_Bnsw` =0 WHERE `KW_Bnsw` =  NULL; UPDATE `Player` SET `KW_Bt` =0 WHERE `KW_Bt` = NULL; UPDATE  `Player` SET `KW_Bttl` =0 WHERE `KW_Bttl` = NULL; UPDATE `Player` SET  `KW_Cg` =0 WHERE `KW_Cg` = NULL; UPDATE `Player` SET `KW_Fsts` =0 WHERE  `KW_Fsts` = NULL; UPDATE `Player` SET `KW_Ft` =0 WHERE `KW_Ft` = NULL;  UPDATE `Player` SET `KW_Gl` =0 WHERE `KW_Gl` = NULL; UPDATE `Player` SET  `KW_Kn` =0 WHERE `KW_Kn` = NULL; UPDATE `Player` SET `KW_Mctte` =0  WHERE `KW_Mctte` = NULL; UPDATE `Player` SET `KW_Mgn` =0 WHERE `KW_Mgn` =  NULL; UPDATE `Player` SET `KW_Ndl` =0 WHERE `KW_Ndl` = NULL; UPDATE  `Player` SET `KW_Pistl` =0 WHERE `KW_Pistl` = NULL; UPDATE `Player` SET  `KW_Rkt` =0 WHERE `KW_Rkt` = NULL; UPDATE `Player` SET `KW_Sg` =0 WHERE  `KW_Sg` = NULL; UPDATE `Player` SET `KW_Sky` =0 WHERE `KW_Sky` = NULL;  UPDATE `Player` SET `KW_Smg` =0 WHERE `KW_Smg` = NULL; UPDATE `Player`  SET `KW_Spr` =0 WHERE `KW_Spr` = NULL; UPDATE `Player` SET `KW_Stgn` =0  WHERE `KW_Stgn` = NULL; UPDATE `Player` SET `KW_Wrnc` =0 WHERE `KW_Wrnc`  = NULL; UPDATE `Player` SET `KW_Sntry` =0 WHERE `KW_Sntry` = NULL;  UPDATE `Player` SET `KW_Shvl` =0 WHERE `KW_Shvl` = NULL; UPDATE `Player`  SET `KW_Ubersaw` =0 WHERE `KW_Ubersaw` = NULL; UPDATE `Player` SET  `KW_Flaregun` =0 WHERE `KW_Flaregun` = NULL; UPDATE `Player` SET  `KW_Axtinguisher` =0 WHERE `KW_Axtinguisher` = NULL; UPDATE `Player` SET  `KW_taunt_pyro` =0 WHERE `KW_taunt_pyro` = NULL; UPDATE `Player` SET  `KW_taunt_heavy` =0 WHERE `KW_taunt_heavy` = NULL; UPDATE `Player` SET  `KW_gloves` =0 WHERE `KW_gloves` = NULL; UPDATE `Player` SET  `KW_backburner` =0 WHERE `KW_backburner` = NULL; UPDATE `Player` SET  `KW_natascha` =0 WHERE `KW_natascha` = NULL; UPDATE `Player` SET  `KW_blutsauger` =0 WHERE `KW_blutsauger` = NULL; UPDATE `Player` SET  `KW_deflect_rocket` =0 WHERE `KW_deflect_rocket` = NULL; UPDATE `Player`  SET `KW_deflect_promode` =0 WHERE `KW_deflect_promode` = NULL; UPDATE  `Player` SET `KW_deflect_sticky` =0 WHERE `KW_deflect_sticky` = NULL;  UPDATE `Player` SET `KW_world` =0 WHERE `KW_world` = NULL; UPDATE  `Player` SET `KW_bat_wood` =0 WHERE `KW_bat_wood` = NULL; UPDATE  `Player` SET `player_stunned` =0 WHERE `player_stunned` = NULL; UPDATE  `Player` SET `drunk_bonk` =0 WHERE `drunk_bonk` = NULL; UPDATE `Player`  SET `player_stealsandvich` =0 WHERE `player_stealsandvich` = NULL;  UPDATE `Player` SET `chat_status` =0 WHERE `chat_status` = NULL; UPDATE  `Player` SET `KW_tf_projectile_arrow` =0 WHERE `KW_tf_projectile_arrow` =  NULL; UPDATE `Player` SET `KW_ambassador` =0 WHERE `KW_ambassador` =  NULL; UPDATE `Player` SET `KW_taunt_sniper` =0 WHERE `KW_taunt_sniper` =  NULL; UPDATE `Player` SET `KW_taunt_spy` =0 WHERE `KW_taunt_spy` =  NULL; UPDATE `Player` SET `player_extinguished` =0 WHERE  `player_extinguished` = NULL; UPDATE `Player` SET `player_teleported` =0  WHERE `player_teleported` = NULL; UPDATE `Player` SET  `player_feigndeath` =0 WHERE `player_feigndeath` = NULL; UPDATE `Player`  SET `KW_force_a_nature` =0 WHERE `KW_force_a_nature` = NULL; UPDATE  `Player` SET `KW_sandman` =0 WHERE `KW_sandman` = NULL; UPDATE `Player`  SET `K_backstab` =0 WHERE `K_backstab` = NULL; UPDATE `Player` SET  `KW_compound_bow` =0 WHERE `KW_compound_bow` = NULL; UPDATE `Player` SET  `KW_taunt_scout` =0 WHERE `KW_taunt_scout` = NULL; UPDATE `Player` SET  `KW_deflect_arrow` =0 WHERE `KW_deflect_arrow` = NULL; UPDATE `Player`  SET `KW_rocketlauncher_directhit` =0 WHERE `KW_rocketlauncher_directhit`  = NULL; UPDATE `Player` SET `KW_telefrag` =0 WHERE `KW_telefrag` =  NULL; UPDATE `Player` SET `KW_deflect_flare` =0 WHERE `KW_deflect_flare`  = NULL; UPDATE `Player` SET `KW_taunt_soldier` =0 WHERE  `KW_taunt_soldier` = NULL; UPDATE `Player` SET `KW_pickaxe` =0 WHERE  `KW_pickaxe` = NULL; UPDATE `Player` SET `KW_demoshield` =0 WHERE  `KW_demoshield` = NULL; UPDATE `Player` SET `KW_sword` =0 WHERE  `KW_sword` = NULL; UPDATE `Player` SET `KW_taunt_demoman` =0 WHERE  `KW_taunt_demoman` = NULL; UPDATE `Player` SET `KW_sticky_resistance` =0  WHERE `KW_sticky_resistance` = NULL; UPDATE `Player` SET `KW_jar` =0  WHERE `KW_jar` = NULL;
I'll check back in a few hours to see whether it worked for you

Last edited by Sobuno; 05-18-2010 at 15:37.
Sobuno is offline
DrWagstaff
SourceMod Donor
Join Date: Apr 2010
Location: Livermore
Old 05-18-2010 , 16:20   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #507

Worked like a charm. Thank you very much.
DrWagstaff is offline
Send a message via AIM to DrWagstaff
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 05-18-2010 , 17:55   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #508

With SQLite records are set to "null" instead of 0, so if a player has 0 kills with the huntsman, he has "null" kills with the huntsman. Likewise, the default values are also "null".
However, with mysql you have to use "0" and not null, so direct importing from sqlite causes problems.
__________________
DarthNinja is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 05-18-2010 , 17:56   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #509

Quote:
Originally Posted by Dharok1337 View Post
It's not even loading on my server. sm plugins says its not event running.
  • Is the plugin in the correct folder?
  • Did you restart your server?
  • Are there error messages?
__________________
DarthNinja is offline
DrWagstaff
SourceMod Donor
Join Date: Apr 2010
Location: Livermore
Old 05-18-2010 , 18:14   Re: [TF2 Stats] With Web Ranking and Item Logger [v6.1/6.5.5]
Reply With Quote #510

Hey Dharok1337

If you'd like, I feel I owe a little time towards the good of the SM community for all the help I've been getting. If you want to IM me at "Delicious Turtle" I can help you set it up in SQLite mode or mySQL. I've installed quite a few plugins so far, and troubleshot them. I'm here if ya need me.
DrWagstaff is offline
Send a message via AIM to DrWagstaff
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 21:37.


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