diff options
| author | Jakob Fries <jakob.fries@gmail.com> | 2007-07-29 22:56:25 +0000 |
|---|---|---|
| committer | Jakob Fries <jakob.fries@gmail.com> | 2007-07-29 22:56:25 +0000 |
| commit | 8bfaea274e735a2f5331e6b76501299d29681c68 (patch) | |
| tree | d0e5911f8c609b883ea2cf988b92c541a4f6a3af /src/game/client | |
| parent | 3cbaf193c7edc31eedb23ba298341367df41128f (diff) | |
| download | zcatch-8bfaea274e735a2f5331e6b76501299d29681c68.tar.gz zcatch-8bfaea274e735a2f5331e6b76501299d29681c68.zip | |
join and quit messages
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/game_client.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index ff212006..0fd93972 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -411,6 +411,13 @@ void chat_add_line(int client_id, const char *line) sprintf(chat_lines[chat_current_line].text, "%s: %s", client_datas[client_id].name, line); // TODO: abit nasty } +void status_add_line(const char *line) +{ + chat_current_line = (chat_current_line+1)%chat_max_lines; + chat_lines[chat_current_line].tick = client_tick(); + strcpy(chat_lines[chat_current_line].text, line); +} + struct killmsg { int weapon; @@ -1808,4 +1815,18 @@ void modc_message(int msg) killmsgs[killmsg_current].weapon = msg_unpack_int(); killmsgs[killmsg_current].tick = client_tick(); } + else if(msg == MSG_JOIN) + { + int cid = msg_unpack_int(); + char message[256]; + sprintf(message, "%s joined the game", client_datas[cid].name); + status_add_line(message); + } + else if(msg == MSG_QUIT) + { + int cid = msg_unpack_int(); + char message[256]; + sprintf(message, "%s quit the game", client_datas[cid].name); + status_add_line(message); + } } |