subquery did not respect cvar hash or stage. does now by just using the zone_category_id as it identifies both correctly
This commit is contained in:
@@ -424,7 +424,7 @@ public void mysql_get_player_times(int client)
|
|||||||
FormatServerTag(serverTag);
|
FormatServerTag(serverTag);
|
||||||
|
|
||||||
char query[g_dQueryLength];
|
char query[g_dQueryLength];
|
||||||
Format(query, sizeof(query), "select ti.time_value, zc.cvars_hash, zc.stage, UNIX_TIMESTAMP(ti2.recorded_at) as recorded_at, (select count(*) + 1 from `timer_records` ti3 inner join `zone_categories` zc2 on ti3.zone_category_id = zc2.id where zc2.map_name = '%s' and zc2.server_tag = '%s' and ti3.time_value < ti.time_value and ti3.is_invalid = 0 and zc2.is_invalid = 0) as position from `timer_records` ti inner join `timer_improvements` ti2 on ti.improvement_id = ti2.id inner join `zone_categories` zc on ti.zone_category_id = zc.id where ti2.steam_auth = '%s' and zc.map_name = '%s' and zc.server_tag = '%s' and ti.time_value = (select min(ti4.time_value) from `timer_records` ti4 inner join `timer_improvements` ti5 on ti4.improvement_id = ti5.id where ti5.steam_auth = ti2.steam_auth and ti4.zone_category_id = ti.zone_category_id and ti4.is_invalid = 0 and zc.is_invalid = 0) order by zc.stage asc", g_cMapname, serverTag, g_csSID[client], g_cMapname, serverTag);
|
Format(query, sizeof(query), "select ti.time_value, zc.cvars_hash, zc.stage, UNIX_TIMESTAMP(ti2.recorded_at) as recorded_at, (select count(*) + 1 from `timer_records` ti3 where ti3.zone_category_id = ti.zone_category_id and ti3.time_value < ti.time_value and ti3.is_invalid = 0) as position from `timer_records` ti inner join `timer_improvements` ti2 on ti.improvement_id = ti2.id inner join `zone_categories` zc on ti.zone_category_id = zc.id where ti2.steam_auth = '%s' and zc.map_name = '%s' and zc.server_tag = '%s' and ti.time_value = (select min(ti4.time_value) from `timer_records` ti4 inner join `timer_improvements` ti5 on ti4.improvement_id = ti5.id where ti5.steam_auth = ti2.steam_auth and ti4.zone_category_id = ti.zone_category_id and ti4.is_invalid = 0 and zc.is_invalid = 0) order by zc.stage asc", g_csSID[client], g_cMapname, serverTag);
|
||||||
//only return the best timevalue for a clients category.
|
//only return the best timevalue for a clients category.
|
||||||
DataPack hDataPack = new DataPack();
|
DataPack hDataPack = new DataPack();
|
||||||
hDataPack.WriteCell(GetClientSerial(client));
|
hDataPack.WriteCell(GetClientSerial(client));
|
||||||
|
|||||||
Reference in New Issue
Block a user