Raised This Month: $ Target: $400
 0% 

saving things & possible data lost & cpu usable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
f55z55p
BANNED
Join Date: Sep 2012
Old 09-22-2012 , 13:50   saving things & possible data lost & cpu usable
Reply With Quote #1

Hello, Im having a questions about saving things.
I want to make new rank systems.
Rank are saved into playerdatabase.dat and inside of file will be
Quote:
// player 1
password: xxxxxxxx
name: xxxxxxxx
ip: xxx.xxx.xxx.xxx
rank: xxx xx x x xxx xx xxxx xx xx
grXP: x

// player 2
password: xxxxxxxx
name: xxxxxxxx
ip: xxx.xxx.xxx.xxx
rank: xxx xx x x xxx xx xxxx xx xx
grXP: x

// player 3
password: xxxxxxxx
name: xxxxxxxx
ip: xxx.xxx.xxx.xxx
rank: xxx xx x x xxx xx xxxx xx xx
grXP: x
...
// player x text will not be, it was just for example.
I have nice idea for new saving opportunity
if player connects, read setinfo xindex, xindex is line what show where player data are located in playerdatabase.dat
so we dont need to check all lines one by one.
but as i noticed that saving stuff inside the file takes alot of cpu.

Q1: is this good idea to save player rank every time when something happen (example if player shot or make dmg) or mayby i keep data in variables till player disconnects and then save data?

Q2: if i save data only then when player disconnects then is there any chance that some(or all) data will be lost and not saved.

Q3: if the database file goes to big like 100k lines ( because every player bring 16 new lines with his data ) then reading that big file ( even when line is known ) will cost more cpu usable?

Q4: what is maximum col in one line what can be


I am very sure that you wanna ask me now that why the hell you dont use nvault or mysql.
answer: mysql can be slow sometimes, nvault i think reading stuff from there cost large cpu usable ( if nvault file is very big )

I hope that you find a time to reply my questions, i will be very grateful.
Thanks!

Last edited by f55z55p; 09-22-2012 at 13:52.
f55z55p is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode