gameServer/Utils.hs
changeset 11575 db7743e2fad1
parent 11265 35e359585dea
child 11838 8f730ba4ca3c
--- a/gameServer/Utils.hs	Wed Feb 24 22:37:03 2016 +0300
+++ b/gameServer/Utils.hs	Thu Feb 25 23:17:52 2016 +0300
@@ -241,3 +241,8 @@
 deleteFirstsBy2          :: (a -> b -> Bool) -> [a] -> [b] -> [a]
 deleteFirstsBy2 eq       =  foldl (flip (deleteBy2 (flip eq)))
 
+sanitizeName :: B.ByteString -> B.ByteString
+sanitizeName = B.map sc
+    where
+        sc c | isAlphaNum c = c
+             | otherwise = '_'