From c761d10684e92c90055c4521d301297987e66b8c Mon Sep 17 00:00:00 2001 From: lotodore Date: Mon, 29 Mar 2010 12:22:41 +0000 Subject: [PATCH] Preparing game invitation. --- src/game_defs.h | 6 ++++++ src/net/clientcallback.h | 3 +++ src/session.h | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/game_defs.h b/src/game_defs.h index fe8aa081..72f6a96d 100644 --- a/src/game_defs.h +++ b/src/game_defs.h @@ -104,6 +104,12 @@ enum EndPetitionReason PETITION_END_TIMEOUT }; +enum DenyGameInvitationReason +{ + DENY_GAME_INVITATION_NO = 0, + DENY_GAME_INVITATION_BUSY +}; + enum Button { BUTTON_NONE = 0, BUTTON_DEALER, diff --git a/src/net/clientcallback.h b/src/net/clientcallback.h index 985e0508..00ddb531 100644 --- a/src/net/clientcallback.h +++ b/src/net/clientcallback.h @@ -71,6 +71,9 @@ public: virtual void SignalLobbyPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason) = 0; virtual void SignalLobbyPlayerLeft(unsigned playerId) = 0; + virtual void SignalSelfGameInvitation(unsigned gameId, unsigned playerIdFrom) = 0; + virtual void SignalPlayerGameInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom) = 0; + virtual void SignalRejectedGameInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason) = 0; }; #endif diff --git a/src/session.h b/src/session.h index 4f6ee5dd..4870ae89 100755 --- a/src/session.h +++ b/src/session.h @@ -85,7 +85,11 @@ public: void voteKick(bool doKick); void selectServer(unsigned serverId); void setLogin(const std::string &userName, const std::string &password, bool isGuest); - + + void invitePlayerToCurrentGame(unsigned playerId); + void acceptGameInvitation(unsigned gameId); + void rejectGameInvitation(unsigned gameId, DenyGameInvitationReason reason); + void resetNetworkTimeout(); bool isNetworkClientRunning() const; // TODO hack