Build 1.1.4.0
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
partial class EndMission : Mission
|
||||
{
|
||||
public override void ServerWriteInitial(IWriteMessage msg, Client c)
|
||||
{
|
||||
base.ServerWriteInitial(msg, c);
|
||||
|
||||
boss.WriteSpawnData(msg, boss.ID, restrictMessageSize: false);
|
||||
msg.WriteByte((byte)minions.Length);
|
||||
foreach (Character minion in minions)
|
||||
{
|
||||
minion.WriteSpawnData(msg, minion.ID, restrictMessageSize: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Barotrauma.Networking;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -16,11 +17,10 @@ namespace Barotrauma
|
||||
foreach (var kvp in spawnedResources)
|
||||
{
|
||||
msg.WriteByte((byte)kvp.Value.Count);
|
||||
var rotation = resourceClusters[kvp.Key].Rotation;
|
||||
msg.WriteSingle(rotation);
|
||||
foreach (var r in kvp.Value)
|
||||
msg.WriteSingle(kvp.Value.FirstOrDefault()?.Rotation ?? 0.0f);
|
||||
foreach (var item in kvp.Value)
|
||||
{
|
||||
r.WriteSpawnData(msg, r.ID, Entity.NullEntityID, 0, -1);
|
||||
item.WriteSpawnData(msg, item.ID, Entity.NullEntityID, 0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace Barotrauma
|
||||
{
|
||||
msg.WriteIdentifier(kvp.Key);
|
||||
msg.WriteByte((byte)kvp.Value.Length);
|
||||
foreach (var i in kvp.Value)
|
||||
foreach (var item in kvp.Value)
|
||||
{
|
||||
msg.WriteUInt16(i.ID);
|
||||
msg.WriteUInt16(item.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,33 +6,66 @@ namespace Barotrauma
|
||||
{
|
||||
partial class SalvageMission : Mission
|
||||
{
|
||||
private bool usedExistingItem;
|
||||
struct SpawnInfo
|
||||
{
|
||||
public readonly bool UsedExistingItem;
|
||||
public readonly UInt16 OriginalInventoryID;
|
||||
public readonly byte OriginalItemContainerIndex;
|
||||
public readonly int OriginalSlotIndex;
|
||||
public readonly List<(int listIndex, int effectIndex)> ExecutedEffectIndices;
|
||||
|
||||
private UInt16 originalInventoryID;
|
||||
private byte originalItemContainerIndex;
|
||||
private int originalSlotIndex;
|
||||
public SpawnInfo(bool usedExistingItem, UInt16 originalInventoryID, byte originalItemContainerIndex, int originalSlotIndex, List<(int listIndex, int effectIndex)> executedEffectIndices)
|
||||
{
|
||||
UsedExistingItem = usedExistingItem;
|
||||
OriginalInventoryID = originalInventoryID;
|
||||
OriginalItemContainerIndex = originalItemContainerIndex;
|
||||
OriginalSlotIndex = originalSlotIndex;
|
||||
ExecutedEffectIndices = executedEffectIndices;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<Pair<int, int>> executedEffectIndices = new List<Pair<int, int>>();
|
||||
private readonly Dictionary<Target, SpawnInfo> spawnInfo = new Dictionary<Target, SpawnInfo>();
|
||||
|
||||
public override void ServerWriteInitial(IWriteMessage msg, Client c)
|
||||
{
|
||||
base.ServerWriteInitial(msg, c);
|
||||
|
||||
msg.WriteBoolean(usedExistingItem);
|
||||
if (usedExistingItem)
|
||||
foreach (var target in targets)
|
||||
{
|
||||
msg.WriteUInt16(item.ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.WriteSpawnData(msg, item.ID, originalInventoryID, originalItemContainerIndex, originalSlotIndex);
|
||||
}
|
||||
bool targetFound = spawnInfo.ContainsKey(target) && target.Item != null;
|
||||
msg.WriteBoolean(targetFound);
|
||||
if (!targetFound) { continue; }
|
||||
|
||||
msg.WriteByte((byte)executedEffectIndices.Count);
|
||||
foreach (Pair<int, int> effectIndex in executedEffectIndices)
|
||||
msg.WriteBoolean(spawnInfo[target].UsedExistingItem);
|
||||
if (spawnInfo[target].UsedExistingItem)
|
||||
{
|
||||
msg.WriteUInt16(target.Item.ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.Item.WriteSpawnData(msg,
|
||||
target.Item.ID,
|
||||
spawnInfo[target].OriginalInventoryID,
|
||||
spawnInfo[target].OriginalItemContainerIndex,
|
||||
spawnInfo[target].OriginalSlotIndex);
|
||||
}
|
||||
|
||||
msg.WriteByte((byte)spawnInfo[target].ExecutedEffectIndices.Count);
|
||||
foreach ((int listIndex, int effectIndex) in spawnInfo[target].ExecutedEffectIndices)
|
||||
{
|
||||
msg.WriteByte((byte)listIndex);
|
||||
msg.WriteByte((byte)effectIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ServerWrite(IWriteMessage msg)
|
||||
{
|
||||
base.ServerWrite(msg);
|
||||
msg.WriteByte((byte)targets.Count);
|
||||
for (int i = 0; i < targets.Count; i++)
|
||||
{
|
||||
msg.WriteByte((byte)effectIndex.First);
|
||||
msg.WriteByte((byte)effectIndex.Second);
|
||||
msg.WriteByte((byte)targets[i].State);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user