Skip to content

Commit

Permalink
Remove try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 25, 2024
1 parent e6f3bef commit 8dd0d65
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions Fika.Core/Networking/LiteNetLib/Utils/NetPacketProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,8 @@ public void SubscribeNetSerializable<T, TUserData>(
var reference = new T();
_callbacks[GetHash<T>()] = (reader, userData) =>
{
try
{
reference.Deserialize(reader);
}
catch
{
FikaPlugin.Instance.FikaLogger.LogError("Error when deserializing " + reference.GetType().Name + " packet.");
}
onReceive(reference, (TUserData)userData);
reference.Deserialize(reader);
onReceive(reference, (TUserData)userData);
};
}

Expand All @@ -277,15 +270,8 @@ public void SubscribeNetSerializable<T>(
var reference = new T();
_callbacks[GetHash<T>()] = (reader, userData) =>
{
try
{
reference.Deserialize(reader);
}
catch
{
FikaPlugin.Instance.FikaLogger.LogError("Error when deserializing " + reference.GetType().Name + " packet.");
}
onReceive(reference);
reference.Deserialize(reader);
onReceive(reference);
};
}

Expand Down

0 comments on commit 8dd0d65

Please sign in to comment.