aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/client/clientmode_shared.cpp
diff options
context:
space:
mode:
authorNarendra Umate <[email protected]>2013-12-08 01:27:41 -0800
committerNarendra Umate <[email protected]>2013-12-08 01:27:41 -0800
commit4fa56874ba1557274c10077bf8386ece4c61dbd6 (patch)
treee2d336604e960b548e996d2e7dcfc5a1e1401b9e /sp/src/game/client/clientmode_shared.cpp
parentAdded DS_Store to .gitignore. (diff)
parentMake libSDL2.so/dylib into symlinks. (diff)
downloadsource-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.tar.xz
source-sdk-2013-4fa56874ba1557274c10077bf8386ece4c61dbd6.zip
Merge remote-tracking branch 'upstream/master'
Reverted .gitattributes xcode_ccache_wrapper change. Fixed line endings for .gitignore and .gitattributes.
Diffstat (limited to 'sp/src/game/client/clientmode_shared.cpp')
-rw-r--r--sp/src/game/client/clientmode_shared.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/sp/src/game/client/clientmode_shared.cpp b/sp/src/game/client/clientmode_shared.cpp
index a1d1127d..b6dee29c 100644
--- a/sp/src/game/client/clientmode_shared.cpp
+++ b/sp/src/game/client/clientmode_shared.cpp
@@ -36,7 +36,7 @@
#include <vgui/ILocalize.h>
#include "hud_vote.h"
#include "ienginevgui.h"
-#include "headtrack/isourcevirtualreality.h"
+#include "sourcevr/isourcevirtualreality.h"
#if defined( _X360 )
#include "xbox/xbox_console.h"
#endif
@@ -208,6 +208,7 @@ static void __MsgFunc_VGUIMenu( bf_read &msg )
if ( count > 0 )
{
KeyValues *keys = new KeyValues("data");
+ //Msg( "MsgFunc_VGUIMenu:\n" );
for ( int i=0; i<count; i++)
{
@@ -216,10 +217,25 @@ static void __MsgFunc_VGUIMenu( bf_read &msg )
msg.ReadString( name, sizeof(name) );
msg.ReadString( data, sizeof(data) );
+ //Msg( " %s <- '%s'\n", name, data );
keys->SetString( name, data );
}
+ // !KLUDGE! Whitelist of URL protocols formats for MOTD
+ if (
+ !V_stricmp( panelname, PANEL_INFO ) // MOTD
+ && keys->GetInt( "type", 0 ) == 2 // URL message type
+ ) {
+ const char *pszURL = keys->GetString( "msg", "" );
+ if ( Q_strncmp( pszURL, "http://", 7 ) != 0 && Q_strncmp( pszURL, "https://", 8 ) != 0 )
+ {
+ Warning( "Blocking MOTD URL '%s'; must begin with 'http://' or 'https://'\n", pszURL );
+ keys->deleteThis();
+ return;
+ }
+ }
+
viewport->SetData( keys );
keys->deleteThis();
@@ -496,7 +512,7 @@ bool ClientModeShared::ShouldBlackoutAroundHUD()
//-----------------------------------------------------------------------------
-// Purpose: Allows the client mode to override mouse control stuff in headtrack
+// Purpose: Allows the client mode to override mouse control stuff in sourcevr
//-----------------------------------------------------------------------------
HeadtrackMovementMode_t ClientModeShared::ShouldOverrideHeadtrackControl()
{