In my game, I have a custom private server system. For ease of use, all servers are assigned a random, 5 character code. You can use that code to join servers directly.
Can I get in trouble if the generated code ends up being inappropriate?
Here is my code:
function makeCode()
local code = ""
local min, max = ("a"):byte(), ("z"):byte()
for i = 1, 5 do
code ..= string.char(math.random(min, max))
end
code = string.upper(code)
return code
end
There are bad words that are 5 characters long, so Im wondering if I should filter this somehow? Dont know if thats a good idea though, since the filter system would probably filter every other code for no reason.
I’d recommend using six digit numbers instead as they are relatively easy to remember/type, there are one million unique combinations of them and they would not be considered inappropriate.