Prossesing 40 data saves for a players account

Started by Mötley, Aug 16, 2016, 12:12 AM

Previous topic - Next topic

Mötley

Okay topic says it all, I have went a little over board on a server within the last 14 hrs and I am a little stumped on how to save the data.



I would like to port the first server somewhere in September.

If someone could help me in some logic of what I should do that would be amazing, I intended to use sq-lite
"Was using sq-lite :P but theres to much data to process into the accounts, so in other terms I kept scripting".

Thijn


KAKAN

Quote from: Thijn on Aug 16, 2016, 05:44 AMSo, what do you need help with?
that's what I thought.
I think he needs help with "When shall I save the player's stats? While the player leaves or using an timer?"
oh no

Xmair

Save them when a player quits, but saving them with a timer is not a bad idea.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mötley

#4
What I need help with is how should I even save all of this data. I'm not that great with sq-lite and or never really adventured to having this much data to save to a sq-lite table. With that I really do not think it sounds professional to save all of this data to on table.

DizzasTeR

Here's the big deal, using a class won't hurt you. Just try to avoid getting data again and again from file ( sqlite db or whatever you're using )

Then comes the saving part, again it doesn't matter, just save all of these statistics once for each player when he leaves.

Mötley

But is it normal to save all of this to one table? I'm actually using arrays xD, no class.
A class is nothing but a fancy class defined in squirrel.
I know everything about accounting but all of this plus passwords and much more to one table? I might have 80 to near 100 by September that I need to save and something tells me I should have more than one table, maybe I am wrong and that's why I need guidance @Doom_Kill3R

DizzasTeR

Quote from: Mötley on Aug 16, 2016, 12:56 PMA class is nothing but a fancy class defined in squirrel.

Lies, lies, lies! Its a powerful thing, use it accordingly. Make a proper class with member vars to hold all of those statistics for your player specifically, also create a member save function which you can call every time a player leaves, which saves all that information no matter if its 40 or 100.

Mötley

sq-lite in vcmp can handle that many saves to one table?

Either way I prefer arrays :) just a personal preference. It's just clearing all of them ;D

KAKAN

Quote from: Mötley on Aug 16, 2016, 01:03 PMsq-lite in vcmp can handle that many saves to one table?
Yep, it can. There's a nice topic which gave some benchmarks on it. It's on the tutorial section.

Quote from: Mötley on Aug 16, 2016, 01:03 PMEither way I prefer arrays :) just a personal preference. It's just clearing all of them ;D
Then there will be many arrays in the global root table. Then your system will slow down.
:edit: Here's the link to the benchmarks: http://forum.vc-mp.org/?topic=444.msg2964#msg2964
oh no

aXXo

Splitting data into different tables would be better for your own sanity. Horizontal scrolling is the work of the devil.

Mötley

It's just a preference, That I prefer working with, I use methods that I prefer as I want a source that's super easy to update.
Player.WantedLevel = Wanted[ Player.ID ]; Level[ Player.ID ]Compared to
Player.WantedLevel = Class[ Player.ID ].WantedClass[ Player.ID ].Level


I will consider using more than one table.
Many other reasons like ban-list, To even just passwords.

To possibly being capable of uploading stats.

Mötley

Well after a lot of decisions I thought It would be in my best interest to 'Stay Away' from sq-lite at this time as I am growing way to much '50++ values now' in this server, and to use sq-lite for some fancy browser is a little outrageous.

Sq_lite will come one day, but for all I am concerned sq lite is nothing but a fancy browser, and in squirrel we get a fancy plugin to view players data in a browser rather than on file. with the ability to upload stats for others to eye fuck other peoples accounts, nothing more, nothing less, So I will attempt to allow others to do this to other players accounts, just not at this time.

Reverting back to methods I used way long ago ;)

DizzasTeR

You still can't deny the fact that SQ Lite is alot more better than INIs, atleast in VCMP's environment.

Mötley

#14
No difference. I have worked with ini a lot in the past as well ugly hashing.

With saying that ini has the simplest architecture to work with. Works as good as sqlite 'as long as you know what your doing'.

Ini you don't have to deal with the hassle that sq lite has. Ini is super light weight. Yet easy to play with when using arrays. Personally I recommend ini over sq lite when building a server.

I have someone that I might re-hire to upgrade the system in a year to sq lite as I don't have time to fool with it. There's way to much scripting I have to do.

If sq lite was hassle free I would recommend it.

I'm now at 60 values that needs to be saved to an account. The values and script is getting big "10,549 script lines" weapons have been removed due to too many freaking values.


If there was an xml plugin I would probably $hi! my pants you know how much fun an xml account system would be?

I'm not hating on sq lite I'm sure it sure does sound like it, I just do not have the time for it, I'm sure others could agree when you have a massive script thats in a alpha stage,.