I'm currently changing a lot in the sql_score's db structure of GreYFoX's DDRace.
I'm almost finished, yet noother gave the idea to also save map crc's in the db, so if the map crc changes old race record entries get ignored/deleted if wished by a config setting.
The thing is... Right now, if I detect that the db structure is using the old pattern from a previous ddrace revision, I'll go through all old tables with tablename's race_MAPNAME_record, I take it's mapnames and put them in a table ddrace_maps (ID, MapName), and I take the old entries and put them in tables ddrace_players, ddrace_runs, ddrace_record_checkpoints.
What I would need now, is that when I iterate through all old race_MAPNAME_record tables, I can get the CRC of the file with name MAPNAME (if still available), so that I can put the CRC into the ddrace_maps table as well.
I know how I can do this if the map is currently loaded.
CServer* pServ = (CServer *)m_pServer;
char mapCrc[8];
str_format(aBuf, sizeof(aBuf), "%08x", pServ->m_CurrentMapCrc);
But I don't know how to get the crc without having the map currently loaded.
Can you help me ?