mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #20966 from ZehMatt/fix-20964
Fix #20964: Crash when invalid network group id is used
This commit is contained in:
commit
da1fa18523
|
@ -14,6 +14,7 @@
|
|||
- Fix: [#20737] Spent money in player window underflows when getting refunds.
|
||||
- Fix: [#20778] [Plugin] Incorrect target api when executing custom actions.
|
||||
- Fix: [#20807] Tertiary colour not copied with small scenery.
|
||||
- Fix: [#20964] Crash when player connects to server with a group assigned that no longer exists.
|
||||
|
||||
0.4.6 (2023-09-03)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -2643,8 +2643,11 @@ void NetworkBase::ServerHandleAuth(NetworkConnection& connection, NetworkPacket&
|
|||
if (connection.AuthStatus == NetworkAuth::Verified)
|
||||
{
|
||||
const NetworkGroup* group = GetGroupByID(GetGroupIDByHash(connection.Key.PublicKeyHash()));
|
||||
if (group != nullptr)
|
||||
{
|
||||
passwordless = group->CanPerformAction(NetworkPermission::PasswordlessLogin);
|
||||
}
|
||||
}
|
||||
if (gameversion != NetworkGetVersion())
|
||||
{
|
||||
connection.AuthStatus = NetworkAuth::BadVersion;
|
||||
|
@ -3649,6 +3652,11 @@ GameActions::Result NetworkModifyGroups(
|
|||
case ModifyGroupType::SetName:
|
||||
{
|
||||
NetworkGroup* group = network.GetGroupByID(groupId);
|
||||
if (group == nullptr)
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, STR_NONE);
|
||||
}
|
||||
|
||||
const char* oldName = group->GetName().c_str();
|
||||
|
||||
if (strcmp(oldName, name.c_str()) == 0)
|
||||
|
|
Loading…
Reference in New Issue