Sanitize the OpenSlotStorageUIMessage handling on the server.
This commit is contained in:
@@ -267,6 +267,7 @@ namespace Content.Server.GameObjects
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null,
|
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null,
|
||||||
IComponent component = null)
|
IComponent component = null)
|
||||||
{
|
{
|
||||||
@@ -282,10 +283,12 @@ namespace Content.Server.GameObjects
|
|||||||
if (playerentity == Owner)
|
if (playerentity == Owner)
|
||||||
HandleInventoryMessage(msg);
|
HandleInventoryMessage(msg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpenSlotStorageUIMessage msg:
|
case OpenSlotStorageUIMessage msg:
|
||||||
ItemComponent item = GetSlotItem(msg.Slot);
|
if (!HasSlot(msg.Slot)) // client input sanitization
|
||||||
ServerStorageComponent storage;
|
return;
|
||||||
if (item.Owner.TryGetComponent(out storage))
|
var item = GetSlotItem(msg.Slot);
|
||||||
|
if (item != null && item.Owner.TryGetComponent(out ServerStorageComponent storage))
|
||||||
storage.OpenStorageUI(Owner);
|
storage.OpenStorageUI(Owner);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user