Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
CWXDEV committed May 22, 2024
1 parent e87ef14 commit 9321aeb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public static bool PatchPrefix(ref LocationSettingsClass.Location location)
{
if (MatchmakerAcceptPatches.IsClient && MatchmakerAcceptPatches.IsReconnect)
{
location.Loot = MatchmakerAcceptPatches.ReconnectPacket.Value.Items;
location.Loot = MatchmakerAcceptPatches.ReconnectPacket.Value.Items;
}

return true;
}
return true;
}
}
}
26 changes: 13 additions & 13 deletions Fika.Core/Networking/FikaSerializationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ public static Item GetItem(this NetDataReader reader)
public static void PutInteractiveObjectState(this NetDataWriter writer, WorldInteractiveObject worldInteractiveObject)
{
writer.Put(worldInteractiveObject.Id);
writer.Put((byte) worldInteractiveObject.DoorState);
writer.Put((byte)worldInteractiveObject.DoorState);
writer.Put(Mathf.FloorToInt(worldInteractiveObject.CurrentAngle));
writer.Put(worldInteractiveObject as Door is Door door ? door.IsBroken: false);
writer.Put(worldInteractiveObject as Door is Door door ? door.IsBroken : false);
}

public static WorldInteractiveObject.GStruct385 GetInteractiveObjectState(this NetDataReader reader)
Expand All @@ -271,22 +271,22 @@ public static WindowBreaker GetWindowBreakerState(this NetDataReader reader)
return new()
{
Id = reader.GetString(),
FirstHitPosition = reader.GetVector3(),
FirstHitPosition = reader.GetVector3(),
};
}

public static void PutLightState(this NetDataWriter writer, LampController windowBreaker)
{
writer.Put(windowBreaker.NetId);
writer.Put((byte) windowBreaker.LampState);
writer.Put((byte)windowBreaker.LampState);
}

public static LampController GetLightState(this NetDataReader reader)
{
return new()
{
NetId = reader.GetInt(),
LampState = (Turnable.EState) reader.GetByte()
LampState = (Turnable.EState)reader.GetByte()
};
}

Expand Down Expand Up @@ -318,18 +318,18 @@ public static GStruct34 GetSmokeState(this NetDataReader reader)

public static void PutLocationItem(this NetDataWriter writer, LootItemPositionClass[] locationItem)
{
using MemoryStream memoryStream = new();
using BinaryWriter binaryWriter = new(memoryStream);
binaryWriter.Write(GClass1524.SerializeLootData(locationItem));
writer.PutByteArray(memoryStream.ToArray());
}
using MemoryStream memoryStream = new();
using BinaryWriter binaryWriter = new(memoryStream);
binaryWriter.Write(GClass1524.SerializeLootData(locationItem));
writer.PutByteArray(memoryStream.ToArray());
}

public static GClass1202 GetLocationItem(this NetDataReader reader)
{
using MemoryStream memoryStream = new(reader.GetByteArray());
using BinaryReader binaryReader = new(memoryStream);
using MemoryStream memoryStream = new(reader.GetByteArray());
using BinaryReader binaryReader = new(memoryStream);

return GClass1524.DeserializeLootData(Singleton<ItemFactory>.Instance, binaryReader.ReadEFTLootDataDescriptor());
}
}
}
}
3 changes: 1 addition & 2 deletions Fika.Core/Networking/Packets/Player/ConditionChangePacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public void Deserialize(NetDataReader reader)
{
NetId = reader.GetInt();
ConditionId = reader.GetString();
ConditionValue = reader.GetFloat();

ConditionValue = reader.GetFloat();
}

public void Serialize(NetDataWriter writer)
Expand Down

0 comments on commit 9321aeb

Please sign in to comment.