core/smn_console.cpp
changeset 3743 a98686a77974
parent 3687 d0b1262dbc03
child 3846 dc3ed0c7422c
     1.1 --- a/core/smn_console.cpp	Mon Jan 07 09:09:14 2013 -0500
     1.2 +++ b/core/smn_console.cpp	Tue Jan 22 21:43:12 2013 -0500
     1.3 @@ -48,6 +48,10 @@
     1.4  #include "ConsoleDetours.h"
     1.5  #include "ConCommandBaseIterator.h"
     1.6  
     1.7 +#if SOURCE_ENGINE == SE_CSGO
     1.8 +#include <netmessages.pb.h>
     1.9 +#endif
    1.10 +
    1.11  #if SOURCE_ENGINE >= SE_EYE
    1.12  #define NETMSG_BITS 6
    1.13  #else
    1.14 @@ -1427,10 +1431,22 @@
    1.15  	char data[256];
    1.16  	bf_write buffer(data, sizeof(data));
    1.17  
    1.18 +#if SOURCE_ENGINE == SE_CSGO
    1.19 +	CNETMsg_SetConVar msg;
    1.20 +	CMsg_CVars_CVar *cvar = msg.mutable_convars()->add_cvars();
    1.21 +
    1.22 +	cvar->set_name(pConVar->GetName());
    1.23 +	cvar->set_value(value);
    1.24 +   
    1.25 +	buffer.WriteVarInt32(net_SetConVar);
    1.26 +	buffer.WriteVarInt32(msg.ByteSize());
    1.27 +	msg.SerializeWithCachedSizesToArray( (uint8 *)( buffer.GetBasePointer() + buffer.GetNumBytesWritten() ) );
    1.28 +#else
    1.29  	buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS);
    1.30  	buffer.WriteByte(1);
    1.31  	buffer.WriteString(pConVar->GetName());
    1.32  	buffer.WriteString(value);
    1.33 +#endif
    1.34  
    1.35  	CPlayer *pPlayer = g_Players.GetPlayerByIndex(params[1]);
    1.36