English Global saves

6 replies
Goto Page
To the start Previous 1 Next To the start
23.03.19 12:35:18 am
Up
mrc
User
Offline Off
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
CS2D Global Community @ www.discord.gg/gvbtd6j
23.03.19 11:16:21 am
Up
DC
Admin
Offline Off
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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
23.03.19 06:21:26 pm
Up
mrc
User
Offline Off
Hmm, it seems hard to do (for me). I'll make the saves regional then.Thanks anyway.
CS2D Global Community @ www.discord.gg/gvbtd6j
23.03.19 08:14:00 pm
Up
Starkkz
Moderator
Offline Off
@user DC: I haven't tested it, but does CS2D freeze when you call that function from Lua?
lol
23.03.19 08:48:24 pm
Up
DC
Admin
Offline Off
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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
24.03.19 09:50:47 am
Up
Hajt
User
Offline Off
Write simple PHP script to read/save data from MySQL, put it on webhosting. Later in your lua use cs2d lua cmd reqhttp to send HTTP request to that script, and cs2d lua hook httpdata hook to receive results...

Lately I used this to make live ranking for my super hero server.
https://cs2d.tk/index.php?page=superhero
edited 1×, last 24.03.19 10:11:12 am
27.03.19 10:05:34 pm
Up
Quattro
User
Offline Off
@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