Forum

> > CS2D > General > Global saves
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Global saves

6 replies
To the start Previous 1 Next To the start

old Global saves

mrc
User Off Offline

Quote
I finished my Competitive script and I need to know if it's possible to make global saves. I have a VPS in North America and Europe, I would like to sync data (player stats/saves) between them. Is possible? Anybody can help me? They're both Linux (cmd).

IMG:https://i.postimg.cc/yYjP4LbH/download.png


IMG:https://cdn.discordapp.com/attachments/532962875619409920/558809398860840982/unknown.png
edited 4×, last 23.03.19 06:15:26 am

old Re: Global saves

DC
Admin Off Offline

Quote
I can't think of a super clever way to do this directly with CS2D alone. There is cs2d lua cmd reqhttp which could be used for communication with a webserver to exchange data but it might lead to lags.

When I had to do this I would probably use a third party application (or write one myself) which synchronizes data between the servers and which stores the data on local files.
All you would have to do in CS2D then is reading the data periodically. Like once every minute or something like that. And of course you would have to write new/changed data to files as well.

There are certainly applications already which can be used to send/synchronize files.

old Re: Global saves

mrc
User Off Offline

Quote
Hmm, it seems hard to do (for me). I'll make the saves regional then.Thanks anyway.

old Re: Global saves

Starkkz
Moderator Off Offline

Quote
@user DC: I haven't tested it, but does CS2D freeze when you call that function from Lua?

old Re: Global saves

DC
Admin Off Offline

Quote
How else would you call it? It's a Lua function
Also I didn't say that it freezes. I said it MIGHT lead to lags.

Maybe it only is a problem when you call it too often/frequently.
Clients use the same stuff for avatar download etc and that only caused lags for some people and for most it is okay when we don't run multiple parallel requests at the same time. Requesting a script / plain text is probably even less heavy and causes less lag.

old Re: Global saves

Quattro
GAME BANNED Off Offline

Quote
@user Hajt:
The guy can not write a script to assign random 5 numbers to teams and you tell him to write a simple php script, store data on mysql and use httpdata
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview