Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment BitStream version for Discord update #1330

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ bool CClientGame::StartGame(const char* szNick, const char* szPassword, eServerT
std::string strUser;
pBitStream->Write(strUser.c_str(), MAX_SERIAL_LENGTH);

if (g_pNet->GetServerBitStreamVersion() >= 0x06D)
if (g_pNet->GetServerBitStreamVersion() >= 0x06E)
{
SString joinSecret = SStringX(szSecret);
pBitStream->WriteString<uchar>(joinSecret);
Expand Down Expand Up @@ -6954,7 +6954,7 @@ void CClientGame::RestreamModel(unsigned short usModel)

void CClientGame::TriggerDiscordJoin(SString strSecret)
{
if (g_pNet->GetServerBitStreamVersion() < 0x06D)
if (g_pNet->GetServerBitStreamVersion() < 0x06E)
return;

NetBitStreamInterface* pBitStream = g_pNet->AllocateNetBitStream();
Expand Down Expand Up @@ -7108,7 +7108,7 @@ void CClientGame::UpdateDiscordState()
uint playerSlot = g_pClientGame->GetServerInfo()->GetMaxPlayers();
SString state(std::to_string(playerCount));

if (g_pCore->GetNetwork()->GetServerBitStreamVersion() >= 0x06D)
if (g_pCore->GetNetwork()->GetServerBitStreamVersion() >= 0x06E)
state += "/" + std::to_string(playerSlot);

state += (playerCount == 1 && (!playerSlot || playerSlot == 1) ? " Player" : " Players");
Expand Down
2 changes: 1 addition & 1 deletion Client/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
#define _CLIENT_NET_MODULE_VERSION 0x0AB // (0x000 - 0xfff) Lvl9 wizards only
#define _NETCODE_VERSION 0x1DA // (0x000 - 0xfff) Increment when net messages change (pre-release)
#define MTA_DM_BITSTREAM_VERSION 0x06D // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
#define MTA_DM_BITSTREAM_VERSION 0x06E // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).

// To avoid user confusion, make sure the ASE version matches only if communication is possible
#if defined(MTA_DM_CONNECT_TO_PUBLIC)
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ void CGame::JoinPlayer(CPlayer& Player)
marker.Set("CPlayerJoinCompletePacket");

// Sync up server info on entry
if (Player.GetBitStreamVersion() >= 0x06D)
if (Player.GetBitStreamVersion() >= 0x06E)
Player.Send(CServerInfoSyncPacket(SERVER_INFO_FLAG_ALL));

// Add debug info if wanted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3312,7 +3312,7 @@ bool CStaticFunctionDefinitions::SetPlayerDiscordJoinParams(CElement* pElement,
{
CPlayer* pPlayer = static_cast<CPlayer*>(pElement);

if (pPlayer->GetBitStreamVersion() < 0x06D)
if (pPlayer->GetBitStreamVersion() < 0x06E)
return false;

CBitStream bitStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool CPlayerJoinDataPacket::Read(NetBitStreamInterface& BitStream)
m_strNick = *m_strNick;
m_strSerialUser = *m_strSerialUser;

if (m_usBitStreamVersion >= 0x06D)
if (m_usBitStreamVersion >= 0x06E)
{
if (!BitStream.ReadString<uchar>(m_strDiscordSecret))
return false;
Expand Down
2 changes: 1 addition & 1 deletion Server/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
#define _SERVER_NET_MODULE_VERSION 0x0AB // (0x000 - 0xfff) Lvl9 wizards only
#define _NETCODE_VERSION 0x1DA // (0x000 - 0xfff) Increment when net messages change (pre-release)
#define MTA_DM_BITSTREAM_VERSION 0x06D // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
#define MTA_DM_BITSTREAM_VERSION 0x06E // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).

// To avoid user confusion, make sure the ASE version matches only if communication is possible
#if defined(MTA_DM_CONNECT_FROM_PUBLIC)
Expand Down