Orxonox  0.0.5 Codename: Arcturus
ServerInformation.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Oliver Scheuss
24  * Co-authors:
25  * ...
26  *
27  */
28 
29 #include "../NetworkPrereqs.h"
30 
31 #include <string>
32 #include <OgreStringConverter.h>
33 
34 
35 #ifndef SERVERINFORMATION_H
36 #define SERVERINFORMATION_H
37 
38 namespace orxonox
39 {
40  namespace packet
41  {
42 
44  {
45  public:
49 
50  void send( ENetPeer* peer );
51  void setServerName(std::string name) { this->serverName_ = name; }
52  std::string getServerName() const { return this->serverName_; }
53  void setServerIP( std::string IP ) { this->serverIP_ = IP; }
54  std::string getServerIP() const { return this->serverIP_; }
55  void setClientNumber( int clientNumber ) { this->clientNumber_ = clientNumber; }
56  int getClientNumber() const { return this->clientNumber_; }
57  uint32_t getServerRTT() const { return this->serverRTT_; }
58 
59  private:
63  uint32_t serverRTT_;
64  };
65 
66  }
67 
68 }
69 
70 _NetworkExport std::ostream& operator<<(std::ostream& out, const ENetAddress& address);
71 
72 #endif // SERVERINFORMATION_H
void send(ENetPeer *peer)
Definition: ServerInformation.cc:71
Portable internet address structure.
Definition: enet.h:82
std::string getServerIP() const
Definition: ServerInformation.h:54
void setServerName(std::string name)
Definition: ServerInformation.h:51
~ServerInformation()
Definition: ServerInformation.cc:66
void setServerIP(std::string IP)
Definition: ServerInformation.h:53
std::string serverIP_
Definition: ServerInformation.h:62
::std::string string
Definition: gtest-port.h:756
Structure to describe a single event.
Definition: ScriptController.h:42
int clientNumber_
Definition: ServerInformation.h:61
Definition: ServerInformation.h:43
void setClientNumber(int clientNumber)
Definition: ServerInformation.h:55
An ENet event as returned by enet_host_service().
Definition: enet.h:416
An ENet peer which data packets may be sent or received from.
Definition: enet.h:253
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _NetworkExport
Definition: NetworkPrereqs.h:59
std::string getServerName() const
Definition: ServerInformation.h:52
std::ostream & operator<<(std::ostream &out, const std::set< const Identifier * > &list)
Lists the names of all Identifiers in a std::set<const Identifier*>.
Definition: Identifier.cc:466
std::string serverName_
Definition: ServerInformation.h:60
uint32_t getServerRTT() const
Definition: ServerInformation.h:57
ServerInformation()
Definition: ServerInformation.cc:42
int getClientNumber() const
Definition: ServerInformation.h:56
uint32_t serverRTT_
Definition: ServerInformation.h:63