| [7793] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist > www.orxonox.net < | 
|---|
 | 3 |  * | 
|---|
 | 4 |  * | 
|---|
 | 5 |  *   License notice: | 
|---|
 | 6 |  * | 
|---|
 | 7 |  *   This program is free software; you can redistribute it and/or modify it | 
|---|
 | 8 |  *   under the terms of the GNU General Public License as published by the Free | 
|---|
 | 9 |  *   Software Foundation; either version 2 of the License, or (at your option) | 
|---|
 | 10 |  *   any later version. | 
|---|
 | 11 |  * | 
|---|
 | 12 |  *   This program is distributed in the hope that it will be useful, but | 
|---|
 | 13 |  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | 
|---|
 | 14 |  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License | 
|---|
 | 15 |  *   for more details. | 
|---|
 | 16 |  * | 
|---|
 | 17 |  *   You should have received a copy of the GNU General Public License along | 
|---|
 | 18 |  *   with this program; if not, write to the Free Software Foundation, Inc., 51 | 
|---|
 | 19 |  *   Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
|---|
 | 20 |  * | 
|---|
| [8858] | 21 |  *   Author: | 
|---|
 | 22 |  *      Sandro 'smerkli' Merkli | 
|---|
 | 23 |  *   Co-authors: | 
|---|
 | 24 |  *      Oliver Scheuss (original) | 
|---|
| [7793] | 25 |  * | 
|---|
 | 26 |  */ | 
|---|
 | 27 |  | 
|---|
 | 28 | #ifndef _WANDiscoverable_H__ | 
|---|
 | 29 | #define _WANDiscoverable_H__ | 
|---|
 | 30 |  | 
|---|
 | 31 | #include "NetworkPrereqs.h" | 
|---|
| [9667] | 32 | #include "core/config/Configurable.h" | 
|---|
| [7793] | 33 | #include "MasterServerComm.h" | 
|---|
| [10622] | 34 | #include <OgreStringConverter.h> | 
|---|
| [7793] | 35 |  | 
|---|
 | 36 | namespace orxonox | 
|---|
 | 37 | { | 
|---|
 | 38 |  | 
|---|
| [9667] | 39 |   class _NetworkExport WANDiscoverable: public Configurable | 
|---|
| [7793] | 40 |   { | 
|---|
 | 41 |     public: | 
|---|
 | 42 |       /** constructor */ | 
|---|
 | 43 |       WANDiscoverable(); | 
|---|
 | 44 |  | 
|---|
 | 45 |       /** destructor */ | 
|---|
 | 46 |       ~WANDiscoverable(); | 
|---|
 | 47 |  | 
|---|
 | 48 |       /** \return Address of the master server | 
|---|
| [10622] | 49 |        * | 
|---|
 | 50 |        * Get the master server address | 
|---|
| [7793] | 51 |        */ | 
|---|
 | 52 |       std::string getMSAddress() | 
|---|
 | 53 |       { return this->msaddress; } | 
|---|
 | 54 |  | 
|---|
 | 55 |       /** Function used for the configuration file parameter update */ | 
|---|
 | 56 |       void setConfigValues(); | 
|---|
| [10622] | 57 |  | 
|---|
| [7793] | 58 |       /** Function used to set the activity/discoverability */ | 
|---|
 | 59 |       void setActivity( bool bActive ); | 
|---|
 | 60 |  | 
|---|
| [10622] | 61 |       void updateClientNumber(int clientNumber); | 
|---|
 | 62 |  | 
|---|
| [7793] | 63 |       /** Master server communications object */ | 
|---|
 | 64 |       MasterServerComm msc; | 
|---|
| [10622] | 65 |  | 
|---|
| [7793] | 66 |     private: | 
|---|
 | 67 |       /** Function used to connect to the master server */ | 
|---|
 | 68 |       bool connect(); | 
|---|
| [10622] | 69 |  | 
|---|
| [7793] | 70 |       /** Function used to disconnect from the master server */ | 
|---|
 | 71 |       void disconnect(); | 
|---|
| [10622] | 72 |  | 
|---|
| [7793] | 73 |       /** master server address */ | 
|---|
 | 74 |       std::string msaddress; | 
|---|
| [10622] | 75 |       std::string ownName; | 
|---|
| [7793] | 76 |       bool        bActive_; | 
|---|
 | 77 |  | 
|---|
 | 78 |   }; | 
|---|
 | 79 |  | 
|---|
 | 80 | } | 
|---|
 | 81 |  | 
|---|
 | 82 | #endif // _WANDiscoverable_H__ | 
|---|