Skip to content

Commit

Permalink
now using the pipe symbol in the messages sent to symbolize a carriag…
Browse files Browse the repository at this point in the history
…e return
  • Loading branch information
SuperFola committed Jul 20, 2021
1 parent 3a88ac2 commit 33dc9bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ decoded=$(echo "$message" | base64 -d)
FinalDate=$(date -u +"%s.%N")
elapsed=$(date -u -d "0 $FinalDate sec - $StartDate sec" +"%S.%N")
echo "Received in $elapsed seconds"
echo "$decoded"
echo "$decoded" | tr "|" "\n"
23 changes: 11 additions & 12 deletions src/chatserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
USER_LIMIT = 1000
MAX_MESSAGES_AT_ONCE = 25

ERROR_UNKNOWN_USERTAG = """ERROR The given usertag is unknown to the system.
Please request a new one from the system with:
ERROR_UNKNOWN_USERTAG = """ERROR The given usertag is unknown to the system.|
Please request a new one from the system with:|
|
/register word"""
ERROR_NOT_REGISTERED = """ERROR It appears that you're not identified.
You need to request a usertag through /register word,
then identify when sending commands and messages with:
@usertag your command/message goes here"""
ERROR_TOO_MANY_USERS = """ERROR Too many users are currently logged in.
This mecanism exists to prevent the demo server from
out of memory errors.
ERROR_NOT_REGISTERED = """ERROR You're not identified.|
You need to request a usertag with '/register tag',|
then identify when sending commands and messages with:|
@usertag message here"""
ERROR_TOO_MANY_USERS = """ERROR Too many users are currently logged in.|
This mecanism exists to prevent the demo server from|
out of memory errors.|
Please try again later."""


Expand Down Expand Up @@ -92,7 +91,7 @@ def consult(self, args: List[str]) -> str:
break
i += 1

return "\n".join(out)
return "|".join(out)

def check_command(self, msg: str, ip: str) -> str:
msg = msg.strip()
Expand Down

0 comments on commit 33dc9bf

Please sign in to comment.