Raised This Month: $166 Target: $400
 41% 

[solved] Sql-problem with stats and bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-26-2021 , 14:01   [solved] Sql-problem with stats and bots
Reply With Quote #1

I'm getting this error on every map change:
Code:
L 01/26/2021 - 18:52:56: [gungame.amxx] Could not execute query [INSERT INTO `gg_stats` (authid,name,timestamp,wins,points,streak,serverip) VALUES ('BOT','Deadlynome','1611683576','0','21','0','89.163.190.40:27515'),('BOT','Firestorm','1611683576','0','21','0','89.163.190.40:27515'),('BOT','bussemann','1611683576','0',] -- err #1062 [Duplicate entry 'BOT-89.163.190.40:27515' for key 'PRIMARY']
status

meta list

amxx list

I'm using the original gungame 2.13c except added 2 letters in client_disconnected-funktion to prevent the warning.
Attached Files
File Type: sma Get Plugin or Get Source (gungame.sma - 21 views - 281.3 KB)
__________________


Last edited by Mordekay; 01-27-2021 at 08:05.
Mordekay is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-26-2021 , 14:11   Re: Sql-problem with stats and bots
Reply With Quote #2

The error provides from duplicate entry:

"[Duplicate entry 'BOT-89.163.190.40:27515' for key 'PRIMARY']"

Because Bots have as steamid 'BOT' and a PRIMARY KEY in MySQL can't be duplicated: PRIMARY KEY(`authid`,`serverip`) see line 8467 in gungame.sma.
__________________



MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [Currently Beta]
Shadows Adi is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-26-2021 , 15:51   Re: Sql-problem with stats and bots
Reply With Quote #3

How to fix it?
__________________

Mordekay is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-26-2021 , 16:52   Re: Sql-problem with stats and bots
Reply With Quote #4

Well, try setting PRIMARY KEY(`authid`,`serverip`) in PRIMARY KEY(`name`,`serverip`)
__________________



MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [Currently Beta]
Shadows Adi is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-26-2021 , 17:44   Re: Sql-problem with stats and bots
Reply With Quote #5

If I could change the code I would not have asked (or not here but in scripting help)

EDIT: Memo to self: read the f**ing cvars:
Quote:
Originally Posted by cvars
gg_ignore_bots (default: 0)

If set to 1, bot wins and points are not saved. If set to 2, bots can't even trigger a win, unless there are no human players in the server, in addition to their wins and points not being saved.
So: solved
__________________


Last edited by Mordekay; 01-27-2021 at 08:02.
Mordekay 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:14.


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