[Open Source] Server Up-To-Date Checker that doesn't use MessagingService or DatastoreService!

Hello! Recently, I’ve found it necessary to create a module that checks the version of the current game and place to see if the server is running on the latest update of the game. This module is completely open-sourced, and doesn’t rely on DatastoreService or MessagingService to accomplish it’s goal. Below is an example usage of it:

local m = require(path.to.module)

m:SetCheckFrequency(3)

m.PlaceUpdated:Connect(function(date)
  warn("Place has updated. ii repeat, place has updated!!!")
  -- I recommend disconnecting this event if 
  -- you only want to receive the information once, as this 
  -- will fire with every update!
end)

m.Activate()

Now I published, went into the live game and opened the Developer Console, and published again. Here is my output.

Documentation:

Catalog link:

No credit is required, but please show me creative ways you managed to use my module! Thanks!

32 Likes

Wow. I am going to use this for a system that will make a message pop-up on an admins screen asking them if they want to shutdown all servers, or just the current.

3 Likes

This seems unnecessarily complicated. You should just make two functions and two signals for game and place updating.

Other than that, this is a nice module with many applications.

Some games, like my game Midnight Vibe, have different “districts” you can traverse. Each district has it’s own place. If you wanted to see if there was a new update to the entire game, you’d use the game signal. If you wanted to see if there was an update to just that particular district, you’d use the place signal.

That’s just one application. There are plenty of games that update only particular places in their game at a time, and this would benefit them.

I believe we misunderstood each other.
To clarify, I was talking about the :Activate() functions, I was suggesting you only need a function and a signal for place updated and game updated.

Activate turns on the module. As it’s a module script, it can’t run without external help. There is only one Activation function, and one Deactivation function. I’m confused on how I could make it any simpler. Sorry.

If you could, give me a pseudo-code example on what you think would be easier to understand. Thanks!

I thought the module could just execute activate upon require? Unless there is some limitation I can’t remember.

require() allows whatever was returned from the ModuleScript to be referenced. My module returns a table. Check out how ModuleScripts are typically organized here.

Yes, I’m asking why can’t you initialize the module before the return?

You can run code within a module script as well. Whenever it is required, the code will run. For example:

local module = {1,2,3,4,5,"test"}

print("module loading")

return module

It will return the table, but it will also run the print function. What @OminousVibes0 is saying is that the :Activate() method is useless in the case that you can just run code inside the module.

Either way it will have the same result, but having an initialize method is just an extra unnecessary step.

1 Like

Okay. I like having the ability to turn the module on or off, so I’m not going to change the module. It’s just one extra line of code so I don’t think it matters in the slightest. Thanks for the suggestion though, you’re welcome to change the module yourself if you see fit.

I don’t have any issue with it. I was just explaining what it seemed you were not understanding from havoc’s suggestion.

1 Like

I only found this recently and it’s really cool! I made a text label that changes whether the game is up to date or not. I’ll show some pictures below.

image
image

Thanks for making this it’s really cool! :heart:

2 Likes

does this still work in 2022? I think mine is broken lool.

1 Like

it still works as of 2023/4/20 for me:

local m = require(game.ReplicatedStorage.VersionChecker)
m.Activate()
local label = script.Parent
local value = m:IsPlaceUpToDate()
while true do
	value = m:IsPlaceUpToDate()
	task.wait(5)
if value == false then
	if label then
		label.Text = "Server is out of date"
			label.TextColor3 = Color3.new(1, 0, 0)
			break
	end
	end
	if value == true then
		if label then
			label.Text = "Server is up to date"
			label.TextColor3 = Color3.new(0.333333, 1, 0.498039)
		end
	end
	end