Quote:
Originally Posted by psychonic
We're pushing to patch to snapshots very shortly, but it may not go smoothly. I'll update once it's in with details on how to most easily test as well as a few more tips on porting plugins.
|
The code has been committed. The Linux and Mac versions have built. At the time of writing, the Windows version is still building, but any SM snapshot > 1.5.0-hg3747 should work.
To test before tomorrow's CS:GO update, you ideally need a separate test server installation, adding "-beta protobuf" (without the quotes) to the end of your app_update command line. (ex. "app_update 740 -validate -beta protobuf").
To join the test server, you will also need to update your client to the beta version. To do this, right-click the game in Steam, choose Properties, navigate to the BETAS tab, and then choose the protobuf beta. When done with testing, you will have to repeat these steps, but choose None instead of protobuf.
Everything on the
protobuf wiki page still applies. It has been updated recently with some slight changes as well. Since originally posted, GetUserMessageFormat has been renamed to GetUserMessageType; the defines for return types of it have been renamed as well.
Furthermore, some usermessages with repeated field, such as the commonly-used SayText2, expected an undocumented specific number of values added, else the client will crash when receiving. To alleviate this specific case, here is a SayText2 stock that you may use when converting plugins:
Code:
stock PbSayText2(client, author = 0, bool:bWantsToChat = false, const String:szFormat[], any:...)
{
decl String:szSendMsg[192];
VFormat(szSendMsg, sizeof(szSendMsg), szFormat, 5);
StrCat(szSendMsg, sizeof(szSendMsg), "\n");
new Handle:pb = StartMessageOne("SayText2", client);
if (pb != INVALID_HANDLE)
{
PbSetInt(pb, "ent_idx", author);
PbSetBool(pb, "chat", bWantsToChat);
PbSetString(pb, "msg_name", szSendMsg);
PbAddString(pb, "params", "");
PbAddString(pb, "params", "");
PbAddString(pb, "params", "");
PbAddString(pb, "params", "");
EndMessage();
}
}