CS:GO User Messages: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Thunder4ik (talk | contribs) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Multiple issues| | |||
{{Dead end|date=January 2024}} | |||
{{Orphan|date=January 2024}} | |||
}} | |||
===== User Messages in Counter-Strike: Global Offensive ===== | ===== User Messages in Counter-Strike: Global Offensive ===== | ||
User messages in CS:GO use Google's Protocol Buffers (protobuf). Protobuf is a message/object serialization language that generates code to serialize the objects efficiently. For information about protobuf, see https://developers.google.com/protocol-buffers/docs/overview | User messages in CS:GO use Google's Protocol Buffers (protobuf). Protobuf is a message/object serialization language that generates code to serialize the objects efficiently. For information about protobuf, see https://developers.google.com/protocol-buffers/docs/overview | ||
On Windows, follow these steps to generate C++ classes from CS:GO .proto files. | On Windows, follow these steps to generate C++ classes from CS:GO .proto files. | ||
* Download and extract [http://media.steampowered.com/apps/csgo/dev/csgo_usermessages.zip csgo_usermessages.zip] | * Download and extract [http://media.steampowered.com/apps/csgo/dev/csgo_usermessages.zip csgo_usermessages.zip] | ||
Line 13: | Line 18: | ||
CSingleUserRecipientFilter filter( this );<br /> | CSingleUserRecipientFilter filter( this );<br /> | ||
filter.MakeReliable(); | filter.MakeReliable(); | ||
CCSUsrMsg_HintText msg;<br /> | CCSUsrMsg_HintText msg;<br /> | ||
Line 19: | Line 24: | ||
SendUserMessage( filter, CS_UM_HintText, msg );<br /><br /> | SendUserMessage( filter, CS_UM_HintText, msg );<br /><br /> | ||
[[Category:C++|User Messages]] | |||
[[Category: | [[Category:Counter-Strike: Global Offensive|User Messages]] |
Latest revision as of 08:50, 21 January 2024

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

This article has no
links to other VDC articles. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024


January 2024

This article is an orphan, meaning that few or no articles link to it.
You can help by
adding links to this article from other relevant articles.
January 2024
You can help by

January 2024
User Messages in Counter-Strike: Global Offensive
User messages in CS:GO use Google's Protocol Buffers (protobuf). Protobuf is a message/object serialization language that generates code to serialize the objects efficiently. For information about protobuf, see https://developers.google.com/protocol-buffers/docs/overview
On Windows, follow these steps to generate C++ classes from CS:GO .proto files.
- Download and extract csgo_usermessages.zip
- Download the protocol buffer compiler protoc-2.3.0 and extract it into the protoc-2.3.0-win32 folder that was created when you extracted csgo_usermessages.zip. The protocol buffer compiler is required to generate C++ classes from CS:GO .proto files.
- Download protobuf-2.3.0 and extract it into the same folder as csgo_usermessages.zip. This package contains files that are included by CS:GO .proto files
- Run make_cc_files.bat. The generated C++ files are created in subdirectory named generated_proto.
You can now use the generated classes in your C++ code to send user messages. Here is an example of how to send the HintText message
CSingleUserRecipientFilter filter( this );
filter.MakeReliable();
CCSUsrMsg_HintText msg;
msg.set_text( "ExampleHint" );
SendUserMessage( filter, CS_UM_HintText, msg );