Skip to content

Commit e04b860

Browse files
committed
Network: Allow special dev version to help development
otherwise raising the ProtocolRequiredClientVersion constant would be impossible before releasing a version
1 parent cd175f4 commit e04b860

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Game/States/ConnectionState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ namespace tsom
122122
UpdateStatus(Nz::SimpleTextDrawer::Draw("Authenticating...", 36));
123123

124124
Packets::AuthRequest request;
125-
request.gameVersion = GameVersion;
125+
request.gameVersion = (IsDevVersion()) ? Nz::MaxValue() : GameVersion;
126126
request.token = m_playerData;
127127

128128
m_serverSession->SendPacket(request);

src/ServerLib/Session/InitialSessionHandler.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,13 @@ namespace tsom
113113
return FailAuth(AuthError::UpgradeRequired);
114114
}
115115

116-
if (authRequest.gameVersion > GameVersion)
116+
// Disallow more recent client than the server (except in dev mode for dev version)
117+
if (authRequest.gameVersion > GameVersion && (!IsDevVersion() || authRequest.gameVersion != Nz::MaxValue<Nz::UInt32>()))
117118
{
118119
fmt::print(fg(fmt::color::red), "{0} authentication failed (version is more recent than server's)\n", login);
119120
return FailAuth(AuthError::ServerIsOutdated);
120121
}
121122

122-
// Make a special dev version
123-
if (IsDevVersion())
124-
authRequest.gameVersion = Nz::MaxValue();
125-
126123
NetworkSession* session = GetSession();
127124
session->SetProtocolVersion(authRequest.gameVersion);
128125

0 commit comments

Comments
 (0)