This can be done as already mentioned by someone here with Sanity Checks, Sanity Checks is such a fancy word for checking. For anyone that is confused into what Sanity Checks are, it’s in simple terms checking the values in the server. Here is more about Sanity Checks :
Checking your variables to see if they’re sane
Jokes aside, you’re checking whether the values of your variables are sensible and/or expected. For example:
I have this client script:
showMessage("Type a number between 1 and 5")
doSomeStuff(getNumberTyped())
The expected value is between 1 and 5, so we do a sanity check to verify the number is, indeed, between 1 and 5:
local function doSomeStuff(number)
if typeof(number) == "number" and number >= 1 and number <= 5 then…
Defensive programming is a form of defensive design intended to develop programs that are capable of detect potential security abnormalities and make predetermined response. It ensures the continuing function of a piece of software under unforeseen circumstances. Defensive programming practices are often used where high availability, safety, or security is needed.
Defensive programming is an approach to improve software and source code, in terms of:
Overly defensive programming, however, may ...
2 Likes