-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add recently introduced events, name and explosion/projectile checking (
#588)
- Loading branch information
Showing
4 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- checks if a player nickname is valid in terms of length and ascii chars | ||
function isPlayerNameValid(strPlayerName) | ||
if(not strPlayerName) then return false end; | ||
if(not tostring(strPlayerName)) then return false end; | ||
if(#strPlayerName == 0) then return false end; | ||
if(#strPlayerName > 22) then return false end; | ||
|
||
for i = 1, #strPlayerName do | ||
local strChar = strPlayerName:sub(i, i); | ||
local iCharByte = strChar:byte(); | ||
|
||
if(iCharByte < 33 or iCharByte > 126) then return false end; | ||
end | ||
|
||
return true; | ||
end |