mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Update weaver log, remove unused test and make transport send methods abstract (#2910)
* Turn on duplicate writer/reader logs in weaver * Make Transport Client/ServerSend abstract * Remove unused test
This commit is contained in:
parent
fe021f8fe7
commit
32f0fa47ef
@ -35,10 +35,7 @@ internal void Register(TypeReference dataType, MethodReference methodReference)
|
||||
{
|
||||
if (readFuncs.ContainsKey(dataType))
|
||||
{
|
||||
// TODO enable this again later.
|
||||
// Reader has some obsolete functions that were renamed.
|
||||
// Don't want weaver warnings for all of them.
|
||||
//Weaver.Warning($"Registering a Read method for {dataType.FullName} when one already exists", methodReference);
|
||||
Log.Warning($"Registering a Read method for {dataType.FullName} when one already exists", methodReference);
|
||||
}
|
||||
|
||||
// we need to import type when we Initialize Readers so import here in case it is used anywhere else
|
||||
|
@ -35,10 +35,7 @@ public void Register(TypeReference dataType, MethodReference methodReference)
|
||||
{
|
||||
if (writeFuncs.ContainsKey(dataType))
|
||||
{
|
||||
// TODO enable this again later.
|
||||
// Writer has some obsolete functions that were renamed.
|
||||
// Don't want weaver warnings for all of them.
|
||||
//Weaver.Warning($"Registering a Write method for {dataType.FullName} when one already exists", methodReference);
|
||||
Log.Warning($"Registering a Write method for {dataType.FullName} when one already exists", methodReference);
|
||||
}
|
||||
|
||||
// we need to import type when we Initialize Writers so import here in case it is used anywhere else
|
||||
|
@ -64,8 +64,7 @@ public virtual void ClientConnect(Uri uri)
|
||||
|
||||
/// <summary>Sends a message to the server over the given channel.</summary>
|
||||
// The ArraySegment is only valid until returning. Copy if needed.
|
||||
// TODO make abstract
|
||||
public virtual void ClientSend(ArraySegment<byte> segment, int channelId) {}
|
||||
public abstract void ClientSend(ArraySegment<byte> segment, int channelId);
|
||||
|
||||
/// <summary>Disconnects the client from the server</summary>
|
||||
public abstract void ClientDisconnect();
|
||||
@ -94,8 +93,7 @@ public virtual void ClientSend(ArraySegment<byte> segment, int channelId) {}
|
||||
public abstract void ServerStart();
|
||||
|
||||
/// <summary>Send a message to a client over the given channel.</summary>
|
||||
// TODO make abstract
|
||||
public virtual void ServerSend(int connectionId, ArraySegment<byte> segment, int channelId) {}
|
||||
public abstract void ServerSend(int connectionId, ArraySegment<byte> segment, int channelId);
|
||||
|
||||
/// <summary>Disconnect a client from the server.</summary>
|
||||
public abstract void ServerDisconnect(int connectionId);
|
||||
|
@ -1250,23 +1250,5 @@ public void UpdateDetectsDestroyedEntryInObserving()
|
||||
LogAssert.Expect(LogType.Warning, new Regex("Found 'null' entry in observing list.*"));
|
||||
NetworkServer.NetworkLateUpdate();
|
||||
}
|
||||
|
||||
// NetworkServer.Update iterates all connections.
|
||||
// a timed out connection may call Disconnect, trying to modify the
|
||||
// collection during the loop.
|
||||
// -> test to prevent https://github.com/vis2k/Mirror/pull/2718
|
||||
[Test]
|
||||
public void UpdateWithTimedOutConnection()
|
||||
{
|
||||
// configure to disconnect with '0' timeout (= immediately)
|
||||
// start
|
||||
NetworkServer.Listen(1);
|
||||
|
||||
// add a connection
|
||||
NetworkServer.connections[42] = new FakeNetworkConnection{isReady=true};
|
||||
|
||||
// update
|
||||
NetworkServer.NetworkLateUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user