doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NetworkSystem.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #include "../../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "NetworkSystem.h"
33 
36 
37 
38 /*
39 ==================
40 idNetworkSystem::ServerSendReliableMessage
41 ==================
42 */
43 void idNetworkSystem::ServerSendReliableMessage( int clientNum, const idBitMsg &msg ) {
44  if ( idAsyncNetwork::server.IsActive() ) {
46  }
47 }
48 
49 /*
50 ==================
51 idNetworkSystem::ServerSendReliableMessageExcluding
52 ==================
53 */
55  if ( idAsyncNetwork::server.IsActive() ) {
57  }
58 }
59 
60 /*
61 ==================
62 idNetworkSystem::ServerGetClientPing
63 ==================
64 */
66  if ( idAsyncNetwork::server.IsActive() ) {
67  return idAsyncNetwork::server.GetClientPing( clientNum );
68  }
69  return 0;
70 }
71 
72 /*
73 ==================
74 idNetworkSystem::ServerGetClientPrediction
75 ==================
76 */
78  if ( idAsyncNetwork::server.IsActive() ) {
79  return idAsyncNetwork::server.GetClientPrediction( clientNum );
80  }
81  return 0;
82 }
83 
84 /*
85 ==================
86 idNetworkSystem::ServerGetClientTimeSinceLastPacket
87 ==================
88 */
90  if ( idAsyncNetwork::server.IsActive() ) {
92  }
93  return 0;
94 }
95 
96 /*
97 ==================
98 idNetworkSystem::ServerGetClientTimeSinceLastInput
99 ==================
100 */
102  if ( idAsyncNetwork::server.IsActive() ) {
104  }
105  return 0;
106 }
107 
108 /*
109 ==================
110 idNetworkSystem::ServerGetClientOutgoingRate
111 ==================
112 */
114  if ( idAsyncNetwork::server.IsActive() ) {
115  return idAsyncNetwork::server.GetClientOutgoingRate( clientNum );
116  }
117  return 0;
118 }
119 
120 /*
121 ==================
122 idNetworkSystem::ServerGetClientIncomingRate
123 ==================
124 */
126  if ( idAsyncNetwork::server.IsActive() ) {
127  return idAsyncNetwork::server.GetClientIncomingRate( clientNum );
128  }
129  return 0;
130 }
131 
132 /*
133 ==================
134 idNetworkSystem::ServerGetClientIncomingPacketLoss
135 ==================
136 */
138  if ( idAsyncNetwork::server.IsActive() ) {
140  }
141  return 0.0f;
142 }
143 
144 /*
145 ==================
146 idNetworkSystem::ClientSendReliableMessage
147 ==================
148 */
150  if ( idAsyncNetwork::client.IsActive() ) {
152  } else if ( idAsyncNetwork::server.IsActive() ) {
154  }
155 }
156 
157 /*
158 ==================
159 idNetworkSystem::ClientGetPrediction
160 ==================
161 */
163  if ( idAsyncNetwork::client.IsActive() ) {
165  }
166  return 0;
167 }
168 
169 /*
170 ==================
171 idNetworkSystem::ClientGetTimeSinceLastPacket
172 ==================
173 */
175  if ( idAsyncNetwork::client.IsActive() ) {
177  }
178  return 0;
179 }
180 
181 /*
182 ==================
183 idNetworkSystem::ClientGetOutgoingRate
184 ==================
185 */
187  if ( idAsyncNetwork::client.IsActive() ) {
189  }
190  return 0;
191 }
192 
193 /*
194 ==================
195 idNetworkSystem::ClientGetIncomingRate
196 ==================
197 */
199  if ( idAsyncNetwork::client.IsActive() ) {
201  }
202  return 0;
203 }
204 
205 /*
206 ==================
207 idNetworkSystem::ClientGetIncomingPacketLoss
208 ==================
209 */
211  if ( idAsyncNetwork::client.IsActive() ) {
213  }
214  return 0.0f;
215 }
idNetworkSystem * networkSystem
virtual int ClientGetIncomingRate(void)
static idAsyncClient client
Definition: AsyncNetwork.h:168
void SendReliableGameMessageExcluding(int clientNum, const idBitMsg &msg)
virtual int ClientGetPrediction(void)
void SendReliableGameMessage(const idBitMsg &msg)
virtual float ClientGetIncomingPacketLoss(void)
int GetClientTimeSinceLastInput(int clientNum) const
virtual int ClientGetOutgoingRate(void)
static idAsyncServer server
Definition: AsyncNetwork.h:167
int GetPrediction(void) const
float GetIncomingPacketLoss(void) const
int GetClientPrediction(int clientNum) const
virtual void ServerSendReliableMessageExcluding(int clientNum, const idBitMsg &msg)
virtual void ServerSendReliableMessage(int clientNum, const idBitMsg &msg)
virtual int ClientGetTimeSinceLastPacket(void)
int GetClientIncomingRate(int clientNum) const
int GetOutgoingRate(void) const
void LocalClientSendReliableMessage(const idBitMsg &msg)
virtual int ServerGetClientPing(int clientNum)
int GetClientOutgoingRate(int clientNum) const
void SendReliableGameMessage(int clientNum, const idBitMsg &msg)
virtual int ServerGetClientIncomingRate(int clientNum)
int GetClientTimeSinceLastPacket(int clientNum) const
float GetClientIncomingPacketLoss(int clientNum) const
virtual int ServerGetClientOutgoingRate(int clientNum)
int GetTimeSinceLastPacket(void) const
virtual int ServerGetClientPrediction(int clientNum)
virtual int ServerGetClientTimeSinceLastInput(int clientNum)
int GetIncomingRate(void) const
idNetworkSystem networkSystemLocal
virtual int ServerGetClientTimeSinceLastPacket(int clientNum)
virtual void ClientSendReliableMessage(const idBitMsg &msg)
int GetClientPing(int clientNum) const
virtual float ServerGetClientIncomingPacketLoss(int clientNum)