mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Remove all extraneous blank lines (#1325)
This commit is contained in:
parent
b479b8ee51
commit
0e705d4aa0
@ -572,7 +572,6 @@ void GenerateDeSerialization()
|
||||
// Generates: end if (initialState);
|
||||
serWorker.Append(initialStateLabel);
|
||||
|
||||
|
||||
// get dirty bits
|
||||
serWorker.Append(serWorker.Create(OpCodes.Ldarg_1));
|
||||
serWorker.Append(serWorker.Create(OpCodes.Call, Readers.GetReadFunc(Weaver.uint64Type)));
|
||||
|
@ -285,7 +285,6 @@ static void ProcessInstructionMethod(MethodDefinition md, Instruction instr, Met
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// this is required to early-out from a function with "ref" or "out" parameters
|
||||
static void InjectGuardParameters(MethodDefinition md, ILProcessor worker, Instruction top)
|
||||
{
|
||||
|
@ -110,7 +110,6 @@ public static MethodDefinition ProcessSyncVarSet(TypeDefinition td, FieldDefinit
|
||||
|
||||
ILProcessor setWorker = set.Body.GetILProcessor();
|
||||
|
||||
|
||||
// if (!SyncVarEqual(value, ref playerData))
|
||||
Instruction endOfMethod = setWorker.Create(OpCodes.Nop);
|
||||
|
||||
@ -194,7 +193,6 @@ public static MethodDefinition ProcessSyncVarSet(TypeDefinition td, FieldDefinit
|
||||
// dirty bit
|
||||
setWorker.Append(setWorker.Create(OpCodes.Ldc_I8, dirtyBit)); // 8 byte integer aka long
|
||||
|
||||
|
||||
if (fd.FieldType.FullName == Weaver.gameObjectType.FullName)
|
||||
{
|
||||
// reference to netId Field to set
|
||||
|
@ -3,7 +3,6 @@
|
||||
using Mono.CecilX.Cil;
|
||||
using Mono.CecilX.Rocks;
|
||||
|
||||
|
||||
namespace Mirror.Weaver
|
||||
{
|
||||
public static class Readers
|
||||
@ -156,13 +155,11 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, int recurs
|
||||
worker.Append(worker.Create(OpCodes.Ret));
|
||||
worker.Append(labelEmptyArray);
|
||||
|
||||
|
||||
// T value = new T[length];
|
||||
worker.Append(worker.Create(OpCodes.Ldloc_0));
|
||||
worker.Append(worker.Create(OpCodes.Newarr, variable.GetElementType()));
|
||||
worker.Append(worker.Create(OpCodes.Stloc_1));
|
||||
|
||||
|
||||
// for (int i=0; i< length ; i++) {
|
||||
worker.Append(worker.Create(OpCodes.Ldc_I4_0));
|
||||
worker.Append(worker.Create(OpCodes.Stloc_2));
|
||||
@ -180,7 +177,6 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, int recurs
|
||||
worker.Append(worker.Create(OpCodes.Call, elementReadFunc));
|
||||
worker.Append(worker.Create(OpCodes.Stobj, variable.GetElementType()));
|
||||
|
||||
|
||||
worker.Append(worker.Create(OpCodes.Ldloc_2));
|
||||
worker.Append(worker.Create(OpCodes.Ldc_I4_1));
|
||||
worker.Append(worker.Create(OpCodes.Add));
|
||||
@ -248,7 +244,6 @@ static MethodDefinition GenerateArraySegmentReadFunc(TypeReference variable, int
|
||||
worker.Append(worker.Create(OpCodes.Newarr, elementType));
|
||||
worker.Append(worker.Create(OpCodes.Stloc_1));
|
||||
|
||||
|
||||
// loop through array and deserialize each element
|
||||
// generates code like this
|
||||
// for (int i=0; i< length ; i++)
|
||||
|
@ -247,7 +247,6 @@ static void SetupTargetTypes()
|
||||
ArraySegmentOffsetReference = Resolvers.ResolveProperty(ArraySegmentType, CurrentAssembly, "Offset");
|
||||
ArraySegmentConstructorReference = Resolvers.ResolveMethod(ArraySegmentType, CurrentAssembly, ".ctor");
|
||||
|
||||
|
||||
NetworkReaderType = NetAssembly.MainModule.GetType("Mirror.NetworkReader");
|
||||
NetworkWriterType = NetAssembly.MainModule.GetType("Mirror.NetworkWriter");
|
||||
|
||||
|
@ -61,7 +61,6 @@ public static MethodReference GetWriteFunc(TypeReference variable, int recursion
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
MethodDefinition newWriterFunc;
|
||||
|
||||
if (variable.IsArray)
|
||||
@ -246,13 +245,11 @@ static MethodDefinition GenerateArrayWriteFunc(TypeReference variable, int recur
|
||||
worker.Append(worker.Create(OpCodes.Ldobj, variable.GetElementType()));
|
||||
worker.Append(worker.Create(OpCodes.Call, elementWriteFunc));
|
||||
|
||||
|
||||
worker.Append(worker.Create(OpCodes.Ldloc_1));
|
||||
worker.Append(worker.Create(OpCodes.Ldc_I4_1));
|
||||
worker.Append(worker.Create(OpCodes.Add));
|
||||
worker.Append(worker.Create(OpCodes.Stloc_1));
|
||||
|
||||
|
||||
// end for loop
|
||||
worker.Append(labelHead);
|
||||
worker.Append(worker.Create(OpCodes.Ldloc_1));
|
||||
@ -349,7 +346,6 @@ static MethodDefinition GenerateArraySegmentWriteFunc(TypeReference variable, in
|
||||
worker.Append(worker.Create(OpCodes.Add));
|
||||
worker.Append(worker.Create(OpCodes.Stloc_1));
|
||||
|
||||
|
||||
// end for loop
|
||||
worker.Append(labelHead);
|
||||
worker.Append(worker.Create(OpCodes.Ldloc_1));
|
||||
|
@ -476,7 +476,6 @@ protected bool SyncVarGameObjectEqual(GameObject newGameObject, uint netIdField)
|
||||
return newNetId == netIdField;
|
||||
}
|
||||
|
||||
|
||||
// helper function for [SyncVar] GameObjects.
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected void SetSyncVarGameObject(GameObject newGameObject, ref GameObject gameObjectField, ulong dirtyBit, ref uint netIdField)
|
||||
@ -522,7 +521,6 @@ protected GameObject GetSyncVarGameObject(uint netId, ref GameObject gameObjectF
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// helper function for [SyncVar] NetworkIdentities.
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
protected bool SyncVarNetworkIdentityEqual(NetworkIdentity newIdentity, uint netIdField)
|
||||
|
@ -165,7 +165,6 @@ public bool Send(int msgType, MessageBase msg, int channelId = Channels.DefaultR
|
||||
return Send(new ArraySegment<byte>(message), channelId);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This sends a network message with a message ID on the connection. This message is sent on channel zero, which by default is the reliable channel.
|
||||
/// </summary>
|
||||
|
@ -383,7 +383,6 @@ public void StartClient(Uri uri)
|
||||
OnStartClient();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This starts a network "host" - a server and client in the same application.
|
||||
/// <para>The client returned from StartHost() is a special "local" client that communicates to the in-process server using a message queue instead of the real network. But in almost all other cases, it can be treated as a normal client.</para>
|
||||
|
@ -284,7 +284,6 @@ public static bool SendToAll<T>(T msg, int channelId = Channels.DefaultReliable)
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("Server.SendToAll id:" + typeof(T));
|
||||
|
||||
|
||||
// get writer from pool
|
||||
NetworkWriter writer = NetworkWriterPool.GetWriter();
|
||||
|
||||
@ -1055,7 +1054,6 @@ internal static void SendSpawnMessage(NetworkIdentity identity, NetworkConnectio
|
||||
NetworkWriter ownerWriter = NetworkWriterPool.GetWriter();
|
||||
NetworkWriter observersWriter = NetworkWriterPool.GetWriter();
|
||||
|
||||
|
||||
// serialize all components with initialState = true
|
||||
// (can be null if has none)
|
||||
identity.OnSerializeAllSafely(true, ownerWriter, out int ownerWritten, observersWriter, out int observersWritten);
|
||||
@ -1175,7 +1173,6 @@ public static void Spawn(GameObject obj, GameObject player)
|
||||
Spawn(obj, identity.connectionToClient);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Use <see cref="Spawn(GameObject, NetworkConnection)"/> instead
|
||||
/// </summary>
|
||||
|
@ -22,7 +22,6 @@ public static class NetworkTime
|
||||
|
||||
static double lastPingTime;
|
||||
|
||||
|
||||
// Date and time when the application started
|
||||
static readonly Stopwatch stopwatch = new Stopwatch();
|
||||
|
||||
|
@ -86,7 +86,6 @@ struct Change
|
||||
protected virtual void SerializeItem(NetworkWriter writer, T item) { }
|
||||
protected virtual T DeserializeItem(NetworkReader reader) => default;
|
||||
|
||||
|
||||
protected SyncList(IEqualityComparer<T> comparer = null)
|
||||
{
|
||||
this.comparer = comparer ?? EqualityComparer<T>.Default;
|
||||
|
@ -110,7 +110,6 @@ public override int GetMaxPacketSize(int channelId = 0)
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Server
|
||||
// connection ids get mapped to base transports
|
||||
// if we have 3 transports, then
|
||||
|
@ -64,7 +64,6 @@ public abstract class Transport : MonoBehaviour
|
||||
/// <param name="address">The IP address or FQDN of the server we are trying to connect to</param>
|
||||
public abstract void ClientConnect(string address);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Establish a connecion to a server
|
||||
/// </summary>
|
||||
@ -169,7 +168,6 @@ public virtual bool GetConnectionInfo(int connectionId, out string address)
|
||||
/// </summary>
|
||||
public abstract void ServerStop();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
@ -90,7 +90,6 @@ async Task ReceiveLoop(WebSocket webSocket, CancellationToken token)
|
||||
{
|
||||
WebSocketReceiveResult result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), token);
|
||||
|
||||
|
||||
if (result == null)
|
||||
break;
|
||||
if (result.MessageType == WebSocketMessageType.Close)
|
||||
@ -171,7 +170,6 @@ public async void Send(ArraySegment<byte> segment)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (IsConnected )
|
||||
|
@ -65,7 +65,6 @@ public void Send(ArraySegment<byte> segment)
|
||||
SocketSend(m_NativeRef, segment.Array, segment.Count);
|
||||
}
|
||||
|
||||
|
||||
#region Javascript native functions
|
||||
[DllImport("__Internal")]
|
||||
static extern int SocketCreate(
|
||||
|
@ -67,7 +67,6 @@ internal class WebSocketImplementation : WebSocket
|
||||
SemaphoreSlim _sendSemaphore = new SemaphoreSlim(1, 1);
|
||||
public WebSocketHttpContext Context { get; set; }
|
||||
|
||||
|
||||
internal WebSocketImplementation(Guid guid, Func<MemoryStream> recycledStreamFactory, Stream stream, TimeSpan keepAliveInterval, string secWebSocketExtensions, bool includeExceptionInCloseResponse, bool isClient, string subProtocol)
|
||||
{
|
||||
_guid = guid;
|
||||
|
@ -190,7 +190,6 @@ async Task ReceiveLoopAsync(WebSocket webSocket, CancellationToken token)
|
||||
// someone connected, raise event
|
||||
Connected?.Invoke(connectionId);
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
WebSocketReceiveResult result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), token);
|
||||
|
@ -9,7 +9,6 @@ public class WebsocketTransport : Transport
|
||||
public const string Scheme = "ws";
|
||||
public const string SecureScheme = "wss";
|
||||
|
||||
|
||||
protected Client client = new Client();
|
||||
protected Server server = new Server();
|
||||
|
||||
|
@ -32,7 +32,6 @@ public void TestEmptyByteArray()
|
||||
Assert.That(unpacked.array.Count, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
|
||||
public static ArraySegment<int> SampleReader(NetworkReader reader )
|
||||
{
|
||||
int length = reader.ReadPackedInt32();
|
||||
|
@ -3,7 +3,6 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Mirror.Tests
|
||||
{
|
||||
public class MockQuest
|
||||
|
@ -198,7 +198,6 @@ public void CallbackTest()
|
||||
serverSyncList.Add("yay");
|
||||
SerializeDeltaTo(serverSyncList, clientSyncList);
|
||||
|
||||
|
||||
Assert.That(called, Is.True);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ public struct Guild
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class SyncVarTest
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user