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

[Issue] MySQL went crazy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 05-11-2020 , 05:39   [Issue] MySQL went crazy
Reply With Quote #1

Hello, does anyone knows what could cause this?


It should be just one for each player
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098

Last edited by OXYD; 05-11-2020 at 05:40.
OXYD is offline
CrazyHackGUT
AlliedModders Donor
Join Date: Feb 2016
Location: Izhevsk, Russia
Old 05-11-2020 , 05:50   Re: [Issue] MySQL went crazy
Reply With Quote #2

This can be an issue in your plugin, not driver.
__________________
My english is very bad. I am live in Russia. Learning english language - very hard task for me...
CrazyHackGUT is offline
Send a message via ICQ to CrazyHackGUT Send a message via Skype™ to CrazyHackGUT
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 05-11-2020 , 06:21   Re: [Issue] MySQL went crazy
Reply With Quote #3

HTML Code:
void WatchDog_User(int Data)
{
	static int Time, Team;

	Time = GetTime();
	Team = GetClientTeam(Data);

	if (Team == CS_TEAM_T || Team == CS_TEAM_CT)
	{
		GeoR_Code(g_Ip[Data], g_Code, sizeof(g_Code));
		GeoR_Country(g_Ip[Data], g_Country, sizeof(g_Country));
		FormatEx(g_Buffer, sizeof(g_Buffer), "INSERT IGNORE INTO watchdog_admins VALUES ('%s', '%s', '%s', %d, %d, %d, '%s', '%s');", \
			g_Steam[Data], g_Ip[Data], g_Name[Data], 2, 0, Time, g_Code, g_Country);
		SQL_TQuery(g_pConnection, EmptyFn, g_Buffer);
		FormatEx(g_Buffer, sizeof(g_Buffer), "UPDATE watchdog_admins SET lastSeen = %d, minutesOnline = minutesOnline + 2 WHERE adminSteam = '%s';", \
			Time, g_Steam[Data]);
		SQL_TQuery(g_pConnection, EmptyFn, g_Buffer);
	}

	else if (Team == CS_TEAM_SPECTATOR)
	{
		GeoR_Code(g_Ip[Data], g_Code, sizeof(g_Code));
		GeoR_Country(g_Ip[Data], g_Country, sizeof(g_Country));
		FormatEx(g_Buffer, sizeof(g_Buffer), "INSERT IGNORE INTO watchdog_admins VALUES ('%s', '%s', '%s', %d, %d, %d, '%s', '%s');", \
			g_Steam[Data], g_Ip[Data], g_Name[Data], 0, 2, Time, g_Code, g_Country);
		SQL_TQuery(g_pConnection, EmptyFn, g_Buffer);
		FormatEx(g_Buffer, sizeof(g_Buffer), "UPDATE watchdog_admins SET lastSeen = %d, minutesSpecOnline = minutesSpecOnline + 2 WHERE adminSteam = '%s';", \
			Time, g_Steam[Data]);
		SQL_TQuery(g_pConnection, EmptyFn, g_Buffer);
	}
}
Maybe u can find the problem? xD
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098

Last edited by OXYD; 05-11-2020 at 06:22.
OXYD is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-12-2020 , 10:46   Re: [Issue] MySQL went crazy
Reply With Quote #4

Your queries are relying on there being a UNIQUE index for the `adminSteam` column, what is your database structure and keys?
__________________
asherkin is offline
OXYD
AlliedModders Donor
Join Date: Aug 2019
Location: pluto
Old 05-13-2020 , 02:24   Re: [Issue] MySQL went crazy
Reply With Quote #5

U mean this?

HTML Code:
CREATE TABLE `watchdog_admins` (
  `adminSteam` varchar(64) NOT NULL,
  `adminIp` varchar(64) DEFAULT NULL,
  `adminName` varchar(128) DEFAULT NULL,
  `minutesOnline` int(11) DEFAULT NULL,
  `minutesSpecOnline` int(11) DEFAULT NULL,
  `lastSeen` int(11) DEFAULT NULL,
  `countryCode` varchar(8) DEFAULT NULL,
  `Country` varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
__________________
ADD ME ON STEAM - https://steamcommunity.com/id/kenoxyd
89.40.104.210:27015 // COMPETITIVE SERVER
DISCORD: KENOXYD#9098

Last edited by OXYD; 05-13-2020 at 02:25.
OXYD 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 05:54.


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