--- a/gameServer/HWProtoCore.hs Mon Mar 28 20:30:15 2011 +0400
+++ b/gameServer/HWProtoCore.hs Mon Mar 28 20:31:01 2011 +0400
@@ -43,6 +43,7 @@
handleCmd_loggedin ["INFO", asknick] = do
(_, rnc) <- ask
maybeClientId <- clientByNick asknick
+ isAdminAsking <- liftM isAdministrator thisClient
let noSuchClient = isNothing maybeClientId
let clientId = fromJust maybeClientId
let cl = rnc `client` fromJust maybeClientId
@@ -55,13 +56,14 @@
if teamsInGame cl > 0 then "(playing)" else "(spectating)"
else
""
+ let hostStr = if isAdminAsking then host cl else cutHost $ host cl
if noSuchClient then
return []
else
answerClient [
"INFO",
nick cl,
- B.concat ["[", host cl, "]"],
+ B.concat ["[", hostStr, "]"],
protoNumber2ver $ clientProto cl,
B.concat ["[", roomInfo, "]", roomStatus]
]
--- a/gameServer/Utils.hs Mon Mar 28 20:30:15 2011 +0400
+++ b/gameServer/Utils.hs Mon Mar 28 20:31:01 2011 +0400
@@ -124,3 +124,6 @@
case B.readInt str of
Just (i, t) | B.null t -> fromIntegral i
_ -> 0
+
+cutHost :: B.ByteString -> B.ByteString
+cutHost = B.intercalate "." . flip (++) ["*","*"] . List.take 2 . B.split '.'