1 /** @file serverplayer.h  Server-side player state.
2  *
3  * @authors Copyright (c) 2015-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
4  *
5  * @par License
6  * GPL: http://www.gnu.org/licenses/gpl.html
7  *
8  * <small>This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by the
10  * Free Software Foundation; either version 2 of the License, or (at your
11  * option) any later version. This program is distributed in the hope that it
12  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14  * Public License for more details. You should have received a copy of the GNU
15  * General Public License along with this program; if not, see:
16  * http://www.gnu.org/licenses</small>
17  */
18 
19 #ifndef SERVER_SERVERPLAYER_H
20 #define SERVER_SERVERPLAYER_H
21 
22 #include <de/Id>
23 #include <doomsday/player.h>
24 #include "server/sv_pool.h"
25 
26 /**
27  * Server-side player state: delta pool, client bookkeeping information.
28  *
29  * @ingroup server
30  */
31 class ServerPlayer : public Player
32 {
33 public:
34     /// Identifier of the RemoteUser instance of this client.
35     de::Id::Type remoteUserId;
36 
37     /// Seconds when the client entered the game (Sys_GetRealSeconds()).
38     double enterTime;
39 
40     /// Clients are pinged by the server when they join the game.
41     /// This is the ping in milliseconds for this client.
42     unsigned int shakePing;
43 
44     /// If true, the server will send the player a handshake. The client must
45     /// acknowledge it before this flag is turned off.
46     bool handshake;
47 
48     int lastTransmit;
49 
50     /// Field of view. Used in determining visible mobjs (default: 90).
51     float fov;
52 
53     /// Server uses this to determine whether it's OK to send game packets
54     /// to the client.
55     bool ready;
56 
57 public:
58     ServerPlayer();
59 
60     /// Is this client connected? (Might not be in the game yet.)
61     bool isConnected() const;
62 
63     pool_t &deltaPool();
64 
65 private:
66     DENG2_PRIVATE(d)
67 };
68 
69 #endif // SERVER_SERVERPLAYER_H
70