I installed everything correctly and my server seems to be running great, except when I create Zones and save them they will still be there if I were to change the map and change it back, but when the server restarts the zones are not there and it says Zonegroup not found. In order to load the zones I need to go into the admin menu and manually load the zones. Any way to automatically load the zones?
I installed everything correctly and my server seems to be running great, except when I create Zones and save them they will still be there if I were to change the map and change it back, but when the server restarts the zones are not there and it says Zonegroup not found. In order to load the zones I need to go into the admin menu and manually load the zones. Any way to automatically load the zones?
I use CkSurf for a minigames server, but when all player in one team are dead the round don't restart..
i try to put some line in my server.cfg but still the same please someone can explain me how to resolve that ?
ty
So I've come to find out that there is a very inefficient query that causes serious SQL usage, and in my experience up to almost 30 second query times with a populated database.
Code:
char sql_selectRecordCheckpoints[] = "SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' UNION SELECT a.zonegroup, b.cp1, b.cp2, b.cp3, b.cp4, b.cp5, b.cp6, b.cp7, b.cp8, b.cp9, b.cp10, b.cp11, b.cp12, b.cp13, b.cp14, b.cp15, b.cp16, b.cp17, b.cp18, b.cp19, b.cp20, b.cp21, b.cp22, b.cp23, b.cp24, b.cp25, b.cp26, b.cp27, b.cp28, b.cp29, b.cp30, b.cp31, b.cp32, b.cp33, b.cp34, b.cp35 FROM ck_bonus a LEFT JOIN ck_checkpoints b ON a.steamid = b.steamid AND a.zonegroup = b.zonegroup WHERE a.mapname = '%s' GROUP BY a.zonegroup";
(line 72 in sql.sp)
Cleaned up, readable query:
PHP Code:
SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' UNION SELECT a.zonegroup, b.cp1, b.cp2, b.cp3, b.cp4, b.cp5, b.cp6, b.cp7, b.cp8, b.cp9, b.cp10, b.cp11, b.cp12, b.cp13, b.cp14, b.cp15, b.cp16, b.cp17, b.cp18, b.cp19, b.cp20, b.cp21, b.cp22, b.cp23, b.cp24, b.cp25, b.cp26, b.cp27, b.cp28, b.cp29, b.cp30, b.cp31, b.cp32, b.cp33, b.cp34, b.cp35 FROM ck_bonus a LEFT JOIN ck_checkpoints b ON a.steamid = b.steamid AND a.zonegroup = b.zonegroup WHERE a.mapname = '%s' GROUP BY a.zonegroup";
I ran a profile on a sample query, this is what I came up with:
As you can see, it takes an insane amount of time, and the join isn't using indexes when a map has a bonus. Maps with large numbers of completions & players loading can cause servers to see severe delays in initial player loading times.
Any mysql wizards out there that might be able to help with this?
So I've come to find out that there is a very inefficient query that causes serious SQL usage, and in my experience up to almost 30 second query times with a populated database.
Code:
char sql_selectRecordCheckpoints[] = "SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' UNION SELECT a.zonegroup, b.cp1, b.cp2, b.cp3, b.cp4, b.cp5, b.cp6, b.cp7, b.cp8, b.cp9, b.cp10, b.cp11, b.cp12, b.cp13, b.cp14, b.cp15, b.cp16, b.cp17, b.cp18, b.cp19, b.cp20, b.cp21, b.cp22, b.cp23, b.cp24, b.cp25, b.cp26, b.cp27, b.cp28, b.cp29, b.cp30, b.cp31, b.cp32, b.cp33, b.cp34, b.cp35 FROM ck_bonus a LEFT JOIN ck_checkpoints b ON a.steamid = b.steamid AND a.zonegroup = b.zonegroup WHERE a.mapname = '%s' GROUP BY a.zonegroup";
The query only takes around 0.2 - 0.3 seconds for me, however you could possibly just modify the query and remove the bonus checkpoints, I don't think there's any surf map that has a staged bonus, so the checkpoints for bonuses is rather useless
The query only takes around 0.2 - 0.3 seconds for me, however you could possibly just modify the query and remove the bonus checkpoints, I don't think there's any surf map that has a staged bonus, so the checkpoints for bonuses is rather useless
That's what I was thinking, I don't have any staged bonuses but I don't want to remove the functionality of bonus checkpoints. I'm using this query as a temporary workaround, but it's not a proper fix.
Could you list your ck_bonus and ck_checkpoints indexes for me? If it's not asking too much, could you also do an EXPLAIN like I have above so I can see the result of yours? I'd be interested if it was different for some reason.
Also, the time it takes varies with the amount of completions total, and on the map since as you can see in the EXPLAIN, it is essentially doing a full db scan.
That's what I was thinking, I don't have any staged bonuses but I don't want to remove the functionality of bonus checkpoints.
Could you list your ck_bonus and ck_checkpoints indexes for me? If it's not asking too much, could you also do an EXPLAIN like I have above so I can see the result of yours? I'd be interested if it was different for some reason.
Also, the time it takes varies with the amount of completions total, and on the map since as you can see in the EXPLAIN, it is essentially doing a full db scan.
My ck_bonus will be different because I've added styles
Apparently you can't use indexes with a join statement between 2 tables that have different collations. I think the initial installation of cksurf created ck_bonus using collation 'utf8_general_ci', and ck_checkpoints using 'latin1_swedish_ci'. Changing ck_bonus to use latin1_swedish_ci did the trick, sped up queries by over 100x.