multiplayer: Add status message for user joining/leaving

The room server is now able to send a new type of packet: IdStatusMessage which is parsed and displayed by the client.
This commit is contained in:
zhupengfei 2018-11-09 21:55:57 +08:00
parent 386bf5c861
commit 0319e51960
6 changed files with 134 additions and 7 deletions

View file

@ -39,6 +39,7 @@ public:
public slots:
void OnRoomUpdate(const Network::RoomInformation& info);
void OnChatReceive(const Network::ChatEntry&);
void OnStatusMessageReceive(const Network::StatusMessageEntry&);
void OnSendChat();
void OnChatTextChanged();
void PopupContextMenu(const QPoint& menu_location);
@ -47,6 +48,7 @@ public slots:
signals:
void ChatReceived(const Network::ChatEntry&);
void StatusMessageReceived(const Network::StatusMessageEntry&);
private:
static constexpr u32 max_chat_lines = 1000;
@ -61,5 +63,6 @@ private:
};
Q_DECLARE_METATYPE(Network::ChatEntry);
Q_DECLARE_METATYPE(Network::StatusMessageEntry);
Q_DECLARE_METATYPE(Network::RoomInformation);
Q_DECLARE_METATYPE(Network::RoomMember::State);