Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
Client.h
1/*
2 * Copyright (c) 2016-2024 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17typedef enum
18{
19 AUTH_UNCONNECTED = 0,
20 AUTH_PROCESSING = 1,
21 AUTH_VERIFIED = 2,
22 AUTH_FAILED = 3,
23} authentication_t;
24
32class
34{
35public:
36 void ncClient(void);
37
39 virtual void ProcessInput(void);
41 virtual void PreFrame(void);
43 virtual void PostFrame(void);
45 virtual bool IsFakeSpectator(void);
47 virtual bool IsRealSpectator(void);
49 virtual bool IsDead(void);
51 virtual bool IsPlayer(void);
53 virtual void SharedInputFrame(void);
54
55 /* overrides */
56 virtual void Spawned(void);
57 virtual void OnRemoveEntity(void);
58 virtual float GetForwardSpeed(void);
59 virtual float GetSideSpeed(void);
60 virtual float GetBackSpeed(void);
61
62#ifdef CLIENT
64 virtual void ClientInputFrame(void);
65
67 virtual void UpdateAliveCam(void);
68
70 virtual void UpdateDeathcam(void);
71
73 virtual void UpdateIntermissionCam(void);
74
75 /* overrides */
76 virtual float predraw(void);
77#endif
78
79#ifdef SERVER
81 virtual void ServerInputFrame(void);
82
83 /* overrides */
84 virtual void Save(float);
85 virtual void Restore(string,string);
86
87 nonvirtual authentication_t AuthLevel(void);
88#endif
89
90private:
91 vector origin_net;
92 vector velocity_net;
93
94 NSXRSpace m_xrSpace;
95 NSXRInput m_xrInputHead;
96 NSXRInput m_xrInputLeft;
97 NSXRInput m_xrInputRight;
98
99#ifdef SERVER
100 float score;
101 authentication_t m_authLevel;
102#endif
103};
104
This class represents an input device in the world.
Definition XRInput.h:58
This class represents a local client space in the world.
Definition XRSpace.h:30
void ncBot(void)
Definition Bot.qc:18
virtual bool IsFakeSpectator(void)
Returns if we're a 'fake' spectator.
Definition Client.qc:112
virtual void ProcessInput(void)
Called within the class to deal with the final input handling of the client.
Definition Client.qc:97
virtual void UpdateDeathcam(void)
Client: Called every single client frame when this client is dead.
Definition Client.qc:167
void ncClient(void)
Definition Client.qc:18
virtual void ClientInputFrame(void)
Client: Called on the client to give a chance to override input_* variables before networking them ta...
Definition Client.qc:155
virtual void UpdateIntermissionCam(void)
Client: Called every single client frame during intermission.
Definition Client.qc:177
virtual float GetBackSpeed(void)
Overridable: Returns the desired maximum backwardss movement speed.
Definition Client.qc:148
virtual void PreFrame(void)
Run once, every frame, before physics are run on the player.
Definition Client.qc:102
virtual void SharedInputFrame(void)
Like ClientInputFrame and ServerInputFrame, but run on both client and server at the same time.
Definition Client.qc:84
nonvirtual authentication_t AuthLevel(void)
Definition Client.qc:205
virtual bool IsRealSpectator(void)
Returns if we're a 'real' spectator.
Definition Client.qc:118
virtual void ServerInputFrame(void)
Server: This is where the input* variables arrive after sending them out from the client (see ClientI...
Definition Client.qc:78
virtual float GetForwardSpeed(void)
Overridable: Returns the desired maximum forward movement speed.
Definition Client.qc:136
virtual float GetSideSpeed(void)
Overridable: Returns the desired maximum side movement speed.
Definition Client.qc:142
virtual void OnRemoveEntity(void)
Handles what happens before the entity gets removed from the client game.
Definition Client.qc:90
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition Client.qc:34
virtual void Restore(string, string)
Similar to ncIO::SpawnKey() but for save-game fields.
Definition Client.qc:54
virtual void UpdateAliveCam(void)
Client: Called every single client frame when this client is alive.
Definition Client.qc:160
virtual bool IsPlayer(void)
Returns if we're a player.
Definition Client.qc:130
virtual bool IsDead(void)
Returns if we're considered 'dead'.
Definition Client.qc:124
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition Client.qc:43
virtual void PostFrame(void)
Run once, every frame, after physics are run on the player.
Definition Client.qc:107
virtual float predraw(void)
Definition Client.qc:186