mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
Split r3159..r3161, part 7: code touching networking.
git-svn-id: https://svn.eduke32.com/eduke32@3173 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
6d5d415ea5
commit
7c07fee1b3
5 changed files with 11 additions and 11 deletions
|
@ -128,7 +128,7 @@ enet_symbol_rescale (ENetSymbol * symbol)
|
|||
if((encodeLow ^ (encodeLow + encodeRange)) >= ENET_RANGE_CODER_TOP) \
|
||||
{ \
|
||||
if(encodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
|
||||
encodeRange = -encodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
||||
encodeRange = -(signed)encodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
||||
} \
|
||||
ENET_RANGE_CODER_OUTPUT (encodeLow >> 24); \
|
||||
encodeRange <<= 8; \
|
||||
|
@ -360,7 +360,7 @@ enet_range_coder_compress (void * context, const ENetBuffer * inBuffers, size_t
|
|||
if((decodeLow ^ (decodeLow + decodeRange)) >= ENET_RANGE_CODER_TOP) \
|
||||
{ \
|
||||
if(decodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
|
||||
decodeRange = -decodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
||||
decodeRange = -(signed)decodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
|
||||
} \
|
||||
decodeCode <<= 8; \
|
||||
if (inData < inEnd) \
|
||||
|
|
|
@ -430,7 +430,7 @@ enet_peer_ping (ENetPeer * peer)
|
|||
void
|
||||
enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
|
||||
{
|
||||
peer -> pingInterval = pingInterval ? pingInterval : ENET_PEER_PING_INTERVAL;
|
||||
peer -> pingInterval = pingInterval ? pingInterval : (enet_uint32)ENET_PEER_PING_INTERVAL;
|
||||
}
|
||||
|
||||
/** Sets the timeout parameters for a peer.
|
||||
|
@ -453,9 +453,9 @@ enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
|
|||
void
|
||||
enet_peer_timeout (ENetPeer * peer, enet_uint32 timeoutLimit, enet_uint32 timeoutMinimum, enet_uint32 timeoutMaximum)
|
||||
{
|
||||
peer -> timeoutLimit = timeoutLimit ? timeoutLimit : ENET_PEER_TIMEOUT_LIMIT;
|
||||
peer -> timeoutMinimum = timeoutMinimum ? timeoutMinimum : ENET_PEER_TIMEOUT_MINIMUM;
|
||||
peer -> timeoutMaximum = timeoutMaximum ? timeoutMaximum : ENET_PEER_TIMEOUT_MAXIMUM;
|
||||
peer -> timeoutLimit = timeoutLimit ? timeoutLimit : (enet_uint32)ENET_PEER_TIMEOUT_LIMIT;
|
||||
peer -> timeoutMinimum = timeoutMinimum ? timeoutMinimum : (enet_uint32)ENET_PEER_TIMEOUT_MINIMUM;
|
||||
peer -> timeoutMaximum = timeoutMaximum ? timeoutMaximum : (enet_uint32)ENET_PEER_TIMEOUT_MAXIMUM;
|
||||
}
|
||||
|
||||
/** Force an immediate disconnection from a peer.
|
||||
|
|
|
@ -45,7 +45,7 @@ uint32_t g_netMapRevision = 0;
|
|||
ENetHost *g_netServer = NULL;
|
||||
ENetHost *g_netClient = NULL;
|
||||
ENetPeer *g_netClientPeer = NULL;
|
||||
int32_t g_netPort = 23513;
|
||||
enet_uint16 g_netPort = 23513;
|
||||
int32_t g_netDisconnect = 0;
|
||||
char g_netPassword[32];
|
||||
int32_t g_netPlayersWaiting = 0;
|
||||
|
@ -71,14 +71,14 @@ static void alloc_multimapstate(int32_t i)
|
|||
{
|
||||
if (g_multiMapState[i] == NULL)
|
||||
{
|
||||
g_multiMapState[i] = Bcalloc(1, sizeof(netmapstate_t));
|
||||
g_multiMapState[i] = (netmapstate_t *)Bcalloc(1, sizeof(netmapstate_t));
|
||||
if (g_multiMapState[i] == NULL)
|
||||
G_GameExit("OUT OF MEMORY in alloc_multimapstate");
|
||||
}
|
||||
|
||||
if (g_pendingMapState[i] == NULL)
|
||||
{
|
||||
g_pendingMapState[i] = Bcalloc(1, sizeof(netmapstate_t));
|
||||
g_pendingMapState[i] = (netmapstate_t *)Bcalloc(1, sizeof(netmapstate_t));
|
||||
if (g_pendingMapState[i] == NULL)
|
||||
G_GameExit("OUT OF MEMORY in alloc_multimapstate");
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ extern ENetPeer *g_netClientPeer;
|
|||
extern char g_netPassword[32];
|
||||
extern int32_t g_netDisconnect;
|
||||
extern int32_t g_netPlayersWaiting;
|
||||
extern int32_t g_netPort;
|
||||
extern enet_uint16 g_netPort;
|
||||
extern int32_t g_networkMode;
|
||||
extern int32_t lastsectupdate[MAXSECTORS];
|
||||
extern int32_t lastupdate[MAXSPRITES];
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
typedef signed int ssize_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned long uint32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef ULONGLONG uint64_t;
|
||||
#else
|
||||
/* mingw32, lcc and watcom provide a proper header */
|
||||
|
|
Loading…
Reference in a new issue