Raised This Month: $12 Target: $400
 3% 

Saving/Loading data into/form the file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
milutinke
AlliedModders Donor
Join Date: Jun 2012
Location: Serbia
Old 01-13-2019 , 09:45   Saving/Loading data into/form the file
Reply With Quote #1

Hello everyone.
I am working on one mode, which has levels and user preferences.
I would like to provide multiple ways for data saving/loading.
Currently, I have SQL Lite and MySQL support.
But I would like to include the option to be able to store data in the file locally.
The data saving is happening on every level up and death.
I am interested in using this and incorporating it to the Source Mode as a module.

So do you think that it is a good idea to do this?

PS: NBT is cool, there are multiple editors for it on the internet.

Last edited by milutinke; 01-13-2019 at 11:48.
milutinke is offline
Send a message via Skype™ to milutinke
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-13-2019 , 10:15   Re: Saving/Loading data into/form the file
Reply With Quote #2

SQLite is a local file.
__________________
asherkin is offline
milutinke
AlliedModders Donor
Join Date: Jun 2012
Location: Serbia
Old 01-13-2019 , 11:45   Re: Saving/Loading data into/form the file
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
SQLite is a local file.
Yes, but I would like to save the data about each player in a separate file.
Would this make lag, because the files are read sequentially for each player?
I've never messed around with the files as the databases.

Last edited by milutinke; 01-13-2019 at 11:47.
milutinke is offline
Send a message via Skype™ to milutinke
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-18-2019 , 12:18   Re: Saving/Loading data into/form the file
Reply With Quote #4

It depends. How ofthen you save. How much data and so.

You could use KeyValues format file, so you don't need to create separate file for each player.
https://sm.alliedmods.net/new-api/ke...s/ExportToFile

Or you could store data in Cookies on client's side.
https://sm.alliedmods.net/new-api/cl...etClientCookie
https://sm.alliedmods.net/new-api/cl...tCookiesCached
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-18-2019 , 12:41   Re: Saving/Loading data into/form the file
Reply With Quote #5

Quote:
Originally Posted by Dragokas View Post
Cookies aren't stored on the client side, they're stored in an SQLite database on the server.
__________________
asherkin is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-18-2019 , 13:17   Re: Saving/Loading data into/form the file
Reply With Quote #6

lol, thank you.
So, what is actual identity binding for cookies based on?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-19-2019 , 08:36   Re: Saving/Loading data into/form the file
Reply With Quote #7

Steam ID probably.
__________________
klippy is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-20-2019 , 14:26   Re: Saving/Loading data into/form the file
Reply With Quote #8

I advise you to use clientprefs for preferences, and SQLite ( or MySQL if you want multi-server integration ) for levels ( EXP )
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Reply


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 19:29.


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