From cdf0a673491c10c70b6d3d22a730f175aa2d14cf Mon Sep 17 00:00:00 2001 From: skyjake Date: Sat, 16 Mar 2013 09:29:22 +0200 Subject: [PATCH] Fixed|Client: Clear view color filter when connecting An old view filter may remain from an earlier client session. --- doomsday/api/api_player.h | 1 - doomsday/client/src/client/cl_main.cpp | 1 + doomsday/plugins/common/src/g_game.c | 1 - doomsday/server/src/server/sv_main.cpp | 23 ++++++++++++----------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doomsday/api/api_player.h b/doomsday/api/api_player.h index f0a7b72f0d..7e53304a33 100644 --- a/doomsday/api/api_player.h +++ b/doomsday/api/api_player.h @@ -56,7 +56,6 @@ typedef enum controltype_e { * @{ */ #define DDPF_FIXANGLES 0x0001 ///< Server: send angle/pitch to client. -//#define DDPF_FILTER 0x0002 // Server: send filter to client. #define DDPF_FIXORIGIN 0x0004 ///< Server: send coords to client. #define DDPF_DEAD 0x0008 ///< Cl & Sv: player is dead. #define DDPF_CAMERA 0x0010 ///< Player is a cameraman. diff --git a/doomsday/client/src/client/cl_main.cpp b/doomsday/client/src/client/cl_main.cpp index 8ea6b88c72..9effc59955 100644 --- a/doomsday/client/src/client/cl_main.cpp +++ b/doomsday/client/src/client/cl_main.cpp @@ -185,6 +185,7 @@ void Cl_AnswerHandshake(void) ddPlayers[consolePlayer].shared.flags |= DDPF_LOCAL; Smoother_Clear(clients[consolePlayer].smoother); + ddPlayers[consolePlayer].shared.flags &= ~DDPF_USE_VIEW_FILTER; isClient = true; isServer = false; diff --git a/doomsday/plugins/common/src/g_game.c b/doomsday/plugins/common/src/g_game.c index a31b4d4a5e..5cafd3fd8a 100644 --- a/doomsday/plugins/common/src/g_game.c +++ b/doomsday/plugins/common/src/g_game.c @@ -1936,7 +1936,6 @@ void G_PlayerLeaveMap(int player) // Clear filter. p->plr->flags &= ~DDPF_VIEW_FILTER; - //p->plr->flags |= DDPF_FILTER; // Server: Send the change to the client. p->damageCount = 0; // No palette changes. p->bonusCount = 0; diff --git a/doomsday/server/src/server/sv_main.cpp b/doomsday/server/src/server/sv_main.cpp index b45f77555a..def67ac799 100644 --- a/doomsday/server/src/server/sv_main.cpp +++ b/doomsday/server/src/server/sv_main.cpp @@ -37,6 +37,7 @@ #include #include +#include // This is absolute maximum bandwidth rating. Frame size is practically // unlimited with this score. @@ -580,19 +581,18 @@ void Sv_GetPackets(void) */ boolean Sv_PlayerArrives(unsigned int nodeID, char const *name) { - int i; - - Con_Message("Sv_PlayerArrives: '%s' has arrived.", name); + LOG_AS("Sv_PlayerArrives"); + LOG_INFO("'%s' has arrived.") << name; // We need to find the new player a client entry. - for(i = 1; i < DDMAXPLAYERS; ++i) + for(int i = 1; i < DDMAXPLAYERS; ++i) { - client_t *cl = &clients[i]; + client_t *cl = &clients[i]; if(!cl->connected) { - player_t *plr = &ddPlayers[i]; - ddplayer_t *ddpl = &plr->shared; + player_t *plr = &ddPlayers[i]; + ddplayer_t *ddpl = &plr->shared; // This'll do. cl->connected = true; @@ -606,18 +606,19 @@ boolean Sv_PlayerArrives(unsigned int nodeID, char const *name) ddpl->fixAcked.origin = ddpl->fixAcked.mom = -1; + // Clear the view filter. + memset(ddpl->filterColor, 0, sizeof(ddpl->filterColor)); + ddpl->flags &= ~DDPF_VIEW_FILTER; + Sv_InitPoolForClient(i); Smoother_Clear(cl->smoother); - VERBOSE(Con_Printf - ("Sv_PlayerArrives: '%s' assigned to " - "console %i (node: %x)\n", cl->name, i, nodeID)); + LOG_VERBOSE("'%s' assigned to console %i (node:%u)") << cl->name << i << nodeID; // In order to get in the game, the client must first // shake hands. It'll request this by sending a Hello packet. // We'll be waiting... cl->handshake = false; - //cl->updateCount = UPDATECOUNT; return true; } }