Translate "heads" and "tails" of gameServer
authorWuzzy <Wuzzy2@mail.ru>
Sat, 01 Sep 2018 00:17:56 +0200
changeset 13735 5f62417a7d84
parent 13734 f4c8c6a174e8
child 13736 2fa83c3e9f09
Translate "heads" and "tails" of gameServer
gameServer/Actions.hs
gameServer/Consts.hs
--- a/gameServer/Actions.hs	Sat Sep 01 00:05:55 2018 +0200
+++ b/gameServer/Actions.hs	Sat Sep 01 00:17:56 2018 +0200
@@ -733,9 +733,9 @@
 
 
 processAction (Random chans items) = do
-    let i = if null items then ["heads", "tails"] else items
+    let i = if null items then [loc "heads", loc "tails"] else items
     n <- io $ randomRIO (0, length i - 1)
-    processAction $ AnswerClients chans ["CHAT", nickRandom, i !! n]
+    processAction $ AnswerClients chans ["CHAT", if null items then nickRandomCoin else nickRandomCustom, i !! n]
 
 
 processAction (LoadGhost location) = do
--- a/gameServer/Consts.hs	Sat Sep 01 00:05:55 2018 +0200
+++ b/gameServer/Consts.hs	Sat Sep 01 00:17:56 2018 +0200
@@ -47,8 +47,11 @@
 nickServer = "[server]"
 
 -- For /rnd command
-nickRandom :: B.ByteString
-nickRandom = "(random)"
+nickRandomCoin :: B.ByteString
+nickRandomCoin = "[random]"
+
+nickRandomCustom :: B.ByteString
+nickRandomCustom = "(random)"
 
 -- For /global command
 nickGlobal :: B.ByteString