It's New Year's Day in Stack Exchange land...
A distinguishing characteristic of these sites is how they are moderated:
We designed the Stack Exchange network engine to be mostly self-regulating, in that we amortize the overall moderation cost of the system across thousands of teeny-tiny sli...
Does anyone has tipps on how to deal with following situation ? My mobile online game is in a closed alpha... players can build structures ( towers for example )... The world consists of many chunks...
when someone builds a structure i calculate the chunk and i add that structure to the chunk structures list... i also add that structure to a list of buildings which needs to be saved... the same happens with the chunk... every minute i run over those lists to save them all into my sql tables... the problem is after a few hours i always get foreign key exceptions... which means when trying to save a structure, it didnt found the chunk to which it belongs to...
that triggers the sql exception... im investigating my code since days and i cannot find the issue... how would you deal with that ?
user92578
5:15 PM
What could invalidate/remove a chunk from the table?
user92578
Is the saving code multithreaded, could the structures be added after the chunks?
user92578
The only real debugging idea for that I have is really extensive logging, on everything that has to do with chunks and structures
Thats it lol... nothing... theres no way to remove a chunk currently :/ Im using Smartfoxserver... i created a class which uses one thread with a timer, this class has multiple concurrent HashMaps to store the data that should be saved... that timer gets called once a minute and well, loops over the concurrent maps to save that stuff in the database..
. i basically dont do a insert for each entry, i loop over them to create a gigantic mysql query to insert them all in one insert command... is that a good idea btw ? ^^