AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Saving/Loading data into/form the file (https://forums.alliedmods.net/showthread.php?t=313549)

milutinke 01-13-2019 09:45

Saving/Loading data into/form the file
 
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.

asherkin 01-13-2019 10:15

Re: Saving/Loading data into/form the file
 
SQLite is a local file.

milutinke 01-13-2019 11:45

Re: Saving/Loading data into/form the file
 
Quote:

Originally Posted by asherkin (Post 2634509)
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.

Dragokas 01-18-2019 12:18

Re: Saving/Loading data into/form the file
 
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

asherkin 01-18-2019 12:41

Re: Saving/Loading data into/form the file
 
Quote:

Originally Posted by Dragokas (Post 2635330)

Cookies aren't stored on the client side, they're stored in an SQLite database on the server.

Dragokas 01-18-2019 13:17

Re: Saving/Loading data into/form the file
 
lol, thank you.
So, what is actual identity binding for cookies based on?

klippy 01-19-2019 08:36

Re: Saving/Loading data into/form the file
 
Steam ID probably.

eyal282 01-20-2019 14:26

Re: Saving/Loading data into/form the file
 
I advise you to use clientprefs for preferences, and SQLite ( or MySQL if you want multi-server integration ) for levels ( EXP )


All times are GMT -4. The time now is 23:36.

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