Skip to content

Commit

Permalink
can now report on bots
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoGomesNegri committed Nov 2, 2021
1 parent 811e4f3 commit ac9aa30
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,26 @@ parsePlayer = do
name <- between (char '\"') (char '\"') (many1 $ noneOf "\"")
white
steamid <- parseUntilX ' ' anyChar
white
minutes <- anyNumSep ':' :: Parsec String () Int
seconds <- anyNum
white
let time = (minutes * 60) + seconds
ping <- anyNum
white
loss <- anyNum
white
connState <- parseUntilX ' ' anyChar
white
adr <- parseUntilEof
return $ Player {name = name, steamid = steamid, ping = ping, loss = loss, connectionStatus = connState,
playerAdress = adr, time = time, userid = numId}
if steamid /= "BOT" then do
white
minutes <- anyNumSep ':' :: Parsec String () Int
seconds <- anyNum
white
let time = (minutes * 60) + seconds
ping <- anyNum
white
loss <- anyNum
white
connState <- parseUntilX ' ' anyChar
white
adr <- parseUntilEof
return $ Player {name = name, steamid = steamid, ping = ping, loss = loss, connectionStatus = connState,
playerAdress = adr, time = time, userid = numId}
else do
white
state <- parseUntilEof
return $ Player {name = name, steamid = "BOT", ping = 0, loss = 0, connectionStatus = state, playerAdress = "localhost", time = 0,
userid = numId}

withToken :: (Token -> Connection -> ActionT Text WebM ()) -> ActionT Text WebM ()
withToken f = do
Expand Down

0 comments on commit ac9aa30

Please sign in to comment.