mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Tests: remove unnecessary empty NetworkMessage serialization methods. Weaver takes care of it.
This commit is contained in:
parent
2b02fa0130
commit
1ecf57a2f0
@ -35,43 +35,25 @@ struct StructWithEmptyMethodMessage : NetworkMessage
|
|||||||
public int IntValue;
|
public int IntValue;
|
||||||
public string StringValue;
|
public string StringValue;
|
||||||
public double DoubleValue;
|
public double DoubleValue;
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public void Deserialize(NetworkReader reader) { }
|
|
||||||
public void Serialize(NetworkWriter writer) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClassWithoutBaseMessage : NetworkMessage
|
class ClassWithoutBaseMessage : NetworkMessage
|
||||||
{
|
{
|
||||||
public int[] array;
|
public int[] array;
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public void Deserialize(NetworkReader reader) { }
|
|
||||||
public void Serialize(NetworkWriter writer) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AbstractMessage : NetworkMessage
|
abstract class AbstractMessage : NetworkMessage
|
||||||
{
|
{
|
||||||
public abstract void Deserialize(NetworkReader reader);
|
|
||||||
public abstract void Serialize(NetworkWriter writer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverrideMessage : AbstractMessage
|
class OverrideMessage : AbstractMessage
|
||||||
{
|
{
|
||||||
public int someValue;
|
public int someValue;
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public override void Serialize(NetworkWriter writer) { }
|
|
||||||
public override void Deserialize(NetworkReader reader) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Layer1Message : NetworkMessage
|
class Layer1Message : NetworkMessage
|
||||||
{
|
{
|
||||||
public int value1;
|
public int value1;
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public virtual void Serialize(NetworkWriter writer) { }
|
|
||||||
public virtual void Deserialize(NetworkReader reader) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Layer2Message : Layer1Message
|
class Layer2Message : Layer1Message
|
||||||
|
@ -42,10 +42,6 @@ struct TestMessage2 : NetworkMessage
|
|||||||
public string StringValue;
|
public string StringValue;
|
||||||
public double DoubleValue;
|
public double DoubleValue;
|
||||||
#pragma warning restore CS0649 // Field is never assigned to
|
#pragma warning restore CS0649 // Field is never assigned to
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public void Deserialize(NetworkReader reader) { }
|
|
||||||
public void Serialize(NetworkWriter writer) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CommandTestNetworkBehaviour : NetworkBehaviour
|
public class CommandTestNetworkBehaviour : NetworkBehaviour
|
||||||
|
@ -9,10 +9,6 @@ class NoArgMethodMessage : NetworkMessage
|
|||||||
// Weaver should ignore these methods because they have no args
|
// Weaver should ignore these methods because they have no args
|
||||||
public void Serialize() { /* method with no arg */ }
|
public void Serialize() { /* method with no arg */ }
|
||||||
public void Deserialize() { /* method with no arg */ }
|
public void Deserialize() { /* method with no arg */ }
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public void Serialize(NetworkWriter writer) { }
|
|
||||||
public void Deserialize(NetworkReader reader) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TwoArgMethodMessage : NetworkMessage
|
class TwoArgMethodMessage : NetworkMessage
|
||||||
@ -22,11 +18,6 @@ class TwoArgMethodMessage : NetworkMessage
|
|||||||
// Weaver should ignore these methods because they have two args
|
// Weaver should ignore these methods because they have two args
|
||||||
public void Serialize(NetworkWriter writer, int AnotherValue) { /* method with 2 args */ }
|
public void Serialize(NetworkWriter writer, int AnotherValue) { /* method with 2 args */ }
|
||||||
public void Deserialize(NetworkReader reader, int AnotherValue) { /* method with 2 args */ }
|
public void Deserialize(NetworkReader reader, int AnotherValue) { /* method with 2 args */ }
|
||||||
|
|
||||||
|
|
||||||
// Mirror will fill out these empty methods
|
|
||||||
public void Serialize(NetworkWriter writer) { }
|
|
||||||
public void Deserialize(NetworkReader reader) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OverloadMethodTest
|
public class OverloadMethodTest
|
||||||
|
@ -5,10 +5,6 @@ namespace Mirror.Tests.StructMessages
|
|||||||
public struct SomeStructMessage : NetworkMessage
|
public struct SomeStructMessage : NetworkMessage
|
||||||
{
|
{
|
||||||
public int someValue;
|
public int someValue;
|
||||||
|
|
||||||
// Mirror will automatically implement message that are empty
|
|
||||||
public void Serialize(NetworkWriter writer) { }
|
|
||||||
public void Deserialize(NetworkReader reader) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
|
Loading…
Reference in New Issue
Block a user