Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/newlevel2012/src/libraries/network/WANDiscoverable.h @ 9348

Last change on this file since 9348 was 8858, checked in by landauf, 13 years ago

merged output branch back to trunk.

Changes:

  • you have to include util/Output.h instead of util/Debug.h
  • COUT(x) is now called orxout(level)
  • output levels are now defined by an enum instead of numbers. see util/Output.h for the definition
  • it's possible to use output contexts with orxout(level, context). see util/Output.h for some common contexts. you can define more contexts
  • you must use 'endl' at the end of an output message, '\n' does not flush the message

Output levels:

  • instead of COUT(0) use orxout()
  • instead of COUT(1) use orxout(user_error) or orxout(internal_error)
  • instead of COUT(2) use orxout(user_warning) or orxout(internal_warning)
  • instead of COUT(3) use orxout(user_status/user_info) or orxout(internal_status/internal_info)
  • instead of COUT(4) use orxout(verbose)
  • instead of COUT(5) use orxout(verbose_more)
  • instead of COUT(6) use orxout(verbose_ultra)

Guidelines:

  • user_* levels are for the user, visible in the console and the log-file
  • internal_* levels are for developers, visible in the log-file
  • verbose_* levels are for debugging, only visible if the context of the output is activated

Usage in C++:

  • orxout() << "message" << endl;
  • orxout(level) << "message" << endl;
  • orxout(level, context) << "message" << endl;

Usage in Lua:

  • orxout("message")
  • orxout(orxonox.level.levelname, "message")
  • orxout(orxonox.level.levelname, "context", "message")

Usage in Tcl (and in the in-game-console):

  • orxout levelname message
  • orxout_context levelname context message
  • shortcuts: log message, error message, warning message, status message, info message, debug message
  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
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 *
21 *   Author:
22 *      Sandro 'smerkli' Merkli
23 *   Co-authors:
24 *      Oliver Scheuss (original)
25 *
26 */
27
28#ifndef _WANDiscoverable_H__
29#define _WANDiscoverable_H__
30
31#include "NetworkPrereqs.h"
32#include "core/OrxonoxClass.h"
33#include "core/CoreIncludes.h"
34#include "MasterServerComm.h"
35
36namespace orxonox
37{
38
39  class _NetworkExport WANDiscoverable: public OrxonoxClass
40  {
41    public:
42      /** constructor */
43      WANDiscoverable();
44
45      /** destructor */
46      ~WANDiscoverable();
47
48      /** \return Address of the master server
49       *
50       * Get the master server address
51       */
52      std::string getMSAddress()
53      { return this->msaddress; }
54
55      /** Function used for the configuration file parameter update */
56      void setConfigValues();
57     
58      /** Function used to set the activity/discoverability */
59      void setActivity( bool bActive );
60
61      /** Master server communications object */
62      MasterServerComm msc;
63     
64    private:
65      /** Function used to connect to the master server */
66      bool connect();
67     
68      /** Function used to disconnect from the master server */
69      void disconnect();
70     
71      /** master server address */
72      std::string msaddress;
73      bool        bActive_;
74
75  };
76
77}
78
79#endif // _WANDiscoverable_H__
Note: See TracBrowser for help on using the repository browser.