I think the first thing that needs to be done is to have PvPGN store the game data in the database instead of text files
Once the data is stored in a database, we can work on writing PHP to talk to the db and display game data more efficiently
So far I dont know how to do either of those things however...
AFAIK PvPGN have no option to store it's log in DB. So we should make a report parser ourselves.
To parse the report and upload it's data to DB.
the code i wrote uses entirely publicly available info, it literally does not use a single thing you need admin access for. goes to somewhere like this: http://reportb.war2.ru/, and opens all the unchecked reports, parses them, and adds them to its own db.
Yes, exactly, this reportb should be used with parser.
Also note that these reports should contain different languages depend on war2-client language: english (usual), german (for some clients), russian (for russian combat), spanish (for spanish build) and maybe several more.
I think the 1-st thing we need is parser function.
Proper function should return one of 3 values:
- success, when the game parsed and result is inside the DB
- broken report, when game parsed but script detected an error in the report
- parse error, when game has not been parsed but not sure if it's error script or not. A reason to check and debug the script.
Also, it should parse all the games: were people have been dropped, used different languages and played 1v1, 2v5, 4v4 or any others.
That is how i see this.
Also, i dislike current database format and prefer to refactor it also.
I think about 2 main tables:
- games with all game parameters (name, id, type, option, 3 dates, map, mapauth, mapsize, tile, joins, maxplayers, minutes).
- players - the table contains each player in each game (game_id, player_order, name, race, WIN_LOSS_DISC, map, play_time, language, score, units, structures, resources, etc...)
I mean everyting except maybe normal/ladder/iron records as not related to the game.
Maybe several more tables needed to improve performance and size: player_name2id, map_name2id, etc.
Any your offers about DB structure are welcomed also.
iL said its best to rewrite oldgames.php from start so thats what were working on but still curious to see your code
Yes, i mean oldgames and ladder stats have common part for report parsing, that part is non-trival, so looks reasonable to use the same code for both projects.
Also would be much easier to read oldgames from DB when we upload data to it.