? Best moments to save player's data

Started by Sebastian, May 28, 2017, 04:52 PM

Previous topic - Next topic

KAKAN

Quote from: Doom_Kill3R on May 28, 2017, 10:18 PM
Quote from: . on May 28, 2017, 08:10 PM
Quote from: Doom_Kill3R on May 28, 2017, 07:28 PM...Then just remember to fix your broken scripts so it doesn't crash.

What if the server itself crashes? Not something rare here.

It doesn't crash itself. Atleast mine doesn't.
As far as I'm concerned, the official squirrel plugin has some memory releasing issues, which might crash your server in Linux OS, since it loves memory and doesn't let you harm it. But, ofcourse, it limits to how many timers you're using and how often you're creating and deleting them( I guess the problem lies there. )
oh no

Mötley

#16
Sort and compare while a player is on the server, Find a safe way to store the players original data without needing to open the database.

This way if a player has a update of five kills, 3 additional deaths, and some other changed data you could save it every five minutes. Or whatever you desire while looping through the accounting data



Not fully recommending it but..
You could mix something like hashes or ini, If ini use the players password as the bracket, not the name due to clan tags breaking ini. This way you could have a debug log of accounts at all times.

Then you could do some command to sort and compare the database to the debugged log 'ini/hashes' of the accounts. You could find out if anything was fucked. If not just clear the file. No reason to make the server loop through a lot of data.

You could do that in any safer method.
Just putting thoughts out.

Sort and compare is what I typically do, If there are no changes why do anything.

aXXo

From my practical VCMP experience, I'd recommend not to bother too much about script/server lag. The average VCMP player lags like shit, so if there is a lag issue, the bottleneck is his own Internet connection/PC.

I've seen scripts writing data in a loop every second, with 20+ players online. No complains about lag(EAD).
In Vicewar, I INSERT'ed every kill straight to MySQL. The event had 25k kills in 24 hours with 45 players average online. Players were so busy FPS lagging, that no-one complaint about script lag(if any).

Cool

Quote from: aXXo on Jun 02, 2017, 09:58 PMFrom my practical VCMP experience, I'd recommend not to bother too much about script/server lag. The average VCMP player lags like shit, so if there is a lag issue, the bottleneck is his own Internet connection/PC.

I've seen scripts writing data in a loop every second, with 20+ players online. No complains about lag(EAD).
In Vicewar, I INSERT'ed every kill straight to MySQL. The event had 25k kills in 24 hours with 45 players average online. Players were so busy FPS lagging, that no-one complaint about script lag(if any).
AXXO you are wrong Vicewar script was lagging like hell

Xmair

Quote from: CoolAXXO you are wrong Vicewar script was lagging like hell
Says the one with 300 ping.

Credits to Boystang!

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

KAKAN

Quote from: Cool on Jun 03, 2017, 01:12 AMAXXO you are wrong Vicewar script was lagging like hell
Ever checked your packet loss?

Quote from: aXXo on Jun 02, 2017, 09:58 PMFrom my practical VCMP experience, I'd recommend not to bother too much about script/server lag. The average VCMP player lags like shit, so if there is a lag issue, the bottleneck is his own Internet connection/PC.

I've seen scripts writing data in a loop every second, with 20+ players online. No complains about lag(EAD).
In Vicewar, I INSERT'ed every kill straight to MySQL. The event had 25k kills in 24 hours with 45 players average online. Players were so busy FPS lagging, that no-one complaint about script lag(if any).
Agreed.
oh no

DizzasTeR

I recently moved to @aXXo 's method as well. Just update everything into mysql whenever its needed. I don't know if it has any issues with SQLite.

.

#22
Quote from: Doom_Kill3R on Jun 03, 2017, 11:35 AMI don't know if it has any issues with SQLite.

The only time you'll have issues with that are on servers from providers that oversell their services. I've seen these to go so slow to the point where you read with a few kb/s from their storage. My internet connection had faster speeds. So yeah, in those cases, your server is going to lag regardless of where you decide to save.

Which is why you should look for server providers with SSD storage. Regardless of how little storage they provide. Because you need speed not space. For example, on my VPS I get around 1 gb/s R/W speeds (probably some NVMe sh!t). Obviously I can save wherever and whenever I want.

Or, I've seen people using MySQL databases on remote servers. Basically, they send their stuff to a remote MySQL server via a TCP connection. So on top of the disk lag you also add the network lag. And then come here and complain their servers are slow af.

And I haven't even started the on sh!tty code that some people write. Creating timers that run every frame or listening to player/vehicle movement events and doing various useless computation there. I've seen people doing database queries and then checking if they actually needed to do that database query. I was like: wtf?

When you save your data, has an insignificant role compared to the significance of writing efficient code and designing the database in a way that allows you to distribute the workload evenly throughout the runtime of a server. Stop chasing butterflies people. This isn't the bottleneck you're looking for.

Basically, what I'm trying to say is that where and how you save the data plays a much bigger role then when you save it.
.