Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaServer/ServerSource/Items/Components/DockingPort.cs
2022-10-20 17:05:24 +03:00

28 lines
913 B
C#

using Barotrauma.Networking;
namespace Barotrauma.Items.Components
{
partial class DockingPort : ItemComponent, IDrawableComponent, IServerSerializable, IClientSerializable
{
public void ServerEventWrite(IWriteMessage msg, Client c, NetEntityEvent.IData extraData = null)
{
msg.WriteBoolean(docked);
if (docked)
{
msg.WriteUInt16(DockingTarget.item.ID);
msg.WriteBoolean(IsLocked);
}
}
public void ServerEventRead(IReadMessage msg, Client c)
{
var allowOutpostAutoDocking = (AllowOutpostAutoDocking)msg.ReadByte();
if (outpostAutoDockingPromptShown &&
CampaignMode.AllowedToManageCampaign(c, ClientPermissions.ManageMap))
{
this.allowOutpostAutoDocking = allowOutpostAutoDocking;
}
}
}
}