java Server
java Client
Format | Example | Feature |
---|---|---|
Text without any prefixes | Hello! | Broadcast a message |
Text with one slash as prefix | /login haha | Command |
Text with two slashes as prefix | //hi | Send preset message |
<message>
Everyone in the chatroom will receive a message like:
<username> say to all: <message>
/login <username>
Note:
- The username must be unique in a chatroom
- Whitespace is not allowed in a username
- All features are all unavailable before login
/to <username> <message>
Send <message>
to <username>
.
Note:
<username>
will receive<yourname> say to you: <message>
, you will receiveYou say to <username>: <message>
if sending succeed.- If
<username>
is not existed, you will receivedCan't find user <username>.
/history <begin_index> <end_index>
Note:
begin_index
andend_index
is optional. If they are empty, all chatting history will be printed.
/who
Display all online users.
Preset Command | Message |
---|---|
//hi |
Hi, everyone! I'm coming! |
//smile |
There is a smile on <yourname>'s face |