Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaServer/ServerSource/Events/Missions/SalvageMission.cs
T
Juan Pablo Arce 3f2c843247 Unstable v0.19.3.0
2022-09-02 15:10:56 -03:00

40 lines
1.1 KiB
C#

using Barotrauma.Networking;
using System;
using System.Collections.Generic;
namespace Barotrauma
{
partial class SalvageMission : Mission
{
private bool usedExistingItem;
private UInt16 originalInventoryID;
private byte originalItemContainerIndex;
private int originalSlotIndex;
private readonly List<Pair<int, int>> executedEffectIndices = new List<Pair<int, int>>();
public override void ServerWriteInitial(IWriteMessage msg, Client c)
{
base.ServerWriteInitial(msg, c);
msg.WriteBoolean(usedExistingItem);
if (usedExistingItem)
{
msg.WriteUInt16(item.ID);
}
else
{
item.WriteSpawnData(msg, item.ID, originalInventoryID, originalItemContainerIndex, originalSlotIndex);
}
msg.WriteByte((byte)executedEffectIndices.Count);
foreach (Pair<int, int> effectIndex in executedEffectIndices)
{
msg.WriteByte((byte)effectIndex.First);
msg.WriteByte((byte)effectIndex.Second);
}
}
}
}