Planeshift
invitemanager.h
Go to the documentation of this file.
1 /*
2  * invitemanager.h
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 
21 #ifndef __INVITEMANAGER_H__
22 #define __INVITEMANAGER_H__
23 
24 //=============================================================================
25 // Crystal Space Includes
26 //=============================================================================
27 
28 //=============================================================================
29 // Project Includes
30 //=============================================================================
31 
32 //=============================================================================
33 // Local Includes
34 //=============================================================================
35 #include "questionmanager.h"
36 
37 
38 #define FIRST_SPAM_FINE 10
39 #define SECOND_SPAM_FINE 30
40 static const int INVITESPAMBANTIME[5] = {1, 5, 10, // Ban times in minutes
41  30, 10
42  }; // spamPoints expire based on SP+1's ban time
43 
44 
45 class psInviteGameEvent;
46 class Client;
47 
56 {
57 public:
58 
60 
62  csString accept, reject;
63 
66 
69 
72 
73  bool cannotAccept;
74 
75  PendingInvite(Client* inviter,
76  Client* invitee,
77  bool penalize,
78  const char* question_str,
79  const char* accept_button,
80  const char* reject_button,
81  const char* inviter_explanation,
82  const char* invitee_explanation,
83  const char* inviter_acceptance,
84  const char* invitee_acceptance,
85  const char* inviter_rejection,
86  const char* invitee_rejection,
88 
89  virtual void HandleAnswer(const csString &answer);
90  virtual void HandleTimeout();
91 
92 
93 protected:
94 
96  void HandleSpamPoints(bool accepted);
97 };
98 
99 
100 #endif
101 
csString inviteeName
Definition: invitemanager.h:71
psQuestionMessage::questionType_t type
type of question - clients handles each question type differently
csString inviteeAcceptance
Definition: invitemanager.h:65
bool CheckForSpam(Client *inviter, psQuestionMessage::questionType_t type)
csString inviterAcceptance
text sent via chat when invitation has been accepted
Definition: invitemanager.h:65
static const int INVITESPAMBANTIME[5]
Definition: invitemanager.h:40
"Questions" are general requests of information from user.
virtual void HandleAnswer(const csString &answer)
This is called when user sends answer to this question, or when the question times out (because the u...
csString accept
the text on buttons used to either accept or reject invitation
Definition: invitemanager.h:62
csString inviterRejection
text sent via chat when invitation has been rejected
Definition: invitemanager.h:68
This class collects data of a netclient.
Definition: client.h:95
PendingInvite(Client *inviter, Client *invitee, bool penalize, const char *question_str, const char *accept_button, const char *reject_button, const char *inviter_explanation, const char *invitee_explanation, const char *inviter_acceptance, const char *invitee_acceptance, const char *inviter_rejection, const char *invitee_rejection, psQuestionMessage::questionType_t invType)
if the user cannot accept this invitation (used when inviting member of secret guild) ...
void HandleSpamPoints(bool accepted)
questionType_t
Various questions that are posed to the user.
Definition: messages.h:3726
csString reject
Definition: invitemanager.h:62
virtual void HandleTimeout()
csString inviterName
names of the two players
Definition: invitemanager.h:71
This class is the superclass for all player-to-player invitations, such as inviting into a group...
Definition: invitemanager.h:55
csString inviteeRejection
Definition: invitemanager.h:68