Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/netp6/src/orxonox/gamestates/GSDedicated.h @ 3215

Last change on this file since 3215 was 3198, checked in by scheusso, 15 years ago

merged netp4 back to trunk

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
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 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _GSDedicated_H__
30#define _GSDedicated_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include "core/GameState.h"
35#include "network/NetworkPrereqs.h"
36#include <queue>
37#include <cstring>
38#include <boost/thread/thread.hpp>
39#include <boost/thread/mutex.hpp>
40#include <boost/thread/recursive_mutex.hpp>
41
42struct termios;
43
44namespace orxonox
45{
46   
47    class _OrxonoxExport GSDedicated : public GameState
48    {
49    public:
50        GSDedicated(const std::string& name);
51        ~GSDedicated();
52
53        void activate();
54        void deactivate();
55        void update(const Clock& time);
56
57    private:
58        void inputThread();
59        void printLine();
60        void processQueue();
61        void setTerminalMode();
62        static void resetTerminalMode();
63       
64        void insertCharacter( unsigned int position, char c );
65        void deleteCharacter( unsigned int position );
66       
67        Server*                 server_;
68        float                   timeSinceLastUpdate_;
69       
70        boost::thread           *inputThread_;
71        boost::recursive_mutex  inputLineMutex_;
72        boost::recursive_mutex  inputQueueMutex_;
73        bool                    closeThread_;
74        bool                    cleanLine_;
75        unsigned char*          commandLine_;
76        unsigned int            inputIterator_;
77        std::queue<std::string> commandQueue_;
78        static termios*         originalTerminalSettings_;
79       
80        unsigned int            cursorX_;
81        unsigned int            cursorY_;
82    };
83}
84
85#endif /* _GSDedicated_H__ */
Note: See TracBrowser for help on using the repository browser.