fix?
This commit is contained in:
@@ -84,7 +84,9 @@ namespace KCM.Packets.Handlers
|
|||||||
{
|
{
|
||||||
|
|
||||||
IPacket p = (IPacket)Activator.CreateInstance(packet);
|
IPacket p = (IPacket)Activator.CreateInstance(packet);
|
||||||
var properties = packet.GetProperties(BindingFlags.Instance | BindingFlags.Public).Where(prop => prop.Name != "packetId").ToArray();
|
var properties = packet.GetProperties(BindingFlags.Instance | BindingFlags.Public)
|
||||||
|
.Where(prop => prop.Name != "packetId" && prop.Name != "sendMode")
|
||||||
|
.ToArray();
|
||||||
Array.Sort(properties, (x, y) => String.Compare(x.Name, y.Name));
|
Array.Sort(properties, (x, y) => String.Compare(x.Name, y.Name));
|
||||||
ushort id = (ushort)p.GetType().GetProperty("packetId").GetValue(p, null);
|
ushort id = (ushort)p.GetType().GetProperty("packetId").GetValue(p, null);
|
||||||
|
|
||||||
@@ -235,7 +237,7 @@ namespace KCM.Packets.Handlers
|
|||||||
if (prop.PropertyType.IsEnum)
|
if (prop.PropertyType.IsEnum)
|
||||||
{
|
{
|
||||||
currentPropName = prop.Name;
|
currentPropName = prop.Name;
|
||||||
message.AddInt((int)prop.GetValue(packet, null));
|
message.AddInt(Convert.ToInt32(prop.GetValue(packet, null)));
|
||||||
}
|
}
|
||||||
else if (prop.PropertyType == typeof(ushort))
|
else if (prop.PropertyType == typeof(ushort))
|
||||||
{
|
{
|
||||||
@@ -467,9 +469,7 @@ namespace KCM.Packets.Handlers
|
|||||||
if (prop.PropertyType.IsEnum)
|
if (prop.PropertyType.IsEnum)
|
||||||
{
|
{
|
||||||
int enumValue = message.GetInt();
|
int enumValue = message.GetInt();
|
||||||
string enumName = Enum.GetName(prop.PropertyType, enumValue);
|
prop.SetValue(p, Enum.ToObject(prop.PropertyType, enumValue));
|
||||||
|
|
||||||
prop.SetValue(p, Enum.Parse(prop.PropertyType, enumName));
|
|
||||||
}
|
}
|
||||||
else if (prop.PropertyType == typeof(ushort))
|
else if (prop.PropertyType == typeof(ushort))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ A mellékelt log (`output.txt`) alapján több tipikus hiba okozta a szerver ind
|
|||||||
- Hálózati stabilitás: `BuildingStatePacket` most `Unreliable` módban megy (state jellegű csomagoknál jobb, ha a legfrissebb állapot érkezik meg és nem torlódik fel a megbízható sor)
|
- Hálózati stabilitás: `BuildingStatePacket` most `Unreliable` módban megy (state jellegű csomagoknál jobb, ha a legfrissebb állapot érkezik meg és nem torlódik fel a megbízható sor)
|
||||||
- Mentés-szinkron stabilitás: szerver oldalon a save chunkok már nem egy nagy for-ciklusban mennek ki, hanem ütemezve (csökkenti a “The gap between received sequence IDs…” / “Poor connection” diszkonnekteket)
|
- Mentés-szinkron stabilitás: szerver oldalon a save chunkok már nem egy nagy for-ciklusban mennek ki, hanem ütemezve (csökkenti a “The gap between received sequence IDs…” / “Poor connection” diszkonnekteket)
|
||||||
- Kapcsolat tuning: kliens és szerver oldalon emelt `MaxSendAttempts`, és tiltott minőség-alapú auto-disconnect (különösen save transfer közben volt agresszív)
|
- Kapcsolat tuning: kliens és szerver oldalon emelt `MaxSendAttempts`, és tiltott minőség-alapú auto-disconnect (különösen save transfer közben volt agresszív)
|
||||||
|
- Fix: a `sendMode` csak a Riptide üzenetküldési mód kiválasztására szolgál, nem kerül szériázásra; az enum csomagmezők szériázása/deszériázása robusztusabb lett (különben csatlakozáskor packet-parszolás szétesett)
|
||||||
|
|
||||||
Érintett fájlok (főbb pontok):
|
Érintett fájlok (főbb pontok):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user