Raised This Month: $32 Target: $400
 8% 

Player's birthday.


Post New Thread Reply   
 
Thread Tools Display Modes
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 02-25-2012 , 16:36   Re: Player's birthday.
Reply With Quote #31

MySQL Workbench refuses to edit the table if no PRIMARY KEY is defined.
Code:
ALTER TABLE `birthday` ADD PRIMARY KEY ( `steamid` )
Of course you can choose to add the KEY to just to `steamid` but I think the queries are faster if the KEY contains all the data. Fix me if I'm wrong.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma

Last edited by rautamiekka; 02-26-2012 at 08:18. Reason: KEY for SteamID only. Thanks to Luki for correcting.
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
[PL]Luki
Member
Join Date: Jun 2009
Old 02-25-2012 , 16:40   Re: Player's birthday.
Reply With Quote #32

Adding primary key for all three fields allows you to have multiple copies of the same steamid but with another day and/or month, so it's bad idea ;)
[PL]Luki is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 02-25-2012 , 20:10   Re: Player's birthday.
Reply With Quote #33

Getting this error, my database is fine... There are even entries in it... so I am unsure of the cause for it:

L 02/25/2012 - 18:55:41: [SM] Native "SQL_FetchInt" reported: Current result set has no fetched rows L 02/25/2012 - 18:55:41: [SM] Displaying call stack trace for plugin "birthday.smx": L 02/25/2012 - 18:55:41: [SM] [0] Line 116, G:\FTPShit\sourcemod\WinDev\scripting\birthda y.sp::CheckBirthday() L 02/25/2012 - 18:55:41: [SM] [1] Line 93, G:\FTPShit\sourcemod\WinDev\scripting\birthda y.sp::OnPlayerSpawn()
StrikerMan780 is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 02-26-2012 , 08:17   Re: Player's birthday.
Reply With Quote #34

Quote:
Originally Posted by [PL]Luki View Post
Adding primary key for all three fields allows you to have multiple copies of the same steamid but with another day and/or month, so it's bad idea ;)
Post fixed.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma

Last edited by rautamiekka; 02-26-2012 at 08:18.
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 04-05-2012 , 18:07   Re: Player's birthday.
Reply With Quote #35

Other than the last error I posted, could someone also make this use threaded SQL queries instead of non-threaded too? Thanks.
StrikerMan780 is offline
[PL]Luki
Member
Join Date: Jun 2009
Old 04-05-2012 , 18:53   Re: Player's birthday.
Reply With Quote #36

This plugin is kinda abandoned, but I think I may do it later.
[PL]Luki is offline
angel635
Senior Member
Join Date: Apr 2011
Old 04-30-2012 , 10:32   Re: Player's birthday.
Reply With Quote #37

hi

Log erreur pièce joint
Attached Files
File Type: log errors_20120430.log (18.7 KB, 71 views)
angel635 is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 08-31-2013 , 06:52   Re: Player's birthday.
Reply With Quote #38

At least the plugin still works, but the threading would be best, and stripping the 'STEAM_' part from Steam ID would save bandwidth and storage space. A feature with priority right after threading, check for a already-set birthdate so that the chat isn't spammed for those who've already set theirs; requires changing method of notifying to personal, but it's worth it.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma

Last edited by rautamiekka; 08-31-2013 at 07:16. Reason: Edit 1: automatic checking for birthdate
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 08-01-2014 , 05:58   Re: Player's birthday.
Reply With Quote #39

[PL]Luki, we got a situation here:

CS:GO has its own Steam ID format from the usual, with a catch: the first number in the ID, 'STEAM_#', where '#' is a number, is 1 instead of 0 or whatever, otherwise the ID is identical.

This sort of requires rewriting of the plugin. It seems Miraculix, owner of CSS Bank, rewrote the plugin so that it strips the 'STEAM_#:' part of the ID, leaving just the second number, the second colon, and the number sequence for this reason. For example, my usual SID is STEAM_0:1:11268321, but in CS:GO it is STEAM_1:1:11268321. So, CSS Bank strips 'STEAM_1:' and leaves '1:11268321'.

You should do this too so that the database doesn't need to be polluted by nearly identical IDs.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 08-01-2014 , 07:04   Re: Player's birthday.
Reply With Quote #40

There are dozens of solutions to this little problem, but the easiest way (while not the correct way) is to force a specific universe of Steam IDs regardless of what the client is using. That is to say, if the client is using the STEAM_1 branch of identifications, simply force the 6th character of the string to a 0, so that they're identified as the STEAM_0 branch.
Without looking at the source code, here's what I mean:
PHP Code:
decl String:sSteam[32];
GetClientAuthString(clientsSteamsizeof(sSteam));
sSteam[6] = '0';
//Poof! STEAM_1 becomes STEAM_0 
__________________

Last edited by thetwistedpanda; 08-01-2014 at 07:04.
thetwistedpanda is offline
Reply



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 12:30.


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