#1

Hi it'is possible,

To read a specif thing from all users files? like in mysql are select name from players where XP='5000'
Reply
#2

It is possible, but not very time efficient. You can use a for loop to get the username of all the characters online and checking all their files for that stat. However, if you wish to do it for every single user regardless if they are offline then you would have to make an index file which will basically save the stats of all users in one file as they log off. For example if you had John_Smith and Jane_Smith playing your sever when they log off don't write their stats to only their file but have it append a line on a txt file.

John_Smith 10000 10000 1
Jane_Smith 500 345 2
Other Player 430 343 1

then by optimizing sscanf and a string array you can search the stats for the specific numbers you want. However I would just recommend switching your server to some sort of database because they work alot better. Unlimited hosting cost like $3 a month, and you can just use a remote sql database from their for your server if you dont want to do all that setting up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)