summaryrefslogtreecommitdiffstats
path: root/src/server/ChatRoom.cpp
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2020-12-13 18:39:20 +0000
committerJoursoir <chat@joursoir.net>2020-12-13 18:43:07 +0000
commita5d15a716f6e7e21a67529478f77851d15defe09 (patch)
treed7367c2348da277cde02224b7e32ea05579915ea /src/server/ChatRoom.cpp
parentf27143165f1f3c2e47aaa65c4da24875e1639ceb (diff)
downloadwant-chat-a5d15a716f6e7e21a67529478f77851d15defe09.tar.gz
want-chat-a5d15a716f6e7e21a67529478f77851d15defe09.tar.bz2
want-chat-a5d15a716f6e7e21a67529478f77851d15defe09.zip
changes in work spec-symbols have done; server: send info about online and players
Diffstat (limited to 'src/server/ChatRoom.cpp')
-rw-r--r--src/server/ChatRoom.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/ChatRoom.cpp b/src/server/ChatRoom.cpp
index 9d99251..f3efe96 100644
--- a/src/server/ChatRoom.cpp
+++ b/src/server/ChatRoom.cpp
@@ -41,7 +41,7 @@ void ChatRoom::HandleMessage(UserInfo *u, const char *str)
char *msg = new char[max_msg_len];
sprintf(msg, "%s: %s", u->GetName(), str);
- users->SendAllUsers(msg, 0, usual_msg);
+ users->SendAllUsers(msg, 0, USUAL_CHAR);
delete[] msg;
}
@@ -58,6 +58,8 @@ const char *ChatRoom::GetSecretPass()
void ChatRoom::AddSession(UserInfo *u)
{
users->AddUser(u);
+ users->SendAllUsersOnline(RONLINE_CHAR);
+ users->SendAllUsersName();
if(code == std_id_lobby)
return;
@@ -92,6 +94,8 @@ void ChatRoom::RemoveSession(UserInfo *u)
}
users->RemoveUser(u);
+ users->SendAllUsersOnline(RONLINE_CHAR);
+ users->SendAllUsersName();
if(code != std_id_lobby && users->GetOnline() < 1)
the_server->DeleteRoom(code);
}
@@ -140,6 +144,7 @@ void ChatRoom::Identification(UserInfo *u, const char *str)
}
// query to server
+ users->SendAllUsersName();
delete[] msg;
delete ans;
}