Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaServer/ServerSource/Items/Components/DockingPort.cs
Juan Pablo Arce 3f2c843247 Unstable v0.19.3.0
2022-09-02 15:10:56 -03:00

28 lines
943 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 &&
(GameMain.GameSession?.Campaign?.AllowedToManageCampaign(c, ClientPermissions.ManageMap) ?? false))
{
this.allowOutpostAutoDocking = allowOutpostAutoDocking;
}
}
}
}