Limitations on Message Service for a passive resource maker

In my game, if a player has a plot and a building that can create a passive income, every 300 seconds it will increase and also a player has a chest where they can store items and it will save.
The issue is, I’m really struggling to find a way of safely doing this and I decided to try and use message service when updating the chests, so when a player. Each province has between 20-100 plots and it’s obvious that this wont work out with message service as it will be at most 20-100 subscriptions.

I’ve been also trying to make sure that no one can abuse crossing servers for their passive income or chest inventory. These are all stored and are saved around every 120 seconds, but because the scale of my game, it will end up getting abused by people going on a 2nd server by blocking someone on the server, joining a new one and getting their not updated loot on the other server. And also, if there are multiple servers we face the problem of multiple passive incomes firing off on their own (I have fixed that with checks and message service, it works fine as of now). I’m a decent scripter but this stuff is getting out of hand! I’m thinking of alternatives such as external servers but I’m very reluctant to do that. What would be my options?

image
This is the set up at the moment for the UI and is in early creation, everything works if it was just ONE server, but if there is two or more that’s where the issue is.

I would greatly appreciate any help :smiley:

1 Like

What are you trying to do exactly? I can’t see why you’re using Message Service and what you’re using it for. It doesn’t seem like you’re using Message Service for the passive income generation. So are you using it to allow players to use a chest across different servers?

If you don’t mind, what’s the end result you’re hoping to achieve?

sorry i don’t think i made myself clear. the main reason is message services for the player’s chests. i’ve just been playing around with message services for the passive income as messageservice is new to me, as if there is multiple servers, every 300 seconds it should increase to all servers instead of it being inconsistent (e.g one server is 3.4 and the other is 4.4).

I’m trying to use message service to update the player’s chest when they press the confirm button, it will update the server, and then send a lil JSONencoded data packet (a few tables and other information) that will then check if its the same server, if it is then it will ignore, if its not the same server it will then update the inventory. I’ve made it so each plot has its own individual subscribe async, but now I’ve researched it maybe having 1 async to subscribe to would work and it would just check if its the same plotID.

Right now I’m just looking for alternatives or how to finetune the system.

Hope that makes it a bit easier to understand what I’m trying to say

I’m pretty conflicted here as a system to do this is relatively easy to do but limitations 100% need to be taken into consideration.

I would recommend 1 subscribe per server and use a ‘Tree’ method for figuring out the plot.
Pretty much the server gets the request to change PlotId of ProvinceId to X and you can just keep going down the tree until you reach the data you need to change.

The problem with that is limits.
I thought of MemoryStores at first but MessagingService has better limits when it comes to sending data and their data size limit is the same(technically).
Using MessagingService also means that data is updated as soon as a server sends it out.

Side note for a UI in ‘early creation’ it looks really good

1 Like

Ok that sounds good I’ll have a try! Not trying to push for an answer, but for the passive income/resource maker, how would I try and safely do that? I’ve been playing around with the system for the passive income, and I’ve done a check system that if they receive it, it will check a os.time value called last_change, the last time it was updated and if it was more than 299 seconds ago, it will update and NOT add (e.g server 1 updates and it is 4 resource (in this instance its cabbage from the farm), every server will get 4 cabbage and not their cabbage + 4. But I feel like that’s a bit finnicky and not even accurate (its hard to test this!!). What would be the most ideal concept for the system? A priority server potentially?

Also thanks for the feedback for the UI!!

1 Like

I don’t really know the in’s and out’s of your system so I can’t really give any solid answers about how your passive income system should work.

What I can say is that a priority server is pretty much useless(And it is in most cases) here since whenever your server or the player makes a change it just tells the other servers ‘hey I did this thing’ and then they do that thing which is they way you should go about it.

1 Like

Oh thanks, I’m just over complicating it, I should just make it so it resets the 300 seconds clock as soon as 1 server gets the update and I’ll work around that :smiley:

Thanks for the help.