conflict_resolution
stringlengths
27
16k
<<<<<<< ======= /// <summary> /// Obsolete: Use NetworkClient directly /// <para>For example, use <c>NetworkClient.Send(message)</c> instead of <c>NetworkManager.client.Send(message)</c></para> /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient directly, it will be made static soon. For example, use NetworkClient.Send(message) instead of NetworkManager.client.Send(message)")] public NetworkClient client => NetworkClient.singleton; >>>>>>> <<<<<<< ======= /// <summary> /// Obsolete: Use isHeadless instead of IsHeadless(). /// <para>This is a static property now. This method will be removed by summer 2019.</para> /// </summary> /// <returns></returns> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use isHeadless instead of IsHeadless()")] public static bool IsHeadless() { return isHeadless; } >>>>>>> <<<<<<< /// <summary> /// This starts a new server. /// </summary> /// <returns>True if the server was started.</returns> ======= /// <summary> /// This starts a new server. /// <para>This uses the networkPort property as the listen port.</para> /// </summary> /// <returns></returns> >>>>>>> /// <summary> /// This starts a new server. /// <para>This uses the networkPort property as the listen port.</para> /// </summary> /// <returns></returns> <<<<<<< /// <summary> /// This starts a new network client. /// It uses the networkAddress and networkPort properties as the address to connect to. /// </summary> ======= /// <summary> /// This starts a network client. It uses the networkAddress and networkPort properties as the address to connect to. /// <para>This makes the newly created client connect to the server immediately.</para> /// </summary> >>>>>>> /// <summary> /// This starts a network client. It uses the networkAddress and networkPort properties as the address to connect to. /// <para>This makes the newly created client connect to the server immediately.</para> /// </summary> <<<<<<< /// <summary> /// This starts a network "host" - a server and client in the same application. /// </summary> ======= /// <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> /// </summary> >>>>>>> /// <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> /// </summary> <<<<<<< /// <summary> /// This causes the server to switch scenes and automatically sync the scenes. /// </summary> /// <param name="newSceneName">The name of the scene to change to.</param> ======= /// <summary> /// This causes the server to switch scenes and sets the networkSceneName. /// <para>Clients that connect to this server will automatically switch to this scene. This is called autmatically if onlineScene or offlineScene are set, but it can be called from user code to switch scenes again while the game is in progress. This automatically sets clients to be not-ready. The clients must call NetworkClient.Ready() again to participate in the new scene.</para> /// </summary> /// <param name="newSceneName"></param> >>>>>>> /// <summary> /// This causes the server to switch scenes and sets the networkSceneName. /// <para>Clients that connect to this server will automatically switch to this scene. This is called autmatically if onlineScene or offlineScene are set, but it can be called from user code to switch scenes again while the game is in progress. This automatically sets clients to be not-ready. The clients must call NetworkClient.Ready() again to participate in the new scene.</para> /// </summary> /// <param name="newSceneName"></param> <<<<<<< /// <summary> /// Register the transform of a game object as a player spawn location. /// </summary> /// <param name="start">Transform to register.</param> ======= /// <summary> /// Registers the transform of a game object as a player spawn location. /// <para>This is done automatically by NetworkStartPosition components, but can be done manually from user script code.</para> /// </summary> /// <param name="start">Transform to register.</param> >>>>>>> /// <summary> /// Registers the transform of a game object as a player spawn location. /// <para>This is done automatically by NetworkStartPosition components, but can be done manually from user script code.</para> /// </summary> /// <param name="start">Transform to register.</param> <<<<<<< /// <summary> /// Unregisters the transform of a game object as a player spawn location. /// </summary> /// <param name="start">Transform to unregister.</param> ======= /// <summary> /// Unregisters the transform of a game object as a player spawn location. /// <para>This is done automatically by the <see cref="NetworkStartPosition">NetworkStartPosition</see> component, but can be done manually from user code.</para> /// </summary> /// <param name="start">Transform to unregister.</param> >>>>>>> /// <summary> /// Unregisters the transform of a game object as a player spawn location. /// <para>This is done automatically by the <see cref="NetworkStartPosition">NetworkStartPosition</see> component, but can be done manually from user code.</para> /// </summary> /// <param name="start">Transform to unregister.</param> <<<<<<< /// <summary> /// Shuts down the NetworkManager completely and destroys the singleton. /// </summary> // this is the only way to clear the singleton, so another instance can be created. ======= /// <summary> /// Obsolete: Use NetworkClient.isConnected instead /// </summary> /// <returns>Returns True if NetworkClient.isConnected</returns> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient.isConnected instead")] public bool IsClientConnected() { return NetworkClient.isConnected; } /// <summary> /// This is the only way to clear the singleton, so another instance can be created. /// </summary> >>>>>>> /// <summary> /// This is the only way to clear the singleton, so another instance can be created. /// </summary> <<<<<<< /// <summary> /// Called on the server when a client is ready. /// </summary> /// <param name="conn">Connection from client.</param> ======= /// <summary> /// Called on the server when a client is ready. /// <para>The default implementation of this function calls NetworkServer.SetClientReady() to continue the network setup process.</para> /// </summary> /// <param name="conn">Connection from client.</param> >>>>>>> /// <summary> /// Called on the server when a client is ready. /// <para>The default implementation of this function calls NetworkServer.SetClientReady() to continue the network setup process.</para> /// </summary> /// <param name="conn">Connection from client.</param> <<<<<<< /// <summary> /// This finds a spawn position based on NetworkStartPosition objects in the Scene. /// </summary> /// <returns>Returns the transform to spawn a player at, or null.</returns> public Transform GetStartPosition() { // first remove any dead transforms startPositions.RemoveAll(t => t == null); ======= /// <summary> /// This finds a spawn position based on NetworkStartPosition objects in the scene. /// <para>This is used by the default implementation of OnServerAddPlayer.</para> /// </summary> /// <returns>Returns the transform to spawn a player at, or null.</returns> public Transform GetStartPosition() { // first remove any dead transforms startPositions.RemoveAll(t => t == null); >>>>>>> /// <summary> /// This finds a spawn position based on NetworkStartPosition objects in the scene. /// <para>This is used by the default implementation of OnServerAddPlayer.</para> /// </summary> /// <returns>Returns the transform to spawn a player at, or null.</returns> public Transform GetStartPosition() { // first remove any dead transforms startPositions.RemoveAll(t => t == null); <<<<<<< /// <summary> /// Called on the server when a client removes a player. /// </summary> /// <param name="conn">The connection to remove the player from.</param> /// <param name="player">The player controller to remove.</param> ======= /// <summary> /// Called on the server when a client removes a player. /// <para>The default implementation of this function destroys the corresponding player object.</para> /// </summary> /// <param name="conn">The connection to remove the player from.</param> /// <param name="player">The player controller to remove.</param> >>>>>>> /// <summary> /// Called on the server when a client removes a player. /// <para>The default implementation of this function destroys the corresponding player object.</para> /// </summary> /// <param name="conn">The connection to remove the player from.</param> /// <param name="player">The player controller to remove.</param> <<<<<<< /// <summary> /// Called on clients when disconnected from a server. /// </summary> /// <param name="conn">Connection to the server.</param> ======= /// <summary> /// Called on clients when disconnected from a server. /// <para>This is called on the client when it disconnects from the server. Override this function to decide what happens when the client disconnects.</para> /// </summary> /// <param name="conn">Connection to the server.</param> >>>>>>> /// <summary> /// Called on clients when disconnected from a server. /// <para>This is called on the client when it disconnects from the server. Override this function to decide what happens when the client disconnects.</para> /// </summary> /// <param name="conn">Connection to the server.</param> <<<<<<< public virtual void OnClientError(NetworkConnection conn, int errorCode) {} public virtual void OnClientNotReady(NetworkConnection conn) {} // Called from ClientChangeScene immediately before SceneManager.LoadSceneAsync is executed // This allows client to do work / cleanup / prep before the scene changes. public virtual void OnClientChangeScene(string newSceneName) {} /// <summary> /// Called on clients when a scene has completley loaded, when the scene load was initiated by the server. /// </summary> /// <param name="conn"> The network connection that the scene change message arrived on.</param> ======= /// <summary> /// Called on clients when a network error occurs. /// </summary> /// <param name="conn">Connection to a server.</param> /// <param name="errorCode">Error code.</param> public virtual void OnClientError(NetworkConnection conn, int errorCode) { } /// <summary> /// Called on clients when a servers tells the client it is no longer ready. /// <para>This is commonly used when switching scenes.</para> /// </summary> /// <param name="conn">Connection to a server.</param> public virtual void OnClientNotReady(NetworkConnection conn) { } /// <summary> /// Called from ClientChangeScene immediately before SceneManager.LoadSceneAsync is executed /// <para>This allows client to do work / cleanup / prep before the scene changes.</para> /// </summary> /// <param name="newSceneName">Name if the scene that's about to be loaded</param> public virtual void OnClientChangeScene(string newSceneName) { } /// <summary> /// Called on clients when a scene has completed loaded, when the scene load was initiated by the server. /// <para>Scene changes can cause player objects to be destroyed. The default implementation of OnClientSceneChanged in the NetworkManager is to add a player object for the connection if no player object exists.</para> /// </summary> /// <param name="conn">The network connection that the scene change message arrived on.</param> >>>>>>> /// <summary> /// Called on clients when a network error occurs. /// </summary> /// <param name="conn">Connection to a server.</param> /// <param name="errorCode">Error code.</param> public virtual void OnClientError(NetworkConnection conn, int errorCode) { } /// <summary> /// Called on clients when a servers tells the client it is no longer ready. /// <para>This is commonly used when switching scenes.</para> /// </summary> /// <param name="conn">Connection to a server.</param> public virtual void OnClientNotReady(NetworkConnection conn) { } /// <summary> /// Called from ClientChangeScene immediately before SceneManager.LoadSceneAsync is executed /// <para>This allows client to do work / cleanup / prep before the scene changes.</para> /// </summary> /// <param name="newSceneName">Name if the scene that's about to be loaded</param> public virtual void OnClientChangeScene(string newSceneName) { } /// <summary> /// Called on clients when a scene has completed loaded, when the scene load was initiated by the server. /// <para>Scene changes can cause player objects to be destroyed. The default implementation of OnClientSceneChanged in the NetworkManager is to add a player object for the connection if no player object exists.</para> /// </summary> /// <param name="conn">The network connection that the scene change message arrived on.</param>
<<<<<<< var networkReader = NetworkReaderPool.GetReader(payload); DeserializeFromReader(networkReader); NetworkReaderPool.Recycle(networkReader); ======= using (PooledNetworkReader networkReader = NetworkReaderPool.GetReader(payload)) DeserializeFromReader(networkReader); >>>>>>> using (PooledNetworkReader networkReader = NetworkReaderPool.GetReader(payload)) DeserializeFromReader(networkReader); <<<<<<< NetworkWriter writer = NetworkWriterPool.GetWriter(); SerializeIntoWriter(writer, TargetComponent.transform.localPosition, TargetComponent.transform.localRotation, compressRotation, TargetComponent.transform.localScale); ======= using (PooledNetworkWriter writer = NetworkWriterPool.GetWriter()) { SerializeIntoWriter(writer, targetComponent.transform.localPosition, targetComponent.transform.localRotation, compressRotation, targetComponent.transform.localScale); >>>>>>> using (PooledNetworkWriter writer = NetworkWriterPool.GetWriter()) { SerializeIntoWriter(writer, TargetComponent.transform.localPosition, TargetComponent.transform.localRotation, compressRotation, TargetComponent.transform.localScale);
<<<<<<< ======= >>>>>>> <<<<<<< identity.ConnectionToClient = ownerConnection; identity.Server = this; identity.Client = LocalClient; ======= identity.connectionToClient = (NetworkConnectionToClient)ownerConnection; >>>>>>> identity.ConnectionToClient = ownerConnection; identity.Server = this; identity.Client = LocalClient; <<<<<<< ======= identity.Reset(); >>>>>>> <<<<<<< if (logger.LogEnabled()) logger.Log("SpawnObjects sceneId:" + identity.sceneId.ToString("X") + " name:" + identity.gameObject.name); ======= if (LogFilter.Debug) Debug.Log("SpawnObjects sceneId:" + identity.sceneId.ToString("X") + " name:" + identity.gameObject.name); >>>>>>> if (logger.LogEnabled()) logger.Log("SpawnObjects sceneId:" + identity.sceneId.ToString("X") + " name:" + identity.gameObject.name);
<<<<<<< /// <summary> /// This starts a new network client. /// It uses the networkAddress and networkPort properties as the address to connect to. /// </summary> /// <returns>The client object created.</returns> public NetworkClient StartClient() ======= public void StartClient() >>>>>>> /// <summary> /// This starts a new network client. /// It uses the networkAddress and networkPort properties as the address to connect to. /// </summary> public void StartClient() <<<<<<< /// <summary> /// This starts a network "host" - a server and client in the same application. /// </summary> /// <returns>The client object created - this is a "local client".</returns> public virtual NetworkClient StartHost() ======= public virtual void StartHost() >>>>>>> /// <summary> /// This starts a network "host" - a server and client in the same application. /// </summary> public virtual void StartHost() <<<<<<< /// <summary> /// This checks if the NetworkManager has a client and that it is connected to the server. /// </summary> /// <returns>True if the NetworkManagers client is connected to a server.</returns> ======= [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient.isConnected instead")] >>>>>>> /// <summary> /// This checks if the NetworkManager has a client and that it is connected to the server. /// </summary> /// <returns>True if the NetworkManagers client is connected to a server.</returns> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient.isConnected instead")] <<<<<<< /// <summary> /// Shuts down the NetworkManager completely and destroys the singleton. /// </summary> ======= >>>>>>> /// <summary> /// Shuts down the NetworkManager completely and destroys the singleton. /// </summary> <<<<<<< /// <summary>Called when the client is started.</summary> ======= [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use OnStartClient() instead of OnStartClient(NetworkClient client). All NetworkClient functions are static now, so you can use NetworkClient.Send(message) instead of client.Send(message) directly now.")] >>>>>>> /// <summary>Called when the client is started.</summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use OnStartClient() instead of OnStartClient(NetworkClient client). All NetworkClient functions are static now, so you can use NetworkClient.Send(message) instead of client.Send(message) directly now.")] <<<<<<< /// <summary>Called when the server is stopped - including when a host is stopped.</summary> ======= public virtual void OnStartClient() { #pragma warning disable CS0618 // Type or member is obsolete OnStartClient(NetworkClient.singleton); #pragma warning restore CS0618 // Type or member is obsolete } >>>>>>> public virtual void OnStartClient() { #pragma warning disable CS0618 // Type or member is obsolete OnStartClient(NetworkClient.singleton); #pragma warning restore CS0618 // Type or member is obsolete } /// <summary>Called when the server is stopped - including when a host is stopped.</summary>
<<<<<<< var w = new NetworkWriter(); w.Write(new TestMessage(1, "2", 3.3)); ======= NetworkWriter w = new NetworkWriter(); w.WriteMessage(new TestMessage(1, "2", 3.3)); >>>>>>> var w = new NetworkWriter(); w.WriteMessage(new TestMessage(1, "2", 3.3)); <<<<<<< var w = new NetworkWriter(); w.Write(new WovenTestMessage { IntValue = 1, StringValue = "2", DoubleValue = 3.3 }); ======= NetworkWriter w = new NetworkWriter(); w.WriteMessage(new WovenTestMessage { IntValue = 1, StringValue = "2", DoubleValue = 3.3 }); >>>>>>> var w = new NetworkWriter(); w.WriteMessage(new WovenTestMessage { IntValue = 1, StringValue = "2", DoubleValue = 3.3 });
<<<<<<< SerializeIntoWriter(writer, TargetComponent.transform.localPosition, TargetComponent.transform.localRotation, compressRotation, TargetComponent.transform.localScale); ======= SerializeIntoWriter(writer, targetComponent.transform.localPosition, targetComponent.transform.localRotation, targetComponent.transform.localScale); >>>>>>> SerializeIntoWriter(writer, TargetComponent.transform.localPosition, TargetComponent.transform.localRotation, TargetComponent.transform.localScale); <<<<<<< // deserialize rotation if (compressRotation == Compression.None) { // read 3 floats = 16 byte float x = reader.ReadSingle(); float y = reader.ReadSingle(); float z = reader.ReadSingle(); temp.LocalRotation = Quaternion.Euler(x, y, z); } else if (compressRotation == Compression.Much) { // read 3 byte. scaling [0,255] to [0,360] float x = FloatBytePacker.ScaleByteToFloat(reader.ReadByte(), byte.MinValue, byte.MaxValue, 0, 360); float y = FloatBytePacker.ScaleByteToFloat(reader.ReadByte(), byte.MinValue, byte.MaxValue, 0, 360); float z = FloatBytePacker.ScaleByteToFloat(reader.ReadByte(), byte.MinValue, byte.MaxValue, 0, 360); temp.LocalRotation = Quaternion.Euler(x, y, z); } else if (compressRotation == Compression.Lots) { // read 2 byte, 5 bits per float Vector3 xyz = FloatBytePacker.UnpackUShortIntoThreeFloats(reader.ReadUInt16(), 0, 360); temp.LocalRotation = Quaternion.Euler(xyz.x, xyz.y, xyz.z); } temp.LocalScale = reader.ReadVector3(); ======= // deserialize rotation & scale temp.localRotation = reader.ReadQuaternion(); temp.localScale = reader.ReadVector3(); >>>>>>> // deserialize rotation & scale temp.LocalRotation = reader.ReadQuaternion(); temp.LocalScale = reader.ReadVector3(); <<<<<<< TargetComponent.transform.localPosition = position; if (Compression.NoRotation != compressRotation) { TargetComponent.transform.localRotation = rotation; } TargetComponent.transform.localScale = scale; ======= targetComponent.transform.localPosition = position; targetComponent.transform.localRotation = rotation; targetComponent.transform.localScale = scale; >>>>>>> TargetComponent.transform.localPosition = position; TargetComponent.transform.localRotation = rotation; TargetComponent.transform.localScale = scale; <<<<<<< SerializeIntoWriter(writer, TargetComponent.transform.localPosition, TargetComponent.transform.localRotation, compressRotation, TargetComponent.transform.localScale); ======= SerializeIntoWriter(writer, targetComponent.transform.localPosition, targetComponent.transform.localRotation, targetComponent.transform.localScale); >>>>>>> SerializeIntoWriter(writer, targetComponent.transform.localPosition, targetComponent.transform.localRotation, targetComponent.transform.localScale);
<<<<<<< using System.Text; ======= using Microsoft.Toolkit.Uwp.UI.Extensions; >>>>>>> using System.Text; using Microsoft.Toolkit.Uwp.UI.Extensions;
<<<<<<< using System.Threading.Tasks; using Mirror; ======= >>>>>>> using System.Threading.Tasks; using Mirror; <<<<<<< ======= class NetworkManagerTest : NetworkManager { public override void Awake() { transport = gameObject.AddComponent<TelepathyTransport>(); playerPrefab = new GameObject("testPlayerPrefab", typeof(NetworkIdentity)); base.Awake(); } public override void OnDestroy() { base.OnDestroy(); // clean up new object created in awake Destroy(playerPrefab); } } >>>>>>> class NetworkManagerTest : NetworkManager { public override void Awake() { transport = gameObject.AddComponent<TelepathyTransport>(); playerPrefab = new GameObject("testPlayerPrefab", typeof(NetworkIdentity)); base.Awake(); } public override void OnDestroy() { base.OnDestroy(); // clean up new object created in awake Destroy(playerPrefab); } }
<<<<<<< Object.DestroyImmediate(gameObject); Object.DestroyImmediate(networkManagerGameObject); ======= // clean up NetworkIdentity.spawned.Clear(); GameObject.DestroyImmediate(gameObject); >>>>>>> NetworkIdentity.spawned.Clear(); Object.DestroyImmediate(gameObject); Object.DestroyImmediate(networkManagerGameObject);
<<<<<<< // T oldValue = value; var oldValue = new VariableDefinition(syncVar.FieldType); deserialize.Body.Variables.Add(oldValue); ======= if (hookMethod != null) { // call hook // but only if SyncVar changed. otherwise a client would // get hook calls for all initial values, even if they // didn't change from the default values on the client. // see also: https://github.com/vis2k/Mirror/issues/1278 // Generates: if (!SyncVarEqual); Instruction syncVarEqualLabel = serWorker.Create(OpCodes.Nop); // 'this.' for 'this.SyncVarEqual' >>>>>>> if (hookMethod != null) { // call hook // but only if SyncVar changed. otherwise a client would // get hook calls for all initial values, even if they // didn't change from the default values on the client. // see also: https://github.com/vis2k/Mirror/issues/1278 // Generates: if (!SyncVarEqual); Instruction syncVarEqualLabel = serWorker.Create(OpCodes.Nop); // 'this.' for 'this.SyncVarEqual' <<<<<<< // reader. for 'reader.Read()' below serWorker.Append(serWorker.Create(OpCodes.Ldarg_1)); // reader.Read() serWorker.Append(serWorker.Create(OpCodes.Call, readFunc)); // syncvar serWorker.Append(serWorker.Create(OpCodes.Stfld, syncVar)); if (hookMethod != null) { // call hook // but only if SyncVar changed. otherwise a client would // get hook calls for all initial values, even if they // didn't change from the default values on the client. // see also: https://github.com/vis2k/Mirror/issues/1278 // Generates: if (!SyncVarEqual); Instruction syncVarEqualLabel = serWorker.Create(OpCodes.Nop); // 'this.' for 'this.SyncVarEqual' serWorker.Append(serWorker.Create(OpCodes.Ldarg_0)); // 'oldValue' serWorker.Append(serWorker.Create(OpCodes.Ldloc, oldValue)); // 'ref this.syncVar' serWorker.Append(serWorker.Create(OpCodes.Ldarg_0)); serWorker.Append(serWorker.Create(OpCodes.Ldflda, syncVar)); // call the function var syncVarEqualGm = new GenericInstanceMethod(Weaver.syncVarEqualReference); syncVarEqualGm.GenericArguments.Add(syncVar.FieldType); serWorker.Append(serWorker.Create(OpCodes.Call, syncVarEqualGm)); serWorker.Append(serWorker.Create(OpCodes.Brtrue, syncVarEqualLabel)); // call the hook // this. serWorker.Append(serWorker.Create(OpCodes.Ldarg_0)); // oldvalue serWorker.Append(serWorker.Create(OpCodes.Ldloc, oldValue)); // this. serWorker.Append(serWorker.Create(OpCodes.Ldarg_0)); // syncvar.get serWorker.Append(serWorker.Create(OpCodes.Ldfld, syncVar)); serWorker.Append(serWorker.Create(OpCodes.Callvirt, hookMethod)); // Generates: end if (!SyncVarEqual); serWorker.Append(syncVarEqualLabel); } ======= serWorker.Append(serWorker.Create(OpCodes.Ldflda, syncVar)); // call the function GenericInstanceMethod syncVarEqualGm = new GenericInstanceMethod(Weaver.syncVarEqualReference); syncVarEqualGm.GenericArguments.Add(syncVar.FieldType); serWorker.Append(serWorker.Create(OpCodes.Call, syncVarEqualGm)); serWorker.Append(serWorker.Create(OpCodes.Brtrue, syncVarEqualLabel)); // call the hook // Generates: OnValueChanged(oldValue, this.syncVar); SyncVarProcessor.WriteCallHookMethodUsingField(serWorker, hookMethod, oldValue, syncVar); // Generates: end if (!SyncVarEqual); serWorker.Append(syncVarEqualLabel); >>>>>>> serWorker.Append(serWorker.Create(OpCodes.Ldflda, syncVar)); // call the function var syncVarEqualGm = new GenericInstanceMethod(Weaver.syncVarEqualReference); syncVarEqualGm.GenericArguments.Add(syncVar.FieldType); serWorker.Append(serWorker.Create(OpCodes.Call, syncVarEqualGm)); serWorker.Append(serWorker.Create(OpCodes.Brtrue, syncVarEqualLabel)); // call the hook // Generates: OnValueChanged(oldValue, this.syncVar); SyncVarProcessor.WriteCallHookMethodUsingField(serWorker, hookMethod, oldValue, syncVar); // Generates: end if (!SyncVarEqual); serWorker.Append(syncVarEqualLabel);
<<<<<<< if (GUILayout.Button("Server Only")) { _ = manager.StartServer(); } ======= manager.StartHost(); >>>>>>> _ = manager.StartHost(); <<<<<<< // Connecting GUILayout.Label("Connecting to " + serverIp + ".."); if (GUILayout.Button("Cancel Connection Attempt")) { manager.StopClient(); } ======= if (GUILayout.Button("Server Only")) manager.StartServer(); >>>>>>> if (GUILayout.Button("Server Only")) { _ = manager.StartServer(); }
<<<<<<< void Awake() { NetIdentity.OnStartServer.AddListener(OnStartServer); } public void OnStartServer() ======= [Header("Game Stats")] public int damage; public GameObject source; public override void OnStartServer() >>>>>>> void Awake() { NetIdentity.OnStartServer.AddListener(OnStartServer); } [Header("Game Stats")] public int damage; public GameObject source; public void OnStartServer() <<<<<<< Server.Destroy(gameObject); ======= //Hit another player if (co.tag.Equals("Player") && co.gameObject != source) { //Apply damage co.GetComponent<Tank>().health -= damage; //update score on source source.GetComponent<Tank>().score += damage; } NetworkServer.Destroy(gameObject); >>>>>>> //Hit another player if (co.tag.Equals("Player") && co.gameObject != source) { //Apply damage co.GetComponent<Tank>().health -= damage; //update score on source source.GetComponent<Tank>().score += damage; } Server.Destroy(gameObject);
<<<<<<< // all the [Rpc] code from NetworkBehaviourProcessor in one place using Mono.Cecil; using Mono.Cecil.Cil; ======= using Mono.CecilX; using Mono.CecilX.Cil; >>>>>>> using Mono.Cecil; using Mono.Cecil.Cil;
<<<<<<< public Animator Animator; ======= [Header("Animator")] [Tooltip("Animator that will have parameters synchronized")] public Animator animator; >>>>>>> [Header("Animator")] [Tooltip("Animator that will have parameters synchronized")] public Animator Animator; <<<<<<< [Tooltip("Set to true if animations come from owner client, set to false if animations always come from server")] public bool ClientAuthority; ======= >>>>>>>
<<<<<<< var genericInstanceMethod = new GenericInstanceMethod(Weaver.ScriptableObjectCreateInstanceMethod); ======= GenericInstanceMethod genericInstanceMethod = new GenericInstanceMethod(WeaverTypes.ScriptableObjectCreateInstanceMethod); >>>>>>> var genericInstanceMethod = new GenericInstanceMethod(WeaverTypes.ScriptableObjectCreateInstanceMethod);
<<<<<<< readonly Dictionary<FieldDefinition, FieldDefinition> syncVarNetIds = new Dictionary<FieldDefinition, FieldDefinition>(); readonly List<CmdResult> serverRpcs = new List<CmdResult>(); ======= Dictionary<FieldDefinition, FieldDefinition> syncVarNetIds = new Dictionary<FieldDefinition, FieldDefinition>(); readonly List<CmdResult> commands = new List<CmdResult>(); >>>>>>> Dictionary<FieldDefinition, FieldDefinition> syncVarNetIds = new Dictionary<FieldDefinition, FieldDefinition>(); readonly List<CmdResult> serverRpcs = new List<CmdResult>(); <<<<<<< readonly List<EventDefinition> eventRpcs = new List<EventDefinition>(); readonly List<MethodDefinition> serverRpcSkeletonFuncs = new List<MethodDefinition>(); readonly List<MethodDefinition> clientRpcSkeletonFuncs = new List<MethodDefinition>(); readonly List<MethodDefinition> eventRpcInvocationFuncs = new List<MethodDefinition>(); ======= readonly List<MethodDefinition> targetRpcs = new List<MethodDefinition>(); readonly List<MethodDefinition> commandInvocationFuncs = new List<MethodDefinition>(); readonly List<MethodDefinition> clientRpcInvocationFuncs = new List<MethodDefinition>(); readonly List<MethodDefinition> targetRpcInvocationFuncs = new List<MethodDefinition>(); >>>>>>> readonly List<MethodDefinition> serverRpcSkeletonFuncs = new List<MethodDefinition>(); readonly List<MethodDefinition> clientRpcSkeletonFuncs = new List<MethodDefinition>(); <<<<<<< worker.Append(worker.Create(OpCodes.Ldarg_0)); worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkBehaviourGetIdentity)); worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkIdentityGetClient)); worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkClientGetActive)); ======= worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkClientGetActive)); >>>>>>> worker.Append(worker.Create(OpCodes.Ldarg_0)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkBehaviourGetIdentity)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkIdentityGetClient)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkClientGetActive)); <<<<<<< worker.Append(worker.Create(OpCodes.Ldarg_0)); worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkBehaviourGetIdentity)); worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkIdentityGetServer)); worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkServerGetActive)); ======= worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkServerGetActive)); >>>>>>> worker.Append(worker.Create(OpCodes.Ldarg_0)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkBehaviourGetIdentity)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkIdentityGetServer)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.NetworkServerGetActive)); <<<<<<< var versionMethod = new MethodDefinition(ProcessedFunctionName, MethodAttributes.Private, Weaver.voidType); ======= MethodDefinition versionMethod = new MethodDefinition(ProcessedFunctionName, MethodAttributes.Private, WeaverTypes.voidType); >>>>>>> var versionMethod = new MethodDefinition(ProcessedFunctionName, MethodAttributes.Private, WeaverTypes.voidType); <<<<<<< if (serverRpcs.Count == 0 && clientRpcs.Count == 0 && eventRpcs.Count == 0 && syncObjects.Count == 0) ======= if (commands.Count == 0 && clientRpcs.Count == 0 && targetRpcs.Count == 0 && syncObjects.Count == 0) >>>>>>> if (serverRpcs.Count == 0 && clientRpcs.Count == 0 && syncObjects.Count == 0) <<<<<<< CmdResult cmdResult = serverRpcs[i]; GenerateRegisterServerRpcDelegate(cctorWorker, Weaver.registerServerRpcDelegateReference, serverRpcSkeletonFuncs[i], cmdResult); ======= CmdResult cmdResult = commands[i]; GenerateRegisterCommandDelegate(cctorWorker, WeaverTypes.registerCommandDelegateReference, commandInvocationFuncs[i], cmdResult); >>>>>>> CmdResult cmdResult = serverRpcs[i]; GenerateRegisterServerRpcDelegate(cctorWorker, WeaverTypes.registerServerRpcDelegateReference, serverRpcSkeletonFuncs[i], cmdResult); <<<<<<< GenerateRegisterRemoteDelegate(cctorWorker, Weaver.registerRpcDelegateReference, clientRpcSkeletonFuncs[i], clientRpcResult.method.Name); } for (int i = 0; i < eventRpcs.Count; ++i) { GenerateRegisterRemoteDelegate(cctorWorker, Weaver.registerEventDelegateReference, eventRpcInvocationFuncs[i], eventRpcs[i].Name); ======= GenerateRegisterRemoteDelegate(cctorWorker, WeaverTypes.registerRpcDelegateReference, clientRpcInvocationFuncs[i], clientRpcResult.method.Name); } for (int i = 0; i < targetRpcs.Count; ++i) { GenerateRegisterRemoteDelegate(cctorWorker, WeaverTypes.registerRpcDelegateReference, targetRpcInvocationFuncs[i], targetRpcs[i].Name); >>>>>>> GenerateRegisterRemoteDelegate(cctorWorker, WeaverTypes.registerRpcDelegateReference, clientRpcSkeletonFuncs[i], clientRpcResult.method.Name); <<<<<<< var dirtyLocal = new VariableDefinition(Weaver.boolType); ======= VariableDefinition dirtyLocal = new VariableDefinition(WeaverTypes.boolType); >>>>>>> var dirtyLocal = new VariableDefinition(WeaverTypes.boolType); <<<<<<< ======= if (Weaver.GenerateLogErrors) { worker.Append(worker.Create(OpCodes.Ldstr, "Injected Serialize " + netBehaviourSubclass.Name)); worker.Append(worker.Create(OpCodes.Call, WeaverTypes.logErrorReference)); } >>>>>>> <<<<<<< var oldNetId = new VariableDefinition(Weaver.uint32Type); ======= VariableDefinition oldNetId = new VariableDefinition(WeaverTypes.uint32Type); >>>>>>> var oldNetId = new VariableDefinition(WeaverTypes.uint32Type); <<<<<<< var syncVarEqualGm = new GenericInstanceMethod(Weaver.syncVarEqualReference); ======= GenericInstanceMethod syncVarEqualGm = new GenericInstanceMethod(WeaverTypes.syncVarEqualReference); >>>>>>> var syncVarEqualGm = new GenericInstanceMethod(WeaverTypes.syncVarEqualReference); <<<<<<< var syncVarEqualGm = new GenericInstanceMethod(Weaver.syncVarEqualReference); ======= GenericInstanceMethod syncVarEqualGm = new GenericInstanceMethod(WeaverTypes.syncVarEqualReference); >>>>>>> var syncVarEqualGm = new GenericInstanceMethod(WeaverTypes.syncVarEqualReference); <<<<<<< var dirtyBitsLocal = new VariableDefinition(Weaver.int64Type); ======= VariableDefinition dirtyBitsLocal = new VariableDefinition(WeaverTypes.int64Type); >>>>>>> var dirtyBitsLocal = new VariableDefinition(WeaverTypes.int64Type); <<<<<<< ======= if (Weaver.GenerateLogErrors) { serWorker.Append(serWorker.Create(OpCodes.Ldstr, "Injected Deserialize " + netBehaviourSubclass.Name)); serWorker.Append(serWorker.Create(OpCodes.Call, WeaverTypes.logErrorReference)); } >>>>>>> <<<<<<< collection.Add(new ParameterDefinition("obj", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(Weaver.NetworkBehaviourType))); collection.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(Weaver.NetworkReaderType))); // senderConnection is only used for ServerRpcs but NetworkBehaviour.CmdDelegate is used for all remote calls collection.Add(new ParameterDefinition("senderConnection", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(Weaver.INetworkConnectionType))); ======= collection.Add(new ParameterDefinition("obj", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkBehaviourType))); collection.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkReaderType))); // senderConnection is only used for commands but NetworkBehaviour.CmdDelegate is used for all remote calls collection.Add(new ParameterDefinition("senderConnection", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkConnectionType))); >>>>>>> collection.Add(new ParameterDefinition("obj", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkBehaviourType))); collection.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkReaderType))); // senderConnection is only used for ServerRpcs but NetworkBehaviour.CmdDelegate is used for all remote calls collection.Add(new ParameterDefinition("senderConnection", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.INetworkConnectionType))); <<<<<<< ======= bool isNetworkConnection = param.ParameterType.FullName == WeaverTypes.NetworkConnectionType.FullName; bool isSenderConnection = IsSenderConnection(param, callType); >>>>>>> <<<<<<< if (ca.AttributeType.FullName == Weaver.ServerRpcType.FullName) ======= if (ca.AttributeType.FullName == WeaverTypes.CommandType.FullName) { ProcessCommand(names, md, ca); break; } if (ca.AttributeType.FullName == WeaverTypes.TargetRpcType.FullName) >>>>>>> if (ca.AttributeType.FullName == WeaverTypes.ServerRpcType.FullName) <<<<<<< ======= } if (!ValidateRemoteCallAndParameters(md, RemoteCallType.ClientRpc)) { return; } >>>>>>> <<<<<<< MethodDefinition userCodeFunc = RpcProcessor.GenerateStub(md, clientRpcAttr); ======= MethodDefinition rpcCallFunc = RpcProcessor.ProcessRpcCall(netBehaviourSubclass, md, clientRpcAttr); // need null check here because ProcessRpcCall returns null if it can't write all the args if (rpcCallFunc == null) { return; } MethodDefinition rpcFunc = RpcProcessor.ProcessRpcInvoke(netBehaviourSubclass, md, rpcCallFunc); if (rpcFunc != null) { clientRpcInvocationFuncs.Add(rpcFunc); } } void ProcessTargetRpc(HashSet<string> names, MethodDefinition md, CustomAttribute targetRpcAttr) { if (md.IsAbstract) { Weaver.Error("Abstract TargetRpc are currently not supported, use virtual method instead", md); return; } if (!ValidateRemoteCallAndParameters(md, RemoteCallType.TargetRpc)) return; if (names.Contains(md.Name)) { Weaver.Error($"Duplicate Target Rpc name {md.Name}", md); return; } names.Add(md.Name); targetRpcs.Add(md); MethodDefinition rpcCallFunc = TargetRpcProcessor.ProcessTargetRpcCall(netBehaviourSubclass, md, targetRpcAttr); >>>>>>> MethodDefinition userCodeFunc = RpcProcessor.GenerateStub(md, clientRpcAttr); <<<<<<< if (!ServerRpcProcessor.Validate(md)) ======= if (md.IsAbstract) { Weaver.Error("Abstract Commands are currently not supported, use virtual method instead", md); return; } if (!ValidateRemoteCallAndParameters(md, RemoteCallType.Command)) >>>>>>> if (md.IsAbstract) { Weaver.Error("Abstract ServerRpcs are currently not supported, use virtual method instead", md); return; } if (!ValidateRemoteCallAndParameters(md, RemoteCallType.ServerRpc))
<<<<<<< var versionMethod = new MethodDefinition(ProcessedFunctionName, MethodAttributes.Private, WeaverTypes.voidType); ======= MethodDefinition versionMethod = new MethodDefinition(ProcessedFunctionName, MethodAttributes.Private, WeaverTypes.Import(typeof(void))); >>>>>>> var versionMethod = new MethodDefinition(ProcessedFunctionName, MethodAttributes.Private, WeaverTypes.Import(typeof(void))); <<<<<<< var dirtyLocal = new VariableDefinition(WeaverTypes.boolType); ======= VariableDefinition dirtyLocal = new VariableDefinition(WeaverTypes.Import<bool>()); >>>>>>> var dirtyLocal = new VariableDefinition(WeaverTypes.Import<bool>()); <<<<<<< var oldNetId = new VariableDefinition(WeaverTypes.uint32Type); ======= VariableDefinition oldNetId = new VariableDefinition(WeaverTypes.Import<uint>()); >>>>>>> var oldNetId = new VariableDefinition(WeaverTypes.Import<uint>()); <<<<<<< var dirtyBitsLocal = new VariableDefinition(WeaverTypes.int64Type); ======= VariableDefinition dirtyBitsLocal = new VariableDefinition(WeaverTypes.Import<long>()); >>>>>>> var dirtyBitsLocal = new VariableDefinition(WeaverTypes.Import<long>()); <<<<<<< collection.Add(new ParameterDefinition("obj", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkBehaviourType))); collection.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.NetworkReaderType))); // senderConnection is only used for ServerRpcs but NetworkBehaviour.CmdDelegate is used for all remote calls collection.Add(new ParameterDefinition("senderConnection", ParameterAttributes.None, Weaver.CurrentAssembly.MainModule.ImportReference(WeaverTypes.INetworkConnectionType))); ======= collection.Add(new ParameterDefinition("obj", ParameterAttributes.None, WeaverTypes.Import<Mirror.NetworkBehaviour>())); collection.Add(new ParameterDefinition("reader", ParameterAttributes.None, WeaverTypes.Import<Mirror.NetworkReader>())); // senderConnection is only used for commands but NetworkBehaviour.CmdDelegate is used for all remote calls collection.Add(new ParameterDefinition("senderConnection", ParameterAttributes.None, WeaverTypes.Import<Mirror.NetworkConnection>())); >>>>>>> collection.Add(new ParameterDefinition("obj", ParameterAttributes.None, WeaverTypes.Import<Mirror.NetworkBehaviour>())); collection.Add(new ParameterDefinition("reader", ParameterAttributes.None, WeaverTypes.Import<Mirror.NetworkReader>())); // senderConnection is only used for commands but NetworkBehaviour.CmdDelegate is used for all remote calls collection.Add(new ParameterDefinition("senderConnection", ParameterAttributes.None, WeaverTypes.Import<Mirror.INetworkConnection>())); <<<<<<< ======= bool isNetworkConnection = param.ParameterType.Is<Mirror.NetworkConnection>(); bool isSenderConnection = IsSenderConnection(param, callType); >>>>>>> <<<<<<< return type.Resolve().ImplementsInterface(WeaverTypes.INetworkConnectionType); ======= if (callType != RemoteCallType.Command) { return false; } TypeReference type = param.ParameterType; return type.Is<Mirror.NetworkConnectionToClient>() || type.Resolve().IsDerivedFrom<Mirror.NetworkConnectionToClient>(); >>>>>>> return type.Resolve().ImplementsInterface<Mirror.INetworkConnection>();
<<<<<<< if (RoomSlots.Count == maxConnections) return; ======= if (roomSlots.Count == maxConnections) return; >>>>>>> if (RoomSlots.Count == maxConnections) return; <<<<<<< ======= // Deprecated 02/22/2020 /// <summary> /// Obsolete: Use <see cref="OnRoomServerSceneLoadedForPlayer(NetworkConnection, GameObject, GameObject)"/> instead. /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use OnRoomServerSceneLoadedForPlayer(NetworkConnection conn, GameObject roomPlayer, GameObject gamePlayer) instead")] public virtual bool OnRoomServerSceneLoadedForPlayer(GameObject roomPlayer, GameObject gamePlayer) { return true; } >>>>>>>
<<<<<<< server.SpawnObjects(); Debug.Log("Respawned Server objects after additive scene load: " + scene.name); ======= NetworkServer.SpawnObjects(); if (LogFilter.Debug) Debug.Log("Respawned Server objects after additive scene load: " + scene.name); >>>>>>> server.SpawnObjects(); if (LogFilter.Debug) Debug.Log("Respawned Server objects after additive scene load: " + scene.name); <<<<<<< client.PrepareToSpawnSceneObjects(); Debug.Log("Rebuild Client spawnableObjects after additive scene load: " + scene.name); ======= ClientScene.PrepareToSpawnSceneObjects(); if (LogFilter.Debug) Debug.Log("Rebuild Client spawnableObjects after additive scene load: " + scene.name); >>>>>>> client.PrepareToSpawnSceneObjects(); if (LogFilter.Debug) Debug.Log("Rebuild Client spawnableObjects after additive scene load: " + scene.name);
<<<<<<< using System.Linq; using Mono.Cecil; ======= using System; using Mono.CecilX; >>>>>>> using System; using Mono.Cecil; using UnityEngine; <<<<<<< // Network types public static TypeReference NetworkBehaviourType; public static TypeReference RemoteCallHelperType; public static TypeReference MonoBehaviourType; public static TypeReference ScriptableObjectType; public static TypeReference INetworkConnectionType; public static TypeReference MessageBaseType; public static TypeReference IMessageBaseType; public static TypeReference SyncListType; public static TypeReference SyncSetType; public static TypeReference SyncDictionaryType; ======= >>>>>>> <<<<<<< public static TypeReference NetworkIdentityType; public static TypeReference IEnumeratorType; public static MethodReference BehaviorConnectionToServerReference; ======= public static MethodReference ReadyConnectionReference; >>>>>>> public static MethodReference BehaviorConnectionToServerReference; <<<<<<< public static TypeReference SyncVarType; public static TypeReference ServerRpcType; public static TypeReference ClientRpcType; public static TypeReference SyncEventType; public static TypeReference SyncObjectType; ======= >>>>>>> <<<<<<< public static void SetupUnityTypes(AssemblyDefinition unityAssembly, AssemblyDefinition mirrorAssembly) { gameObjectType = unityAssembly.MainModule.GetType("UnityEngine.GameObject"); transformType = unityAssembly.MainModule.GetType("UnityEngine.Transform"); NetworkClientType = mirrorAssembly.MainModule.GetType("Mirror.NetworkClient"); NetworkServerType = mirrorAssembly.MainModule.GetType("Mirror.NetworkServer"); SyncVarType = mirrorAssembly.MainModule.GetType("Mirror.SyncVarAttribute"); ServerRpcType = mirrorAssembly.MainModule.GetType("Mirror.ServerRpcAttribute"); ClientRpcType = mirrorAssembly.MainModule.GetType("Mirror.ClientRpcAttribute"); SyncObjectType = mirrorAssembly.MainModule.GetType("Mirror.ISyncObject"); } static ModuleDefinition ResolveSystemModule(AssemblyDefinition currentAssembly) { var name = AssemblyNameReference.Parse("mscorlib"); var parameters = new ReaderParameters { AssemblyResolver = currentAssembly.MainModule.AssemblyResolver }; return currentAssembly.MainModule.AssemblyResolver.Resolve(name, parameters).MainModule; } ======= public static TypeReference Import<T>() => Import(typeof(T)); >>>>>>> public static TypeReference Import<T>() => Import(typeof(T)); <<<<<<< ModuleDefinition systemModule = ResolveSystemModule(currentAssembly); voidType = ImportSystemModuleType(currentAssembly, systemModule,"System.Void"); singleType = ImportSystemModuleType(currentAssembly, systemModule,"System.Single"); doubleType = ImportSystemModuleType(currentAssembly, systemModule,"System.Double"); boolType = ImportSystemModuleType(currentAssembly, systemModule,"System.Boolean"); int64Type = ImportSystemModuleType(currentAssembly, systemModule,"System.Int64"); uint64Type = ImportSystemModuleType(currentAssembly, systemModule,"System.UInt64"); int32Type = ImportSystemModuleType(currentAssembly, systemModule,"System.Int32"); uint32Type = ImportSystemModuleType(currentAssembly, systemModule,"System.UInt32"); objectType = ImportSystemModuleType(currentAssembly, systemModule,"System.Object"); typeType = ImportSystemModuleType(currentAssembly, systemModule,"System.Type"); IEnumeratorType = ImportSystemModuleType(currentAssembly, systemModule,"System.Collections.IEnumerator"); ArraySegmentType = ImportSystemModuleType(currentAssembly, systemModule,"System.ArraySegment`1"); ======= WeaverTypes.currentAssembly = currentAssembly; TypeReference ArraySegmentType = Import(typeof(System.ArraySegment<>)); >>>>>>> WeaverTypes.currentAssembly = currentAssembly; TypeReference ArraySegmentType = Import(typeof(ArraySegment<>)); <<<<<<< NetworkReaderType = mirrorAssembly.MainModule.GetType("Mirror.NetworkReader"); NetworkWriterType = mirrorAssembly.MainModule.GetType("Mirror.NetworkWriter"); TypeReference pooledNetworkWriterTmp = mirrorAssembly.MainModule.GetType("Mirror.PooledNetworkWriter"); PooledNetworkWriterType = currentAssembly.MainModule.ImportReference(pooledNetworkWriterTmp); NetworkServerGetActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_Active"); NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_LocalClientActive"); NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, currentAssembly, "get_Active"); ======= TypeReference NetworkServerType = Import(typeof(Mirror.NetworkServer)); NetworkServerGetActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_active"); NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_localClientActive"); TypeReference NetworkClientType = Import(typeof(Mirror.NetworkClient)); NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, currentAssembly, "get_active"); >>>>>>> TypeReference NetworkServerType = Import<NetworkServer>(); NetworkServerGetActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_Active"); NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_LocalClientActive"); TypeReference NetworkClientType = Import<NetworkClient>(); NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, currentAssembly, "get_Active"); <<<<<<< TypeDefinition MethodInvocationException = mirrorAssembly.MainModule.GetType("Mirror.MethodInvocationException"); MethodInvocationExceptionConstructor = Resolvers.ResolveMethodWithArg(MethodInvocationException, currentAssembly, ".ctor", "System.String"); MessageBaseType = mirrorAssembly.MainModule.GetType("Mirror.MessageBase"); IMessageBaseType = mirrorAssembly.MainModule.GetType("Mirror.IMessageBase"); SyncListType = mirrorAssembly.MainModule.GetType("Mirror.SyncList`1"); SyncSetType = mirrorAssembly.MainModule.GetType("Mirror.SyncSet`1"); SyncDictionaryType = mirrorAssembly.MainModule.GetType("Mirror.SyncDictionary`2"); NetworkBehaviourDirtyBitsReference = Resolvers.ResolveProperty(NetworkBehaviourType, currentAssembly, "SyncVarDirtyBits"); TypeDefinition NetworkWriterPoolType = mirrorAssembly.MainModule.GetType("Mirror.NetworkWriterPool"); ======= NetworkBehaviourDirtyBitsReference = Resolvers.ResolveProperty(NetworkBehaviourType, currentAssembly, "syncVarDirtyBits"); TypeReference NetworkWriterPoolType = Import(typeof(Mirror.NetworkWriterPool)); >>>>>>> TypeReference MethodInvocationExceptionType = Import<MethodInvocationException>(); MethodInvocationExceptionConstructor = Resolvers.ResolveMethodWithArg(MethodInvocationExceptionType, currentAssembly, ".ctor", "System.String"); NetworkBehaviourDirtyBitsReference = Resolvers.ResolveProperty(NetworkBehaviourType, currentAssembly, "SyncVarDirtyBits"); TypeReference NetworkWriterPoolType = Import(typeof(NetworkWriterPool)); <<<<<<< ComponentType = unityAssembly.MainModule.GetType("UnityEngine.Component"); BehaviorConnectionToServerReference = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "get_ConnectionToServer"); ObjectType = unityAssembly.MainModule.GetType("UnityEngine.Object"); ======= TypeReference ClientSceneType = Import(typeof(Mirror.ClientScene)); ReadyConnectionReference = Resolvers.ResolveMethod(ClientSceneType, currentAssembly, "get_readyConnection"); >>>>>>> BehaviorConnectionToServerReference = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "get_ConnectionToServer"); <<<<<<< logErrorReference = Resolvers.ResolveMethod(unityAssembly.MainModule.GetType("UnityEngine.Debug"), currentAssembly, "LogError"); logWarningReference = Resolvers.ResolveMethod(unityAssembly.MainModule.GetType("UnityEngine.Debug"), currentAssembly, "LogWarning"); sendServerRpcInternal = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "SendServerRpcInternal"); ======= sendCommandInternal = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "SendCommandInternal"); >>>>>>> sendServerRpcInternal = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "SendServerRpcInternal");
<<<<<<< GUILayout.Label(NetworkManager.transport.ToString()); ======= GUILayout.Label("Connecting to " + manager.networkAddress + ".."); >>>>>>> GUILayout.Label("Connecting to " + manager.networkAddress + ".."); <<<<<<< GUILayout.Label(NetworkManager.transport.ToString()); ======= GUILayout.Label("Server: active. Transport: " + manager.transport); } if (manager.IsClientConnected()) { GUILayout.Label("Client: address=" + manager.networkAddress); >>>>>>> GUILayout.Label("Client: address=" + manager.networkAddress);
<<<<<<< ======= // this is always true for regular connections, false for local // connections because it's set in the constructor and never reset. [EditorBrowsable(EditorBrowsableState.Never), Obsolete("isConnected will be removed because it's pointless. A NetworkConnection is always connected.")] public bool isConnected { get; protected set; } // this is always 0 for regular connections, -1 for local // connections because it's set in the constructor and never reset. [EditorBrowsable(EditorBrowsableState.Never), Obsolete("hostId will be removed because it's not needed ever since we removed LLAPI as default. It's always 0 for regular connections and -1 for local connections. Use connection.GetType() == typeof(NetworkConnection) to check if it's a regular or local connection.")] public int hostId = -1; /// <summary> /// Creates a new NetworkConnection with the specified address /// </summary> /// <param name="networkAddress"></param> >>>>>>> /// <summary> /// Creates a new NetworkConnection with the specified address /// </summary> /// <param name="networkAddress"></param> <<<<<<< ======= /// <summary> /// Obsolete: Use NetworkClient/NetworkServer.RegisterHandler<T> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient/NetworkServer.RegisterHandler<T> instead")] public void RegisterHandler(short msgType, NetworkMessageDelegate handler) { if (messageHandlers.ContainsKey(msgType)) { if (LogFilter.Debug) Debug.Log("NetworkConnection.RegisterHandler replacing " + msgType); } messageHandlers[msgType] = handler; } /// <summary> /// Obsolete: Use NetworkClient/NetworkServer.UnregisterHandler<T> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient/NetworkServer.UnregisterHandler<T> instead")] public void UnregisterHandler(short msgType) { messageHandlers.Remove(msgType); } /// <summary> /// Obsolete: use Send<T> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("use Send<T> instead")] public virtual bool Send(int msgType, MessageBase msg, int channelId = Channels.DefaultReliable) { // pack message and send byte[] message = MessagePacker.PackMessage(msgType, msg); return SendBytes(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> /// <typeparam name="T">The message type to unregister.</typeparam> /// <param name="msg">The message to send.</param> /// <param name="channelId">The transport layer channel to send on.</param> /// <returns></returns> >>>>>>> /// <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> /// <typeparam name="T">The message type to unregister.</typeparam> /// <param name="msg">The message to send.</param> /// <param name="channelId">The transport layer channel to send on.</param> /// <returns></returns> <<<<<<< ======= /// <summary> /// Obsolete: Use InvokeHandler<T> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use InvokeHandler<T> instead")] public bool InvokeHandlerNoData(int msgType) { return InvokeHandler(msgType, null); } >>>>>>>
<<<<<<< /// <returns>True if this component calculated the list of observers</returns> public override bool OnRebuildObservers(HashSet<INetworkConnection> observers, bool initialize) ======= public override void OnRebuildObservers(HashSet<NetworkConnection> observers, bool initialize) >>>>>>> public override void OnRebuildObservers(HashSet<INetworkConnection> observers, bool initialize) <<<<<<< if (ForceHidden) // always return true when overwriting OnRebuildObservers so that // Mirror knows not to use the built in rebuild method. return true; ======= if (forceHidden) return; >>>>>>> if (ForceHidden) return;
<<<<<<< using System.Threading.Tasks; ======= >>>>>>> using System.Threading.Tasks; <<<<<<< // Deprecated 03/03/2019 /// <summary> ======= /// <summary> >>>>>>> /// <summary> <<<<<<< internal void RegisterSystemHandlers(bool hostMode) ======= internal static void RegisterSystemHandlers(bool hostMode) >>>>>>> internal void RegisterSystemHandlers(bool hostMode) <<<<<<< // Deprecated 03/03/2019 /// <summary> ======= /// <summary> >>>>>>> /// <summary> <<<<<<< RegisterHandler((NetworkConnectionToServer _, T value) => { handler(value); }, requireAuthentication); } ======= RegisterHandler((NetworkConnection _, T value) => { handler(value); }, requireAuthentication); } >>>>>>> RegisterHandler((NetworkConnectionToServer _, T value) => { handler(value); }, requireAuthentication); }
<<<<<<< ======= [EditorBrowsable(EditorBrowsableState.Never), Obsolete("use SendToObservers<T> instead")] static bool SendToObservers(NetworkIdentity identity, short msgType, MessageBase msg) { if (LogFilter.Debug) Debug.Log("Server.SendToObservers id:" + msgType); if (identity != null && identity.observers != null) { // pack message into byte[] once byte[] bytes = MessagePacker.PackMessage((ushort)msgType, msg); // send to all observers bool result = true; foreach (KeyValuePair<int, NetworkConnection> kvp in identity.observers) { result &= kvp.Value.Send(new ArraySegment<byte>(bytes)); } return result; } return false; } // this is like SendToReady - but it doesn't check the ready flag on the connection. // this is used for ObjectDestroy messages. >>>>>>> <<<<<<< NetworkWriter writer = NetworkWriterPool.GetWriter(); MessagePacker.Pack(msg, writer); byte[] bytes = writer.ToArray(); ======= // get writer from pool NetworkWriter writer = NetworkWriterPool.GetWriter(); // pack message into byte[] once MessagePacker.Pack(msg, writer); ArraySegment<byte> segment = writer.ToArraySegment(); >>>>>>> // get writer from pool NetworkWriter writer = NetworkWriterPool.GetWriter(); // pack message into byte[] once MessagePacker.Pack(msg, writer); ArraySegment<byte> segment = writer.ToArraySegment(); <<<<<<< NetworkWriter writer = NetworkWriterPool.GetWriter(); MessagePacker.Pack(msg, writer); byte[] bytes = writer.ToArray(); ======= >>>>>>> <<<<<<< // pack message into byte[] once NetworkWriter writer = NetworkWriterPool.GetWriter(); MessagePacker.Pack(msg, writer); byte[] bytes = writer.ToArray(); ======= // get writer from pool NetworkWriter writer = NetworkWriterPool.GetWriter(); >>>>>>> // get writer from pool NetworkWriter writer = NetworkWriterPool.GetWriter(); <<<<<<< NetworkWriterPool.Recycle(writer); ======= // send to all internet connections at once if (connectionIdsCache.Count > 0) result &= NetworkConnection.Send(connectionIdsCache, segment); NetworkDiagnostics.OnSend(msg, channelId, segment.Count, count); // recycle writer and return NetworkWriterPool.Recycle(writer); >>>>>>> // send to all internet connections at once if (connectionIdsCache.Count > 0) result &= NetworkConnection.Send(connectionIdsCache, segment); NetworkDiagnostics.OnSend(msg, channelId, segment.Count, count); // recycle writer and return NetworkWriterPool.Recycle(writer); <<<<<<< ======= /// Obsolete: Use <see cref="RegisterHandler{T}(Action{NetworkConnection, T}, bool)"/> instead. /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use RegisterHandler<T>(Action<NetworkConnection, T>, bool) instead.")] public static void RegisterHandler(int msgType, NetworkMessageDelegate handler) { if (handlers.ContainsKey(msgType)) { if (LogFilter.Debug) Debug.Log("NetworkServer.RegisterHandler replacing " + msgType); } handlers[msgType] = handler; } /// <summary> /// Obsolete: Use <see cref="RegisterHandler{T}(Action{NetworkConnection, T}, bool)"/> instead. /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use RegisterHandler<T>(Action<NetworkConnection, T>, bool) instead.")] public static void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler) { RegisterHandler((int)msgType, handler); } /// <summary> >>>>>>>
<<<<<<< if (NetworkManager.singleton.transport.ClientConnected()) ======= error = 0; if (Transport.activeTransport.ClientConnected()) >>>>>>> if (Transport.activeTransport.ClientConnected())
<<<<<<< protected SerializedProperty dontDestroyOnLoadProperty; protected SerializedProperty runInBackgroundProperty; SerializedProperty networkAddressProperty; SerializedProperty tcpPortProperty; SerializedProperty websocketPortProperty; SerializedProperty serverBindToIPProperty; SerializedProperty serverBindAddressProperty; protected SerializedProperty showDebugMessagesProperty; SerializedProperty playerPrefabProperty; SerializedProperty autoCreatePlayerProperty; SerializedProperty playerSpawnMethodProperty; ======= >>>>>>> <<<<<<< SerializedProperty useWebSocketsProperty; SerializedProperty useTcpProperty; GUIContent showNetworkLabel; GUIContent showSpawnLabel; GUIContent offlineSceneLabel; GUIContent onlineSceneLabel; protected GUIContent dontDestroyOnLoadLabel; protected GUIContent runInBackgroundLabel; protected GUIContent showDebugMessagesLabel; GUIContent maxConnectionsLabel; GUIContent useWebSocketsLabel; GUIContent useTcpLabel; GUIContent networkAddressLabel; GUIContent tcpPortLabel; GUIContent websocketPortLabel; GUIContent playerPrefabLabel; GUIContent autoCreatePlayerLabel; GUIContent playerSpawnMethodLabel; ======= >>>>>>> <<<<<<< maxConnectionsLabel = new GUIContent("Max Connections", "Maximum number of network connections"); useWebSocketsLabel = new GUIContent("WebSocket", "This makes the server listen for connections using WebSockets. This allows WebGL clients to connect to the server."); useTcpLabel = new GUIContent("TCP", "This makes the server listen for connections using TCP."); networkAddressLabel = new GUIContent("Network Address", "The network address currently in use."); tcpPortLabel = new GUIContent("Port", "The network port currently in use."); websocketPortLabel = new GUIContent("Port", "The network port currently in use for websockets."); playerPrefabLabel = new GUIContent("Player Prefab", "The default prefab to be used to create player objects on the server."); autoCreatePlayerLabel = new GUIContent("Auto Create Player", "Enable to automatically create player objects on connect and on Scene change."); playerSpawnMethodLabel = new GUIContent("Player Spawn Method", "How to determine which NetworkStartPosition to spawn players at, from all NetworkStartPositions in the Scene.\n\nRandom chooses a random NetworkStartPosition.\n\nRound Robin chooses the next NetworkStartPosition on a round-robin basis."); ======= networkManager = target as NetworkManager; >>>>>>> networkManager = target as NetworkManager; <<<<<<< // network foldout properties networkAddressProperty = serializedObject.FindProperty("networkAddress"); useTcpProperty = serializedObject.FindProperty("useTcp"); tcpPortProperty = serializedObject.FindProperty("tcpPort"); useWebSocketsProperty = serializedObject.FindProperty("useWebSockets"); websocketPortProperty = serializedObject.FindProperty("websocketPort"); // spawn foldout properties playerPrefabProperty = serializedObject.FindProperty("playerPrefab"); autoCreatePlayerProperty = serializedObject.FindProperty("autoCreatePlayer"); playerSpawnMethodProperty = serializedObject.FindProperty("playerSpawnMethod"); spawnListProperty = serializedObject.FindProperty("spawnPrefabs"); spawnList = new ReorderableList(serializedObject, spawnListProperty); spawnList.drawHeaderCallback = DrawHeader; spawnList.drawElementCallback = DrawChild; spawnList.onReorderCallback = Changed; spawnList.onRemoveCallback = RemoveButton; spawnList.onChangedCallback = Changed; spawnList.onReorderCallback = Changed; spawnList.onAddCallback = AddButton; spawnList.elementHeight = 16; // this uses a 16x16 icon. other sizes make it stretch. // web sockets } static void ShowPropertySuffix(GUIContent content, SerializedProperty prop, string suffix) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(prop, content); GUILayout.Label(suffix, EditorStyles.miniLabel, GUILayout.Width(64)); EditorGUILayout.EndHorizontal(); ======= spawnList = new ReorderableList(serializedObject, spawnListProperty); spawnList.drawHeaderCallback = DrawHeader; spawnList.drawElementCallback = DrawChild; spawnList.onReorderCallback = Changed; spawnList.onRemoveCallback = RemoveButton; spawnList.onChangedCallback = Changed; spawnList.onReorderCallback = Changed; spawnList.onAddCallback = AddButton; spawnList.elementHeight = 16; // this uses a 16x16 icon. other sizes make it stretch. } >>>>>>> spawnList = new ReorderableList(serializedObject, spawnListProperty); spawnList.drawHeaderCallback = DrawHeader; spawnList.drawElementCallback = DrawChild; spawnList.onReorderCallback = Changed; spawnList.onRemoveCallback = RemoveButton; spawnList.onChangedCallback = Changed; spawnList.onReorderCallback = Changed; spawnList.onAddCallback = AddButton; spawnList.elementHeight = 16; // this uses a 16x16 icon. other sizes make it stretch. } <<<<<<< EditorGUI.indentLevel -= 1; } protected SceneAsset GetSceneObject(string sceneObjectName) { if (string.IsNullOrEmpty(sceneObjectName)) { return null; } foreach (var editorScene in EditorBuildSettings.scenes) { var sceneNameWithoutExtension = Path.GetFileNameWithoutExtension(editorScene.path); if (sceneNameWithoutExtension == sceneObjectName) { return AssetDatabase.LoadAssetAtPath(editorScene.path, typeof(SceneAsset)) as SceneAsset; } } Debug.LogWarning("Scene [" + sceneObjectName + "] cannot be used with networking. Add this scene to the 'Scenes in the Build' in build settings."); return null; } protected void ShowNetworkInfo() { networkAddressProperty.isExpanded = EditorGUILayout.Foldout(networkAddressProperty.isExpanded, showNetworkLabel); if (!networkAddressProperty.isExpanded) { return; } EditorGUI.indentLevel += 1; float oldLabelWith = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 90f; EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(useTcpProperty, useTcpLabel); EditorGUILayout.PropertyField(tcpPortProperty, tcpPortLabel); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(useWebSocketsProperty, useWebSocketsLabel); EditorGUILayout.PropertyField(websocketPortProperty, websocketPortLabel); EditorGUILayout.EndHorizontal(); EditorGUIUtility.labelWidth = oldLabelWith; EditorGUILayout.PropertyField(networkAddressProperty, networkAddressLabel); var maxConn = serializedObject.FindProperty("maxConnections"); ShowPropertySuffix(maxConnectionsLabel, maxConn, "connections"); EditorGUI.indentLevel -= 1; } protected void ShowScenes() { var offlineObj = GetSceneObject(networkManager.offlineScene); var newOfflineScene = EditorGUILayout.ObjectField(offlineSceneLabel, offlineObj, typeof(SceneAsset), false); if (newOfflineScene == null) { var prop = serializedObject.FindProperty("offlineScene"); prop.stringValue = ""; EditorUtility.SetDirty(target); } else { if (newOfflineScene.name != networkManager.offlineScene) { var sceneObj = GetSceneObject(newOfflineScene.name); if (sceneObj == null) { Debug.LogWarning("The scene " + newOfflineScene.name + " cannot be used. To use this scene add it to the build settings for the project"); } else { var prop = serializedObject.FindProperty("offlineScene"); prop.stringValue = newOfflineScene.name; EditorUtility.SetDirty(target); } } } var onlineObj = GetSceneObject(networkManager.onlineScene); var newOnlineScene = EditorGUILayout.ObjectField(onlineSceneLabel, onlineObj, typeof(SceneAsset), false); if (newOnlineScene == null) { var prop = serializedObject.FindProperty("onlineScene"); prop.stringValue = ""; EditorUtility.SetDirty(target); } else { if (newOnlineScene.name != networkManager.onlineScene) { var sceneObj = GetSceneObject(newOnlineScene.name); if (sceneObj == null) { Debug.LogWarning("The scene " + newOnlineScene.name + " cannot be used. To use this scene add it to the build settings for the project"); } else { var prop = serializedObject.FindProperty("onlineScene"); prop.stringValue = newOnlineScene.name; EditorUtility.SetDirty(target); } } } } protected void ShowDerivedProperties(Type baseType, Type superType) { bool first = true; SerializedProperty property = serializedObject.GetIterator(); bool expanded = true; while (property.NextVisible(expanded)) { // ignore properties from base class. var f = baseType.GetField(property.name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); var p = baseType.GetProperty(property.name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (f == null && superType != null) { f = superType.GetField(property.name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (p == null && superType != null) { p = superType.GetProperty(property.name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (f == null && p == null) { if (first) { first = false; EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorGUILayout.Separator(); } EditorGUILayout.PropertyField(property, true); expanded = false; } } if (!first) { serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); } } public override void OnInspectorGUI() { if (dontDestroyOnLoadProperty == null || dontDestroyOnLoadLabel == null || showDebugMessagesLabel == null) initialized = false; Init(); serializedObject.Update(); EditorGUILayout.PropertyField(dontDestroyOnLoadProperty, dontDestroyOnLoadLabel); EditorGUILayout.PropertyField(runInBackgroundProperty, runInBackgroundLabel); if (EditorGUILayout.PropertyField(showDebugMessagesProperty, showDebugMessagesLabel)) { LogFilter.Debug = networkManager.showDebugMessages; } ShowScenes(); ShowNetworkInfo(); ShowSpawnInfo(); serializedObject.ApplyModifiedProperties(); ShowDerivedProperties(typeof(NetworkManager), null); ======= >>>>>>>
<<<<<<< ///<summary>True if the object is running on a client.</summary> public bool isClient => m_IsClient; ///<summary>True if this object is running on the server, and has been spawned.</summary> ======= public bool isClient { get; private set; } >>>>>>> ///<summary>True if the object is running on a client.</summary> public bool isClient { get; private set; } ///<summary>True if this object is running on the server, and has been spawned.</summary> <<<<<<< ///<summary>True if the object is the one that represents the player on the local machine.</summary> public bool isLocalPlayer => m_IsLocalPlayer; ///<summary>True if this object is the authoritative version of the object. For more info: https://vis2k.github.io/Mirror/Concepts/Authority</summary> public bool hasAuthority => m_HasAuthority; ======= public bool isLocalPlayer { get; private set; } public bool hasAuthority { get; private set; } >>>>>>> ///<summary>True if the object is the one that represents the player on the local machine.</summary> public bool isLocalPlayer { get; private set; } ///<summary>True if this object is the authoritative version of the object. For more info: https://vis2k.github.io/Mirror/Concepts/Authority</summary> public bool hasAuthority { get; private set; } <<<<<<< ///<summary>A unique identifier for this network object, assigned when spawned.</summary> public uint netId => m_NetId; ///<summary>A unique identifier for networked objects in a scene.</summary> ======= public uint netId { get; private set; } >>>>>>> ///<summary>A unique identifier for this network object, assigned when spawned.</summary> public uint netId { get; private set; } ///<summary>A unique identifier for networked objects in a scene.</summary> <<<<<<< ///<summary>The client that has authority for this object. This will be null if no client has authority.</summary> public NetworkConnection clientAuthorityOwner => m_ClientAuthorityOwner; ///<summary>The NetworkConnection associated with this NetworkIdentity. This is only valid for player objects on a local client.</summary> public NetworkConnection connectionToServer => m_ConnectionToServer; ///<summary>The NetworkConnection associated with this NetworkIdentity. This is only valid for player objects on the server.</summary> public NetworkConnection connectionToClient => m_ConnectionToClient; ======= public NetworkConnection clientAuthorityOwner { get; private set; } public NetworkConnection connectionToServer { get; private set; } public NetworkConnection connectionToClient { get; private set; } >>>>>>> ///<summary>The client that has authority for this object. This will be null if no client has authority.</summary> public NetworkConnection clientAuthorityOwner { get; private set; } ///<summary>The NetworkConnection associated with this NetworkIdentity. This is only valid for player objects on a local client.</summary> public NetworkConnection connectionToServer { get; private set; } ///<summary>The NetworkConnection associated with this NetworkIdentity. This is only valid for player objects on the server.</summary> public NetworkConnection connectionToClient { get; private set; }
<<<<<<< ///<summary>A flag to make this object not be spawned on clients.</summary> public bool serverOnly { get { return m_ServerOnly; } set { m_ServerOnly = value; } } ///<summary>True if the object is controlled by the client that owns it.</summary> public bool localPlayerAuthority { get { return m_LocalPlayerAuthority; } set { m_LocalPlayerAuthority = value; } } ///<summary>The client that has authority for this object. This will be null if no client has authority.</summary> ======= [FormerlySerializedAs("m_ServerOnly")] public bool serverOnly; [FormerlySerializedAs("m_LocalPlayerAuthority")] public bool localPlayerAuthority; >>>>>>> ///<summary>A flag to make this object not be spawned on clients.</summary> [FormerlySerializedAs("m_ServerOnly")] public bool serverOnly; ///<summary>True if the object is controlled by the client that owns it.</summary> [FormerlySerializedAs("m_LocalPlayerAuthority")] public bool localPlayerAuthority; ///<summary>The client that has authority for this object. This will be null if no client has authority.</summary>
<<<<<<< if (enableDrawTileDebug) { m_DeferredMaterial.EnableKeyword ("ENABLE_DEBUG"); } else { m_DeferredMaterial.DisableKeyword ("ENABLE_DEBUG"); } if (enableReflectionProbeDebug) { m_DeferredReflectionMaterial.EnableKeyword ("ENABLE_DEBUG"); } else { m_DeferredReflectionMaterial.DisableKeyword ("ENABLE_DEBUG"); } ======= if (enableDrawTileDebug) { m_DeferredMaterial.EnableKeyword("ENABLE_DEBUG"); } else { m_DeferredMaterial.DisableKeyword("ENABLE_DEBUG"); } if (enableReflectionProbeDebug) { m_DeferredReflectionMaterial.EnableKeyword("ENABLE_DEBUG"); } else { m_DeferredReflectionMaterial.DisableKeyword("ENABLE_DEBUG"); } >>>>>>> if (enableDrawTileDebug) { m_DeferredMaterial.EnableKeyword("ENABLE_DEBUG"); } else { m_DeferredMaterial.DisableKeyword("ENABLE_DEBUG"); } if (enableReflectionProbeDebug) { m_DeferredReflectionMaterial.EnableKeyword("ENABLE_DEBUG"); } else { m_DeferredReflectionMaterial.DisableKeyword("ENABLE_DEBUG"); } <<<<<<< UpdateShadowConstants (cullResults.visibleLights, ref shadows); #endif ======= UpdateShadowConstants(cullResults.visibleLights, ref shadows); >>>>>>> UpdateShadowConstants(cullResults.visibleLights, ref shadows); #endif
<<<<<<< if (LogFilter.Debug) { Debug.Log("OnSerializeSafely written for object=" + comp.name + " component=" + comp.GetType() + " sceneId=" + m_SceneId); } ======= int endPosition = writer.Position; // fill in length now writer.Position = headerPosition; writer.WriteInt32(endPosition - contentPosition); writer.Position = endPosition; if (LogFilter.Debug) Debug.Log("OnSerializeSafely written for object=" + comp.name + " component=" + comp.GetType() + " sceneId=" + sceneId.ToString("X") + "header@" + headerPosition + " content@" + contentPosition + " end@" + endPosition + " contentSize=" + (endPosition - contentPosition)); >>>>>>> if (LogFilter.Debug) { Debug.Log("OnSerializeSafely written for object=" + comp.name + " component=" + comp.GetType() + " sceneId=" + sceneId); } <<<<<<< ======= if (LogFilter.Debug) Debug.Log("OnDeserializeSafely: " + comp.name + " component=" + comp.GetType() + " sceneId=" + sceneId.ToString("X") + " length=" + contentSize); >>>>>>> <<<<<<< Debug.LogError("OnDeserialize failed for: object=" + name + " component=" + comp.GetType() + " sceneId=" + m_SceneId + ". Possible Reasons:\n * Do " + comp.GetType() + "'s OnSerialize and OnDeserialize calls write the same amount of data? \n * Was there an exception in " + comp.GetType() + "'s OnSerialize/OnDeserialize code?\n * Are the server and client the exact same project?\n * Maybe this OnDeserialize call was meant for another GameObject? The sceneIds can easily get out of sync if the Hierarchy was modified only in the client OR the server. Try rebuilding both.\n\n" + e.ToString()); ======= Debug.LogError("OnDeserialize failed for: object=" + name + " component=" + comp.GetType() + " sceneId=" + sceneId.ToString("X") + " length=" + contentSize + ". Possible Reasons:\n * Do " + comp.GetType() + "'s OnSerialize and OnDeserialize calls write the same amount of data(" + contentSize + " bytes)? \n * Was there an exception in " + comp.GetType() + "'s OnSerialize/OnDeserialize code?\n * Are the server and client the exact same project?\n * Maybe this OnDeserialize call was meant for another GameObject? The sceneIds can easily get out of sync if the Hierarchy was modified only in the client OR the server. Try rebuilding both.\n\n" + e); } // now the reader should be EXACTLY at 'before + size'. // otherwise the component read too much / too less data. if (reader.Position != chunkEnd) { // warn the user int bytesRead = reader.Position - chunkStart; Debug.LogWarning("OnDeserialize was expected to read " + contentSize + " instead of " + bytesRead + " bytes for object:" + name + " component=" + comp.GetType() + " sceneId=" + sceneId.ToString("X") + ". Make sure that OnSerialize and OnDeserialize write/read the same amount of data in all cases."); // fix the position, so the following components don't all fail reader.Position = chunkEnd; >>>>>>> Debug.LogError("OnDeserialize failed for: object=" + name + " component=" + comp.GetType() + " sceneId=" + sceneId + ". Possible Reasons:\n * Do " + comp.GetType() + "'s OnSerialize and OnDeserialize calls write the same amount of data? \n * Was there an exception in " + comp.GetType() + "'s OnSerialize/OnDeserialize code?\n * Are the server and client the exact same project?\n * Maybe this OnDeserialize call was meant for another GameObject? The sceneIds can easily get out of sync if the Hierarchy was modified only in the client OR the server. Try rebuilding both.\n\n" + e.ToString());
<<<<<<< var w = new NetworkWriter(); w.Write(new TestMessage(1, "2", 3.3)); ======= NetworkWriter w = new NetworkWriter(); w.WriteMessage(new TestMessage(1, "2", 3.3)); >>>>>>> var w = new NetworkWriter(); w.WriteMessage(new TestMessage(1, "2", 3.3)); <<<<<<< var w = new NetworkWriter(); w.Write(new WovenTestMessage { IntValue = 1, StringValue = "2", DoubleValue = 3.3 }); ======= NetworkWriter w = new NetworkWriter(); w.WriteMessage(new WovenTestMessage { IntValue = 1, StringValue = "2", DoubleValue = 3.3 }); >>>>>>> var w = new NetworkWriter(); w.WriteMessage(new WovenTestMessage { IntValue = 1, StringValue = "2", DoubleValue = 3.3 });
<<<<<<< ======= public void WriteLine(string text) { WriteLine(new FormatArray(text)); } public void WriteLine(string format, object argument) { WriteLine(new FormatArray(format, argument)); } public void WriteLine(string format, object argument1, object argument2) { WriteLine(new FormatArray(format, argument1, argument2)); } public void WriteLine(string format, object argument1, object argument2, object argument3) { WriteLine(new FormatArray(format, argument1, argument2, argument3)); } public void WriteLine(string format, params object[] arguments) { WriteLine(new FormatArray(format, arguments)); } >>>>>>>
<<<<<<< var method = new MethodDefinition(".ctor", methodAttributes, WeaverTypes.voidType); ======= MethodDefinition method = new MethodDefinition(".ctor", methodAttributes, WeaverTypes.Import(typeof(void))); >>>>>>> var method = new MethodDefinition(".ctor", methodAttributes, WeaverTypes.Import(typeof(void))); <<<<<<< WeaverTypes.SetupTargetTypes(unityAssembly, mirrorAssembly, CurrentAssembly); var rwstopwatch = System.Diagnostics.Stopwatch.StartNew(); ======= WeaverTypes.SetupTargetTypes(CurrentAssembly); System.Diagnostics.Stopwatch rwstopwatch = System.Diagnostics.Stopwatch.StartNew(); >>>>>>> WeaverTypes.SetupTargetTypes(CurrentAssembly); var rwstopwatch = System.Diagnostics.Stopwatch.StartNew(); <<<<<<< using (var unityAssembly = AssemblyDefinition.ReadAssembly(unityEngineDLLPath)) using (var mirrorAssembly = AssemblyDefinition.ReadAssembly(mirrorNetDLLPath)) ======= try >>>>>>> try
<<<<<<< ======= /// Obsolete: Use NetworkClient/NetworkServer.RegisterHandler{T} instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient/NetworkServer.RegisterHandler<T> instead")] public void RegisterHandler(short msgType, NetworkMessageDelegate handler) { if (messageHandlers.ContainsKey(msgType)) { if (LogFilter.Debug) Debug.Log("NetworkConnection.RegisterHandler replacing " + msgType); } messageHandlers[msgType] = handler; } /// <summary> /// Obsolete: Use <see cref="NetworkClient.UnregisterHandler{T}"/> and <see cref="NetworkServer.UnregisterHandler{T}"/> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient/NetworkServer.UnregisterHandler<T> instead")] public void UnregisterHandler(short msgType) { messageHandlers.Remove(msgType); } /// <summary> /// Obsolete: use <see cref="Send{T}(T, int)"/> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("use Send<T> instead")] public virtual bool Send(int msgType, MessageBase msg, int channelId = Channels.DefaultReliable) { // pack message and send byte[] message = MessagePacker.PackMessage(msgType, msg); return Send(new ArraySegment<byte>(message), channelId); } /// <summary> >>>>>>> <<<<<<< // pack message and send NetworkWriter writer = NetworkWriterPool.GetWriter(); MessagePacker.Pack(msg, writer); bool result = SendBytes(writer.ToArray(), channelId); NetworkWriterPool.Recycle(writer); return result; ======= NetworkWriter writer = NetworkWriterPool.GetWriter(); // pack message and send allocation free MessagePacker.Pack(msg, writer); NetworkDiagnostics.OnSend(msg, channelId, writer.Position, 1); bool result = Send(writer.ToArraySegment(), channelId); NetworkWriterPool.Recycle(writer); return result; >>>>>>> NetworkWriter writer = NetworkWriterPool.GetWriter(); // pack message and send allocation free MessagePacker.Pack(msg, writer); NetworkDiagnostics.OnSend(msg, channelId, writer.Position, 1); bool result = Send(writer.ToArraySegment(), channelId); NetworkWriterPool.Recycle(writer); return result; <<<<<<< if (logNetworkMessages) Debug.Log("ConnectionSend con:" + connectionId + " bytes:" + BitConverter.ToString(bytes )); if (bytes.Length > Transport.activeTransport.GetMaxPacketSize(channelId)) ======= if (segment.Count > Transport.activeTransport.GetMaxPacketSize(channelId)) >>>>>>> if (segment.Count > Transport.activeTransport.GetMaxPacketSize(channelId)) <<<<<<< internal bool InvokeHandler(int msgType, NetworkReader reader) ======= /// <summary> /// Obsolete: Use <see cref="InvokeHandler{T}(T)"/> instead /// </summary> [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use InvokeHandler<T> instead")] public bool InvokeHandlerNoData(int msgType) { return InvokeHandler(msgType, null, -1); } internal bool InvokeHandler(int msgType, NetworkReader reader, int channelId) >>>>>>> internal bool InvokeHandler(int msgType, NetworkReader reader, int channelId)
<<<<<<< var formData = form.AllKeys.SelectMany(k => (form.GetValues(k) ?? new string[0]).Select(v => new { Name = k, Value = v })); Log.Write(_formDataLoggingLevel, "Client provided {@FormData}", formData); ======= var formData = form.AllKeys.SelectMany(k => (form.GetValues(k) ?? new string[0]).Select(v => new { Name = k, Value = FilterPasswords(k, v) })); Log.Debug("Client provided {@FormData}", formData); >>>>>>> var formData = form.AllKeys.SelectMany(k => (form.GetValues(k) ?? new string[0]).Select(v => new { Name = k, Value = FilterPasswords(k, v) })); Log.Write(_formDataLoggingLevel, "Client provided {@FormData}", formData); <<<<<<< static bool ShouldLogRequest() { return Log.IsEnabled(_formDataLoggingLevel) && (LogPostedFormData == LogPostedFormDataOption.Always || (LogPostedFormData == LogPostedFormDataOption.OnlyOnError && HttpContext.Current.Response.StatusCode >= 500)); } ======= /// <summary> /// Filters a password from being logged /// </summary> /// <param name="key">Key of the pair</param> /// <param name="value">Value of the pair</param> static string FilterPasswords(string key, string value) { if (_filterPasswordsInFormData && key.IndexOf("password", StringComparison.OrdinalIgnoreCase) != -1) { return "********"; } return value; } >>>>>>> static bool ShouldLogRequest() { return Log.IsEnabled(_formDataLoggingLevel) && (LogPostedFormData == LogPostedFormDataOption.Always || (LogPostedFormData == LogPostedFormDataOption.OnlyOnError && HttpContext.Current.Response.StatusCode >= 500)); } /// <summary> /// Filters a password from being logged /// </summary> /// <param name="key">Key of the pair</param> /// <param name="value">Value of the pair</param> static string FilterPasswords(string key, string value) { if (_filterPasswordsInFormData && key.IndexOf("password", StringComparison.OrdinalIgnoreCase) != -1) { return "********"; } return value; }
<<<<<<< using System; using System.Diagnostics; using System.Runtime.CLR; using BenchmarkDotNet; ======= >>>>>>>
<<<<<<< public enum Gender{Male, Female, Unknown} public class TestFoo { public Gender Gender { get; set; } public Gender? GenderNullable { get; set; } } [Test] public void SerializeEnumToStringValues() { // Arrange var testClass = new TestFoo { Gender = Gender.Female, GenderNullable = Gender.Male }; var serializer = new CustomJsonSerializer(); const string expected = "{\r\n \"Gender\": \"Female\",\r\n \"GenderNullable\": \"Male\"\r\n}"; // Act var result = serializer.Serialize(testClass); // Assert Assert.AreEqual(expected, result); } ======= public class TimeSpanModel { public TimeSpan Foo { get; set; } } >>>>>>> public class TimeSpanModel { public TimeSpan Foo { get; set; } } public enum Gender{Male, Female, Unknown} public class TestFoo { public Gender Gender { get; set; } public Gender? GenderNullable { get; set; } } [Test] public void SerializeEnumToStringValues() { // Arrange var testClass = new TestFoo { Gender = Gender.Female, GenderNullable = Gender.Male }; var serializer = new CustomJsonSerializer(); const string expected = "{\r\n \"Gender\": \"Female\",\r\n \"GenderNullable\": \"Male\"\r\n}"; // Act var result = serializer.Serialize(testClass); // Assert Assert.AreEqual(expected, result); }
<<<<<<< public string Content { get; set; } public string Location { get; set; } public static MockResponse Json(int statusCode, string json) { return Json((HttpStatusCode)statusCode, json, null); } public static MockResponse Json(int statusCode, string json, string location) { return Json((HttpStatusCode)statusCode, json, location); } ======= public virtual string Content { get; set; } >>>>>>> public virtual string Content { get; set; } public string Location { get; set; } public static MockResponse Json(int statusCode, string json) { return Json((HttpStatusCode)statusCode, json, null); } public static MockResponse Json(int statusCode, string json, string location) { return Json((HttpStatusCode)statusCode, json, location); }
<<<<<<< CMSConfiguration.Configure(); ======= ResourceSpace.Has.ResourcesOfType<RedirectArgs>() .AtUri(Constants.RedirectPath) .HandledBy<RedirectHandler>() .TranscodedBy<FormUrlencodedCodec>(); //.TranscodedBy<LinkHeaderCodec>(); ConfigureCMS(); >>>>>>> CMSConfiguration.Configure(); ResourceSpace.Has.ResourcesOfType<RedirectArgs>() .AtUri(Constants.RedirectPath) .HandledBy<RedirectHandler>() .TranscodedBy<FormUrlencodedCodec>(); //.TranscodedBy<LinkHeaderCodec>();
<<<<<<< public CompilationGenerator() { this.assemblyResolver = new CompositeCompilationAssemblyResolver(new ICompilationAssemblyResolver[] { new ReferenceAssemblyPathResolver(), new PackageCompilationAssemblyResolver() }); this.dependencyContext = DependencyContext.Default; var loadContext = AssemblyLoadContext.GetLoadContext(this.GetType().GetTypeInfo().Assembly); loadContext.Resolving += this.ResolveAssembly; } ======= public string ProjectDirectory { get; set; } >>>>>>> public string ProjectDirectory { get; set; } public CompilationGenerator() { this.assemblyResolver = new CompositeCompilationAssemblyResolver(new ICompilationAssemblyResolver[] { new ReferenceAssemblyPathResolver(), new PackageCompilationAssemblyResolver() }); this.dependencyContext = DependencyContext.Default; var loadContext = AssemblyLoadContext.GetLoadContext(this.GetType().GetTypeInfo().Assembly); loadContext.Resolving += this.ResolveAssembly; }
<<<<<<< Dictionary<string, float> m_FloatPropertiesToSet = new Dictionary<string, float>(); Dictionary<string, Color> m_ColorPropertiesToSet = new Dictionary<string, Color>(); List<string> m_TexturesToRemove = new List<string>(); ======= class KeywordFloatRename { public string keyword; public string property; public float setVal, unsetVal; } List<KeywordFloatRename> m_KeywordFloatRename = new List<KeywordFloatRename>(); >>>>>>> Dictionary<string, float> m_FloatPropertiesToSet = new Dictionary<string, float>(); Dictionary<string, Color> m_ColorPropertiesToSet = new Dictionary<string, Color>(); List<string> m_TexturesToRemove = new List<string>(); class KeywordFloatRename { public string keyword; public string property; public float setVal, unsetVal; } List<KeywordFloatRename> m_KeywordFloatRename = new List<KeywordFloatRename>(); <<<<<<< material.shaderKeywords = new string[0]; var matEditor = Editor.CreateEditor(material) as MaterialEditor; matEditor.SetShader(material.shader, false); matEditor.serializedObject.ApplyModifiedPropertiesWithoutUndo(); ======= if(m_Finalizer != null) m_Finalizer(material); >>>>>>> if(m_Finalizer != null) m_Finalizer(material); <<<<<<< foreach (var prop in m_TexturesToRemove) dstMaterial.SetTexture(prop, null); foreach (var prop in m_FloatPropertiesToSet) dstMaterial.SetFloat(prop.Key, prop.Value); foreach (var prop in m_ColorPropertiesToSet) dstMaterial.SetColor(prop.Key, prop.Value); ======= foreach (var t in m_KeywordFloatRename) dstMaterial.SetFloat(t.property, srcMaterial.IsKeywordEnabled(t.keyword) ? t.setVal : t.unsetVal); >>>>>>> foreach (var prop in m_TexturesToRemove) dstMaterial.SetTexture(prop, null); foreach (var prop in m_FloatPropertiesToSet) dstMaterial.SetFloat(prop.Key, prop.Value); foreach (var prop in m_ColorPropertiesToSet) dstMaterial.SetColor(prop.Key, prop.Value); foreach (var t in m_KeywordFloatRename) dstMaterial.SetFloat(t.property, srcMaterial.IsKeywordEnabled(t.keyword) ? t.setVal : t.unsetVal); <<<<<<< public void RemoveTexture(string name) { m_TexturesToRemove.Add(name); } public void SetFloat(string propertyName, float value) { m_FloatPropertiesToSet[propertyName] = value; } public void SetColor(string propertyName, Color value) { m_ColorPropertiesToSet[propertyName] = value; } ======= public void RenameKeywordToFloat(string oldName, string newName, float setVal, float unsetVal) { m_KeywordFloatRename.Add(new KeywordFloatRename { keyword = oldName, property = newName, setVal = setVal, unsetVal = unsetVal }); } >>>>>>> public void RemoveTexture(string name) { m_TexturesToRemove.Add(name); } public void SetFloat(string propertyName, float value) { m_FloatPropertiesToSet[propertyName] = value; } public void SetColor(string propertyName, Color value) { m_ColorPropertiesToSet[propertyName] = value; } public void RenameKeywordToFloat(string oldName, string newName, float setVal, float unsetVal) { m_KeywordFloatRename.Add(new KeywordFloatRename { keyword = oldName, property = newName, setVal = setVal, unsetVal = unsetVal }); }
<<<<<<< SerializeElements(writer, manager, element); ======= // Write the child elements: serialized, children then unknown children. this.WriteElements(writer, manager, element); this.SerializeElements(writer, manager, element.Children); this.SerializeElements(writer, manager, element.Orphans); >>>>>>> this.SerializeElements(writer, manager, element); <<<<<<< private static void WriteElement( XmlWriter writer, XmlNamespaceManager manager, Element element, TypeBrowser.ElementInfo elementInfo) ======= private void WriteElements(XmlWriter writer, XmlNamespaceManager manager, Element element) >>>>>>> private void WriteElement( XmlWriter writer, XmlNamespaceManager manager, Element element, TypeBrowser.ElementInfo elementInfo) <<<<<<< SerializeElement(writer, manager, child); ======= this.SerializeElement(writer, manager, (Element)value); } else { writer.WriteStartElement(elementInfo.Component.Name, elementInfo.Component.NamespaceUri); WriteData(writer, this.GetString(value)); writer.WriteEndElement(); >>>>>>> this.SerializeElement(writer, manager, child);
<<<<<<< using System.Text.RegularExpressions; ======= using Metrics; using Metrics.Utils; >>>>>>> using Metrics; using System.Text.RegularExpressions; using Metrics.Utils; <<<<<<< public TimerForEachRequestMiddleware(MetricsRegistry registry, string metricPrefix, Regex[] ignorePatterns) : base(ignorePatterns) ======= public TimerForEachRequestMiddleware(MetricsContext context, string metricPrefix) >>>>>>> public TimerForEachRequestMiddleware(MetricsContext context, string metricPrefix, Regex[] ignorePatterns) : base(ignorePatterns) <<<<<<< await next(environment); ======= var httpRequestPath = environment["owin.RequestPath"].ToString().ToUpper(); var name = string.Format("{0}.{1} [{2}]", metricPrefix, httpMethod, httpRequestPath); var startTime = (long)environment[RequestStartTimeKey]; var elapsed = Clock.Default.Nanoseconds - startTime; this.context.Timer(name, Unit.Requests, SamplingType.FavourRecent, TimeUnit.Seconds, TimeUnit.Milliseconds).Record(elapsed, TimeUnit.Nanoseconds); >>>>>>> await next(environment);
<<<<<<< using Metrics.Core; ======= using System; using Metrics; using Metrics.Core; >>>>>>> using System; using Metrics; using Metrics.Core; <<<<<<< public OwinRequestMetricsConfig(Action<object> middlewareRegistration, MetricsRegistry metricsRegistry, Regex[] ignoreRequestPathPatterns) ======= public OwinRequestMetricsConfig(Action<object> middlewareRegistration, MetricsContext metricsContext) >>>>>>> public OwinRequestMetricsConfig(Action<object> middlewareRegistration, MetricsContext metricsContext, Regex[] ignoreRequestPathPatterns) <<<<<<< var metricsMiddleware = new RequestTimerMiddleware(metricsRegistry, Name(metricName), this.ignoreRequestPathPatterns); ======= var metricsMiddleware = new RequestTimerMiddleware(metricsContext, Name(metricName)); >>>>>>> var metricsMiddleware = new RequestTimerMiddleware(metricsContext, Name(metricName), this.ignoreRequestPathPatterns); <<<<<<< var metricsMiddleware = new ActiveRequestCounterMiddleware(metricsRegistry, Name(metricName), this.ignoreRequestPathPatterns); ======= var metricsMiddleware = new ActiveRequestCounterMiddleware(metricsContext, Name(metricName)); >>>>>>> var metricsMiddleware = new ActiveRequestCounterMiddleware(metricsContext, Name(metricName), this.ignoreRequestPathPatterns); <<<<<<< var metricsMiddleware = new PostAndPutRequestSizeHistogramMiddleware(metricsRegistry, Name(metricName), this.ignoreRequestPathPatterns); ======= var metricsMiddleware = new PostAndPutRequestSizeHistogramMiddleware(metricsContext, Name(metricName)); >>>>>>> var metricsMiddleware = new PostAndPutRequestSizeHistogramMiddleware(metricsContext, Name(metricName), this.ignoreRequestPathPatterns); <<<<<<< var metricsMiddleware = new TimerForEachRequestMiddleware(metricsRegistry, metricPrefix, this.ignoreRequestPathPatterns); ======= var metricsMiddleware = new TimerForEachRequestMiddleware(metricsContext, metricPrefix); >>>>>>> var metricsMiddleware = new TimerForEachRequestMiddleware(metricsContext, metricPrefix, this.ignoreRequestPathPatterns); <<<<<<< var metricsMiddleware = new ErrorMeterMiddleware(metricsRegistry, Name(metricName), this.ignoreRequestPathPatterns); ======= var metricsMiddleware = new ErrorMeterMiddleware(metricsContext, Name(metricName)); >>>>>>> var metricsMiddleware = new ErrorMeterMiddleware(metricsContext, Name(metricName), this.ignoreRequestPathPatterns);
<<<<<<< ======= private const string PrivateDependencyResolutionPolicy = "private"; private static readonly Lazy<Dictionary<string, ScriptRuntimeAssembly>> _runtimeAssemblies = new Lazy<Dictionary<string, ScriptRuntimeAssembly>>(DependencyHelper.GetRuntimeAssemblies); >>>>>>> private const string PrivateDependencyResolutionPolicy = "private";
<<<<<<< private AbstractMultiLifetimeInstance _instance; ======= #pragma warning disable CA2213 // OnceInitializedOnceDisposedAsync are not tracked correctly by the IDisposeable analyzer private IMultiLifetimeInstance _instance; #pragma warning restore CA2213 >>>>>>> private IMultiLifetimeInstance _instance;
<<<<<<< librariesRoot.Expand(); computerRoot.Expand(); } private void SetNodeImage(IntPtr node, IntPtr pidl, IntPtr m_TreeViewHandle, Boolean isOverlayed) { try { var itemInfo = new TVITEMW(); // We need to set the images for the item by sending a // TVM_SETITEMW message, as we need to set the overlay images, // and the .Net TreeView API does not support overlays. itemInfo.mask = TVIF.TVIF_IMAGE | TVIF.TVIF_SELECTEDIMAGE | TVIF.TVIF_STATE; itemInfo.hItem = node; itemInfo.iImage = ShellItem.GetSystemImageListIndex(pidl, ShellIconType.SmallIcon, ShellIconFlags.OverlayIndex); if (isOverlayed) { itemInfo.state = (TVIS)(itemInfo.iImage >> 16); itemInfo.stateMask = TVIS.TVIS_OVERLAYMASK; } itemInfo.iSelectedImage = ShellItem.GetSystemImageListIndex(pidl, ShellIconType.SmallIcon, ShellIconFlags.OpenIcon); this.UpdatedImages.Add(node); User32.SendMessage(m_TreeViewHandle, BExplorer.Shell.Interop.MSG.TVM_SETITEMW, 0, ref itemInfo); } catch (Exception) { } } private void SelectItem(ShellItem item) { if (item.IsSearchFolder) return; var listNodes = this.ShellTreeView.Nodes.OfType<TreeNode>().ToList(); listNodes.AddRange(this.ShellTreeView.Nodes.OfType<TreeNode>().SelectMany(s => s.Nodes.OfType<TreeNode>()).ToArray()); var nodes = listNodes.ToArray(); var separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; var directories = item.ParsingName.Split(separators, StringSplitOptions.RemoveEmptyEntries); var items = new List<ShellItem>(); for (int i = 0; i < directories.Length; i++) { if (i == 0) { items.Add(ShellItem.ToShellParsingName(directories[i]));// new ShellItem(directories[i].ToShellParsingName())); } else { string path = String.Empty; for (int j = 0; j <= i; j++) { if (j == 0) { path = directories[j]; } else { path = String.Format("{0}{1}{2}", path, Path.DirectorySeparatorChar, directories[j]); } } //var shellItem = ShellItem.ToShellParsingName(path); items.Add(ShellItem.ToShellParsingName(path)); } } foreach (var sho in items) { //TODO: Test Change //Note: Should we use FirstOrDefault() NOT SingleOrDefault() ?? var theNodes = nodes.Where(w => w.Tag is ShellItem && ((ShellItem)w.Tag).GetDisplayName(SIGDN.DESKTOPABSOLUTEEDITING) == sho.GetDisplayName(SIGDN.DESKTOPABSOLUTEEDITING)).ToList(); ======= librariesRoot.Expand(); computerRoot.Expand(); } private void SetNodeImage(IntPtr node, IntPtr pidl, IntPtr m_TreeViewHandle, Boolean isOverlayed) { try { var itemInfo = new TVITEMW(); // We need to set the images for the item by sending a // TVM_SETITEMW message, as we need to set the overlay images, // and the .Net TreeView API does not support overlays. itemInfo.mask = TVIF.TVIF_IMAGE | TVIF.TVIF_SELECTEDIMAGE | TVIF.TVIF_STATE; itemInfo.hItem = node; itemInfo.iImage = ShellItem.GetSystemImageListIndex(pidl, ShellIconType.SmallIcon, ShellIconFlags.OverlayIndex); if (isOverlayed) { itemInfo.state = (TVIS)(itemInfo.iImage >> 16); itemInfo.stateMask = TVIS.TVIS_OVERLAYMASK; } itemInfo.iSelectedImage = ShellItem.GetSystemImageListIndex(pidl, ShellIconType.SmallIcon, ShellIconFlags.OpenIcon); this.UpdatedImages.Add(node); User32.SendMessage(m_TreeViewHandle, BExplorer.Shell.Interop.MSG.TVM_SETITEMW, 0, ref itemInfo); } catch (Exception) { } } private void SelectItem(ShellItem item) { if (item.IsSearchFolder) return; var listNodes = this.ShellTreeView.Nodes.OfType<TreeNode>().ToList(); listNodes.AddRange(this.ShellTreeView.Nodes.OfType<TreeNode>().SelectMany(s => s.Nodes.OfType<TreeNode>()).ToArray()); var nodes = listNodes.ToArray(); var separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; var directories = item.ParsingName.Split(separators, StringSplitOptions.RemoveEmptyEntries); var items = new List<ShellItem>(); for (int i = 0; i < directories.Length; i++) { if (i == 0) { items.Add(ShellItem.ToShellParsingName(directories[i]));// new ShellItem(directories[i].ToShellParsingName())); } else { string path = String.Empty; for (int j = 0; j <= i; j++) { if (j == 0) path = directories[j]; else path = String.Format("{0}{1}{2}", path, Path.DirectorySeparatorChar, directories[j]); } items.Add(ShellItem.ToShellParsingName(path)); } } foreach (var sho in items) { var theNodes = nodes.Where(w => w.Tag is ShellItem && ((ShellItem)w.Tag).GetHashCode() == sho.GetHashCode()).ToList(); >>>>>>> librariesRoot.Expand(); computerRoot.Expand(); } private void SetNodeImage(IntPtr node, IntPtr pidl, IntPtr m_TreeViewHandle, Boolean isOverlayed) { try { var itemInfo = new TVITEMW(); // We need to set the images for the item by sending a // TVM_SETITEMW message, as we need to set the overlay images, // and the .Net TreeView API does not support overlays. itemInfo.mask = TVIF.TVIF_IMAGE | TVIF.TVIF_SELECTEDIMAGE | TVIF.TVIF_STATE; itemInfo.hItem = node; itemInfo.iImage = ShellItem.GetSystemImageListIndex(pidl, ShellIconType.SmallIcon, ShellIconFlags.OverlayIndex); if (isOverlayed) { itemInfo.state = (TVIS)(itemInfo.iImage >> 16); itemInfo.stateMask = TVIS.TVIS_OVERLAYMASK; } itemInfo.iSelectedImage = ShellItem.GetSystemImageListIndex(pidl, ShellIconType.SmallIcon, ShellIconFlags.OpenIcon); this.UpdatedImages.Add(node); User32.SendMessage(m_TreeViewHandle, BExplorer.Shell.Interop.MSG.TVM_SETITEMW, 0, ref itemInfo); } catch (Exception) { } } private void SelectItem(ShellItem item) { if (item.IsSearchFolder) return; var listNodes = this.ShellTreeView.Nodes.OfType<TreeNode>().ToList(); listNodes.AddRange(this.ShellTreeView.Nodes.OfType<TreeNode>().SelectMany(s => s.Nodes.OfType<TreeNode>()).ToArray()); var nodes = listNodes.ToArray(); var separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; var directories = item.ParsingName.Split(separators, StringSplitOptions.RemoveEmptyEntries); var items = new List<ShellItem>(); for (int i = 0; i < directories.Length; i++) { if (i == 0) { items.Add(ShellItem.ToShellParsingName(directories[i]));// new ShellItem(directories[i].ToShellParsingName())); } else { string path = String.Empty; for (int j = 0; j <= i; j++) { if (j == 0) path = directories[j]; else path = String.Format("{0}{1}{2}", path, Path.DirectorySeparatorChar, directories[j]); } items.Add(ShellItem.ToShellParsingName(path)); } } foreach (var sho in items) { //TODO: Test Change //Note: Should we use FirstOrDefault() NOT SingleOrDefault() ?? var theNodes = nodes.Where(w => w.Tag is ShellItem && ((ShellItem)w.Tag).GetHashCode() == sho.GetHashCode()).ToList(); <<<<<<< foreach (var sho in items) { var theNodes = nodes.Where(wr => wr.Tag is ShellItem && ((ShellItem)wr.Tag).GetDisplayName(SIGDN.DESKTOPABSOLUTEEDITING) == sho.GetDisplayName(SIGDN.DESKTOPABSOLUTEEDITING)).ToArray(); ======= foreach (var sho in items) { var theNodes = nodes.Where(wr => wr.Tag is ShellItem && ((ShellItem)wr.Tag).GetHashCode() == sho.GetHashCode()).ToArray(); >>>>>>> foreach (var sho in items) { var theNodes = nodes.Where(wr => wr.Tag is ShellItem && ((ShellItem)wr.Tag).GetHashCode() == sho.GetHashCode()).ToArray(); <<<<<<< } private async void ShellTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) { if (e.Action == TreeViewAction.Collapse) this._AcceptSelection = false; if (e.Action == TreeViewAction.Expand) { this._ResetEvent.Reset(); if (e.Node.Nodes.Count > 0 && e.Node.Nodes[0].Text == this._EmptyItemString) { e.Node.Nodes.Clear(); imagesQueue.Clear(); childsQueue.Clear(); var sho = (ShellItem)e.Node.Tag; ShellItem lvSho = this.ShellListView != null && this.ShellListView.CurrentFolder != null ? this.ShellListView.CurrentFolder : null; var node = e.Node; if (lvSho != null && sho.ParsingName == lvSho.ParsingName) { this.ShellTreeView.SelectedNode = e.Node; } node.Nodes.Add("Searching for folders..."); Thread t = new Thread(() => { ======= } private async void ShellTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) { if (e.Action == TreeViewAction.Collapse) this._AcceptSelection = false; if (e.Action == TreeViewAction.Expand) { this._ResetEvent.Reset(); if (e.Node.Nodes.Count > 0 && e.Node.Nodes[0].Text == this._EmptyItemString) { e.Node.Nodes.Clear(); imagesQueue.Clear(); childsQueue.Clear(); var sho = (ShellItem)e.Node.Tag; ShellItem lvSho = this.ShellListView != null && this.ShellListView.CurrentFolder != null ? this.ShellListView.CurrentFolder : null; var node = e.Node; node.Nodes.Add("Searching for folders..."); Thread t = new Thread(() => { >>>>>>> } private async void ShellTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) { if (e.Action == TreeViewAction.Collapse) this._AcceptSelection = false; if (e.Action == TreeViewAction.Expand) { this._ResetEvent.Reset(); if (e.Node.Nodes.Count > 0 && e.Node.Nodes[0].Text == this._EmptyItemString) { e.Node.Nodes.Clear(); imagesQueue.Clear(); childsQueue.Clear(); var sho = (ShellItem)e.Node.Tag; ShellItem lvSho = this.ShellListView != null && this.ShellListView.CurrentFolder != null ? this.ShellListView.CurrentFolder : null; var node = e.Node; node.Nodes.Add("Searching for folders..."); Thread t = new Thread(() => { <<<<<<< if (lvSho != null) this.ShellTreeView.SelectedNode = nodesTemp.Where(w => (w.Tag as ShellItem).ParsingName == lvSho.ParsingName).SingleOrDefault(); //if (lvSho != null) // SelectItem(lvSho); ======= if (lvSho != null) SelectItem(lvSho); >>>>>>> if (lvSho != null) SelectItem(lvSho);
<<<<<<< private void CloseTab(Wpf.Controls.TabItem thetab, bool allowreopening = true) { if (tcMain.SelectedIndex == 0 && tcMain.Items.Count == 1) { if (this.IsCloseLastTabCloseApp) { Close(); } else { ShellListView.Navigate(new ShellItem(tcMain.StartUpLocation)); } return; } tcMain.RemoveTabItem(thetab, allowreopening); ConstructMoveToCopyToMenu(); SelectTab(tcMain.SelectedItem as Wpf.Controls.TabItem); } ======= >>>>>>> private void CloseTab(Wpf.Controls.TabItem thetab, bool allowreopening = true) { if (tcMain.SelectedIndex == 0 && tcMain.Items.Count == 1) { if (this.IsCloseLastTabCloseApp) { Close(); } else { ShellListView.Navigate(new ShellItem(tcMain.StartUpLocation)); } return; } tcMain.RemoveTabItem(thetab, allowreopening); ConstructMoveToCopyToMenu(); SelectTab(tcMain.SelectedItem as Wpf.Controls.TabItem); }
<<<<<<< m_SpotCookieSize = properties.Find(x => x.globalFrameSettings.lightLoopSettings.spotCookieSize); m_PointCookieSize = properties.Find(x => x.globalFrameSettings.lightLoopSettings.pointCookieSize); m_ReflectionCubemapSize = properties.Find(x => x.globalFrameSettings.lightLoopSettings.reflectionCubemapSize); // Commented out until we have proper realtime BC6H compression //m_ReflectionCacheCompressed = properties.Find(x => x.globalFrameSettings.lightLoopSettings.reflectionCacheCompressed); ======= m_SpotCookieSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.spotCookieSize); m_PointCookieSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.pointCookieSize); m_ReflectionCubemapSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.reflectionCubemapSize); m_ReflectionCacheCompressed = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.reflectionCacheCompressed); >>>>>>> m_SpotCookieSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.spotCookieSize); m_PointCookieSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.pointCookieSize); m_ReflectionCubemapSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.reflectionCubemapSize); // Commented out until we have proper realtime BC6H compression //m_ReflectionCacheCompressed = properties.Find(x => x.globalFrameSettings.lightLoopSettings.reflectionCacheCompressed);
<<<<<<< internal enum ConnectionRequestResult { Accept, Reject } ======= /// <summary> /// Additional information about disconnection /// </summary> >>>>>>> internal enum ConnectionRequestResult { Accept, Reject } /// <summary> /// Additional information about disconnection /// </summary>
<<<<<<< else if(IPv6Support) ======= else if(_udpSocketv6 != null) >>>>>>> else if(IPv6Support) <<<<<<< ======= //Close IPv4 >>>>>>> //Close IPv4 <<<<<<< if (Thread.CurrentThread != _threadv6) { _threadv6.Join(); } _threadv6 = null; ======= >>>>>>>
<<<<<<< _unitySocketFix.Port = LocalPort; _unitySocketFix.IPv6 = ipv6; ======= _unitySocketFix.Port = port; _unitySocketFix.IPv6 = ipv6Mode; >>>>>>> _unitySocketFix.Port = LocalPort; _unitySocketFix.IPv6 = ipv6Mode; <<<<<<< ======= LocalPort = ((IPEndPoint) _udpSocketv4.LocalEndPoint).Port; >>>>>>>
<<<<<<< internal CFF.Cff1Font _ownerCffFont; internal CFF.Cff1GlyphData _cff1GlyphData; //temp , TODO: review here again internal Glyph(CFF.Cff1Font owner, CFF.Cff1GlyphData cff1Glyph) { #if DEBUG this.dbugId = s_debugTotalId++; #endif this._ownerCffFont = owner; //create from CFF this._cff1GlyphData = cff1Glyph; } ======= >>>>>>> <<<<<<< ======= internal CFF.Cff1Font _ownerCffFont; internal CFF.Cff1GlyphData _cff1GlyphData; //temp internal Glyph(CFF.Cff1Font owner, CFF.Cff1GlyphData cff1Glyph) { #if DEBUG this.dbugId = s_debugTotalId++; #endif this._ownerCffFont = owner; //create from CFF this._cff1GlyphData = cff1Glyph; this.GlyphIndex = cff1Glyph.GlyphIndex; } >>>>>>> internal CFF.Cff1Font _ownerCffFont; internal CFF.Cff1GlyphData _cff1GlyphData; //temp internal Glyph(CFF.Cff1Font owner, CFF.Cff1GlyphData cff1Glyph) { #if DEBUG this.dbugId = s_debugTotalId++; #endif this._ownerCffFont = owner; //create from CFF this._cff1GlyphData = cff1Glyph; this.GlyphIndex = cff1Glyph.GlyphIndex; }
<<<<<<< internal readonly ushort _startCode; internal readonly ushort[] _glyphIdArray; ======= readonly ushort _startCode; readonly ushort[] _glyphIdArray; public override void CollectUnicodeChars(List<uint> unicodes) { ushort u = _startCode; for (uint i = 0; i < _glyphIdArray.Length; ++i) { unicodes.Add(u + i); } } >>>>>>> internal readonly ushort _startCode; internal readonly ushort[] _glyphIdArray; public override void CollectUnicodeChars(List<uint> unicodes) { ushort u = _startCode; for (uint i = 0; i < _glyphIdArray.Length; ++i) { unicodes.Add(u + i); } } <<<<<<< if (sel.UVSMappings.TryGetValue(codepoint, out ushort ret)) ======= if (sel.UVSMappings.TryGetValue(codepoint, out ushort ret)) >>>>>>> if (sel.UVSMappings.TryGetValue(codepoint, out ushort ret)) <<<<<<< public override ushort GetGlyphIndex(int codepoint) => 0; ======= protected override ushort RawCharacterToGlyphIndex(int character) => 0; public override void CollectUnicodeChars(List<uint> unicodes) { /*nothing*/} >>>>>>> public override ushort GetGlyphIndex(int character) => 0; public override void CollectUnicodeChars(List<uint> unicodes) { /*nothing*/} <<<<<<< public abstract ushort GetGlyphIndex(int codepoint); #if DEBUG public override string ToString() { return $"fmt:{ Format }, plat:{ PlatformId }, enc:{ EncodingId }"; } #endif } ======= public ushort CharacterToGlyphIndex(int codepoint) { return RawCharacterToGlyphIndex(codepoint); } protected abstract ushort RawCharacterToGlyphIndex(int codepoint); public abstract void CollectUnicodeChars(List<uint> unicodes); //public void CollectGlyphIndexListFromSampleChar(char starAt, char endAt, GlyphIndexCollector collector) //{ // // TODO: Fast segment lookup using bit operations? // switch (_cmapFormat) // { // default: throw new NotSupportedException(); // case 4: // { // for (int i = 0; i < _segCount; i++) // { // if (_endCode[i] >= sampleChar && _startCode[i] <= sampleChar) // { // //found on this range *** // if (_idRangeOffset[i] == 0) // { // //add entire range // if (!collector.HasRegisterSegment(i)) // { // List<ushort> glyphIndexList = new List<ushort>(); // char beginAt = (char)_startCode[i]; // char endAt = (char)_endCode[i]; // int delta = _idDelta[i]; // for (char m = beginAt; m <= endAt; ++m) // { // glyphIndexList.Add((ushort)((m + delta) % 65536)); // } // collector.RegisterGlyphRangeIndex(i, glyphIndexList); // } // return; // } // else // { // //If the idRangeOffset value for the segment is not 0, // //the mapping of character codes relies on glyphIdArray. // //The character code offset from startCode is added to the idRangeOffset value. // //This sum is used as an offset from the current location within idRangeOffset itself to index out the correct glyphIdArray value. // //This obscure indexing trick works because glyphIdArray immediately follows idRangeOffset in the font file. // //The C expression that yields the glyph index is: // //*(idRangeOffset[i]/2 // //+ (c - startCount[i]) // //+ &idRangeOffset[i]) // if (!collector.HasRegisterSegment(i)) // { // List<ushort> glyphIndexList = new List<ushort>(); // char beginAt = (char)_startCode[i]; // char endAt = (char)_endCode[i]; // for (char m = beginAt; m <= endAt; ++m) // { // var offset = _idRangeOffset[i] / 2 + (m - _startCode[i]); // // I want to thank Microsoft for this clever pointer trick // // TODO: What if the value fetched is inside the _idRangeOffset table? // // TODO: e.g. (offset - _idRangeOffset.Length + i < 0) // glyphIndexList.Add(_glyphIdArray[offset - _idRangeOffset.Length + i]); // } // collector.RegisterGlyphRangeIndex(i, glyphIndexList); // } // } // } // } // } // break; // case 6: // { // //The firstCode and entryCount values specify a subrange (beginning at firstCode, length = entryCount) // //within the range of possible character codes. // //Codes outside of this subrange are mapped to glyph index 0. // //The offset of the code (from the first code) within this subrange is used as index to the glyphIdArray, // //which provides the glyph index value. // if (sampleChar >= _fmt6_start && sampleChar < _fmt6_end) // { // //in range // if (!collector.HasRegisterSegment(0)) // { // List<ushort> glyphIndexList = new List<ushort>(); // for (ushort m = _fmt6_start; m < _fmt6_end; ++m) // { // glyphIndexList.Add((ushort)(m - _fmt6_start)); // } // collector.RegisterGlyphRangeIndex(0, glyphIndexList); // } // } // } // break; // } //} } //public class GlyphIndexCollector //{ // Dictionary<int, List<ushort>> _registerSegments = new Dictionary<int, List<ushort>>(); // public bool HasRegisterSegment(int segmentNumber) // { // return _registerSegments.ContainsKey(segmentNumber); // } // public void RegisterGlyphRangeIndex(int segmentNumber, List<ushort> glyphIndexList) // { // _registerSegments.Add(segmentNumber, glyphIndexList); // } // public IEnumerable<ushort> GetGlyphIndexIter() // { // foreach (List<ushort> list in _registerSegments.Values) // { // int j = list.Count; // for (int i = 0; i < j; ++i) // { // yield return list[i]; // } // } // } //} >>>>>>> public ushort CharacterToGlyphIndex(int codepoint) { return GetGlyphIndex(codepoint); } public abstract ushort GetGlyphIndex(int codepoint); public abstract void CollectUnicodeChars(List<uint> unicodes); public override string ToString() { return $"fmt:{ Format }, plat:{ PlatformId }, enc:{ EncodingId }"; } }
<<<<<<< TelemetryEvent telemetryEvent = new TelemetryEvent(GetEventName(eventName)); foreach ((string propertyName, object propertyValue) in properties) ======= var telemetryEvent = new TelemetryEvent(GetEventName(eventName)); foreach (var property in properties) >>>>>>> var telemetryEvent = new TelemetryEvent(GetEventName(eventName)); foreach ((string propertyName, object propertyValue) in properties)
<<<<<<< var builder = new Typography.Contours.GlyphPathBuilder(typeface); builder.BuildFromGlyphIndex(typeface.GetGlyphIndex(selectedChar), 300); ======= var builder = new Typography.Contours.GlyphOutlineBuilder(typeface); builder.BuildFromGlyphIndex(typeface.LookupIndex(selectedChar), 300); >>>>>>> var builder = new Typography.Contours.GlyphOutlineBuilder(typeface); builder.BuildFromGlyphIndex(typeface.GetGlyphIndex(selectedChar), 300);
<<<<<<< // Copyright 2007-2008 The Apache Software Foundation. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. namespace LegacyRuntime { using System; using System.IO; using log4net; using log4net.Config; using Magnum.Reflection; using MassTransit.LegacySupport; using MassTransit.StructureMapIntegration; using MassTransit.Transports.Msmq; using StructureMap; using StructureMap.Configuration.DSL; using Topshelf; using Topshelf.Configuration; internal class Program { private static readonly ILog _log = LogManager.GetLogger(typeof (Program)); private static void Main(string[] args) { BootstrapLogger(); MsmqEndpointConfigurator.Defaults(x => { x.CreateMissingQueues = true; }); IRunConfiguration cfg = RunnerConfigurator.New(config => { config.SetServiceName(typeof (Program).Namespace); config.SetDisplayName(typeof (Program).Namespace); config.SetDescription("MassTransit Legacy Services"); config.RunAsLocalSystem(); config.DependencyOnMsmq(); config.DependencyOnMsSql(); config.ConfigureService<LegacySubscriptionProxyService>("name", s => { ConfigureService<LegacySubscriptionProxyService, LegacySupportRegistry>(s, start => start.Start(), stop => stop.Stop()); }); config.AfterStoppingTheHost(x => { _log.Info("MassTransit Legacy Services are exiting..."); }); }); Runner.Host(cfg, args); } private static void BootstrapLogger() { string configFileName = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + typeof (Program).Namespace + ".log4net.xml"; XmlConfigurator.ConfigureAndWatch(new FileInfo(configFileName)); _log.Info("Loading " + typeof (Program).Namespace + " Services..."); } private static void ConfigureService<TService, TRegistry>(IServiceConfigurator<TService> service, Action<TService> start, Action<TService> stop) where TRegistry : Registry { service.CreateServiceLocator(() => { var container = new Container(x => { x.For<IConfiguration>() .Singleton() .Add<Configuration>(); x.For<TService>() .AddInstances(i => i.Type<TService>().Named(typeof (TService).Name)); }); TRegistry registry = FastActivator<TRegistry>.Create(container); container.Configure(x => x.AddRegistry(registry)); return new StructureMapObjectBuilder(container); }); service.WhenStarted(start); service.WhenStopped(stop); } } } ======= using Topshelf.Configuration.Dsl; namespace LegacyRuntime { using System; using System.IO; using log4net; using log4net.Config; using Magnum.Reflection; using MassTransit.LegacySupport; using MassTransit.StructureMapIntegration; using MassTransit.Transports.Msmq; using StructureMap; using StructureMap.Configuration.DSL; using Topshelf; using Topshelf.Configuration; class Program { private static readonly ILog _log = LogManager.GetLogger(typeof(Program)); static void Main(string[] args) { BootstrapLogger(); MsmqEndpointConfigurator.Defaults(x => { x.CreateMissingQueues = true; }); var cfg = RunnerConfigurator.New(config => { config.SetServiceName(typeof(Program).Namespace); config.SetDisplayName(typeof(Program).Namespace); config.SetDescription("MassTransit Legacy Services"); config.RunAsLocalSystem(); config.DependencyOnMsmq(); config.DependencyOnMsSql(); config.ConfigureService<LegacySubscriptionProxyService>(s => { ConfigureService<LegacySubscriptionProxyService, LegacySupportRegistry>(s, start=>start.Start(), stop=>stop.Stop()); }); config.AfterStoppingTheHost(x => { _log.Info("MassTransit Legacy Services are exiting..."); }); }); Runner.Host(cfg, args); } private static void BootstrapLogger() { var configFileName = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + typeof(Program).Namespace + ".log4net.xml"; XmlConfigurator.ConfigureAndWatch(new FileInfo(configFileName)); _log.Info("Loading " + typeof(Program).Namespace + " Services..."); } private static void ConfigureService<TService, TRegistry>(IServiceConfigurator<TService> service, Action<TService> start, Action<TService> stop) where TRegistry : Registry { var registry = FastActivator<TRegistry>.Create(ObjectFactory.Container); ObjectFactory.Configure(cfg => { cfg.For<IConfiguration>().Singleton().Use<Configuration>(); cfg.AddRegistry(registry); }); service.HowToBuildService(builder => ObjectFactory.GetInstance<TService>()); service.WhenStarted(start); service.WhenStopped(stop); } } } >>>>>>> // Copyright 2007-2008 The Apache Software Foundation. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. namespace LegacyRuntime { using System; using System.IO; using log4net; using log4net.Config; using Magnum.Reflection; using MassTransit.LegacySupport; using MassTransit.StructureMapIntegration; using MassTransit.Transports.Msmq; using StructureMap; using StructureMap.Configuration.DSL; using Topshelf; using Topshelf.Configuration; using Topshelf.Configuration.Dsl; class Program { private static readonly ILog _log = LogManager.GetLogger(typeof(Program)); static void Main(string[] args) { BootstrapLogger(); MsmqEndpointConfigurator.Defaults(x => { x.CreateMissingQueues = true; }); var cfg = RunnerConfigurator.New(config => { config.SetServiceName(typeof(Program).Namespace); config.SetDisplayName(typeof(Program).Namespace); config.SetDescription("MassTransit Legacy Services"); config.RunAsLocalSystem(); config.DependencyOnMsmq(); config.DependencyOnMsSql(); config.ConfigureService<LegacySubscriptionProxyService>(s => { ConfigureService<LegacySubscriptionProxyService, LegacySupportRegistry>(s, start=>start.Start(), stop=>stop.Stop()); }); config.AfterStoppingTheHost(x => { _log.Info("MassTransit Legacy Services are exiting..."); }); }); Runner.Host(cfg, args); } private static void BootstrapLogger() { var configFileName = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + typeof(Program).Namespace + ".log4net.xml"; XmlConfigurator.ConfigureAndWatch(new FileInfo(configFileName)); _log.Info("Loading " + typeof(Program).Namespace + " Services..."); } private static void ConfigureService<TService, TRegistry>(IServiceConfigurator<TService> service, Action<TService> start, Action<TService> stop) where TRegistry : Registry { var registry = FastActivator<TRegistry>.Create(ObjectFactory.Container); ObjectFactory.Configure(cfg => { cfg.For<IConfiguration>().Singleton().Use<Configuration>(); cfg.AddRegistry(registry); }); service.HowToBuildService(builder => ObjectFactory.GetInstance<TService>()); service.WhenStarted(start); service.WhenStopped(stop); } } }
<<<<<<< /// The poolMetaData is set by the pool which created the entity and contains information about the pool. /// It's used to provide better error messages. ======= public Stack<IComponent>[] componentPools { get { return _componentPools; } } >>>>>>> public Stack<IComponent>[] componentPools { get { return _componentPools; } } /// The poolMetaData is set by the pool which created the entity and contains information about the pool. /// It's used to provide better error messages. <<<<<<< /// Use pool.CreateEntity() to create a new entity. public Entity(int totalComponents, PoolMetaData poolMetaData = null) { ======= public Entity(int totalComponents, Stack<IComponent>[] componentPools, PoolMetaData poolMetaData = null) { >>>>>>> public Entity(int totalComponents, Stack<IComponent>[] componentPools, PoolMetaData poolMetaData = null) { <<<<<<< /// Gets the count of objects that retain this entity. ======= #if ENTITAS_FAST_AND_UNSAFE public int retainCount { get { return _retainCount; } } int _retainCount; #else >>>>>>> #if ENTITAS_FAST_AND_UNSAFE /// Gets the count of objects that retain this entity. public int retainCount { get { return _retainCount; } } int _retainCount; #else /// Gets the count of objects that retain this entity. <<<<<<< /// Retains the entity. An owner can only retain the same entity once. Retain/Release is used internally and usually you don't use it manually. /// If you use retain manually you also have to release it manually at some point. ======= #endif >>>>>>> #endif /// Retains the entity. An owner can only retain the same entity once. Retain/Release is used internally and usually you don't use it manually. /// If you use retain manually you also have to release it manually at some point.
<<<<<<< ======= [Test] public void TestMaterializedViewSchema([IncludeDataSources(TestProvName.AllPostgreSQL)] string context) { using (var db = new TestDataConnection(context)) { var schema = db.DataProvider.GetSchemaProvider().GetSchema(db); var view = schema.Tables.FirstOrDefault(t => t.TableName == "Issue2023"); if (context.Contains("9.2")) { // test that schema load is not broken by materialized view support for old versions Assert.IsNull(view); return; } Assert.IsNotNull(view); Assert.AreEqual("public.Issue2023", view.ID); Assert.IsNull(view.CatalogName); Assert.AreEqual("public", view.SchemaName); Assert.AreEqual("Issue2023", view.TableName); Assert.AreEqual("This is the Issue2023 matview", view.Description); Assert.AreEqual(true, view.IsDefaultSchema); Assert.AreEqual(true, view.IsView); Assert.AreEqual(false, view.IsProcedureResult); Assert.AreEqual("Issue2023", view.TypeName); Assert.AreEqual(false, view.IsProviderSpecific); Assert.AreEqual(0, view.ForeignKeys.Count); Assert.AreEqual(5, view.Columns.Count); Assert.AreEqual("PersonID", view.Columns[0].ColumnName); Assert.AreEqual("int4", view.Columns[0].ColumnType); Assert.AreEqual(true, view.Columns[0].IsNullable); Assert.AreEqual(false, view.Columns[0].IsIdentity); Assert.AreEqual(false, view.Columns[0].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[0].PrimaryKeyOrder); Assert.AreEqual("This is the Issue2023.PersonID column", view.Columns[0].Description); Assert.AreEqual("PersonID", view.Columns[0].MemberName); Assert.AreEqual("int?", view.Columns[0].MemberType); Assert.AreEqual(null, view.Columns[0].ProviderSpecificType); Assert.AreEqual(typeof(int), view.Columns[0].SystemType); Assert.AreEqual(DataType.Int32, view.Columns[0].DataType); Assert.AreEqual(true, view.Columns[0].SkipOnInsert); Assert.AreEqual(true, view.Columns[0].SkipOnUpdate); Assert.AreEqual(null, view.Columns[0].Length); // TODO: maybe we should fix it? Assert.AreEqual(32, view.Columns[0].Precision); Assert.AreEqual(0, view.Columns[0].Scale); Assert.AreEqual(view, view.Columns[0].Table); Assert.AreEqual("FirstName", view.Columns[1].ColumnName); Assert.AreEqual("character varying(50)", view.Columns[1].ColumnType); Assert.AreEqual(true, view.Columns[1].IsNullable); Assert.AreEqual(false, view.Columns[1].IsIdentity); Assert.AreEqual(false, view.Columns[1].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[1].PrimaryKeyOrder); Assert.IsNull(view.Columns[1].Description); Assert.AreEqual("FirstName", view.Columns[1].MemberName); Assert.AreEqual("string", view.Columns[1].MemberType); Assert.AreEqual(null, view.Columns[1].ProviderSpecificType); Assert.AreEqual(typeof(string), view.Columns[1].SystemType); Assert.AreEqual(DataType.NVarChar, view.Columns[1].DataType); Assert.AreEqual(true, view.Columns[1].SkipOnInsert); Assert.AreEqual(true, view.Columns[1].SkipOnUpdate); Assert.AreEqual(50, view.Columns[1].Length); Assert.AreEqual(null, view.Columns[1].Precision); Assert.AreEqual(null, view.Columns[1].Scale); Assert.AreEqual(view, view.Columns[1].Table); Assert.AreEqual("LastName", view.Columns[2].ColumnName); Assert.AreEqual("character varying(50)", view.Columns[2].ColumnType); Assert.AreEqual(true, view.Columns[2].IsNullable); Assert.AreEqual(false, view.Columns[2].IsIdentity); Assert.AreEqual(false, view.Columns[2].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[2].PrimaryKeyOrder); Assert.IsNull(view.Columns[2].Description); Assert.AreEqual("LastName", view.Columns[2].MemberName); Assert.AreEqual("string", view.Columns[2].MemberType); Assert.AreEqual(null, view.Columns[2].ProviderSpecificType); Assert.AreEqual(typeof(string), view.Columns[2].SystemType); Assert.AreEqual(DataType.NVarChar, view.Columns[2].DataType); Assert.AreEqual(true, view.Columns[2].SkipOnInsert); Assert.AreEqual(true, view.Columns[2].SkipOnUpdate); Assert.AreEqual(50, view.Columns[2].Length); Assert.AreEqual(null, view.Columns[2].Precision); Assert.AreEqual(null, view.Columns[2].Scale); Assert.AreEqual(view, view.Columns[2].Table); Assert.AreEqual("MiddleName", view.Columns[3].ColumnName); Assert.AreEqual("character varying(50)", view.Columns[3].ColumnType); Assert.AreEqual(true, view.Columns[3].IsNullable); Assert.AreEqual(false, view.Columns[3].IsIdentity); Assert.AreEqual(false, view.Columns[3].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[3].PrimaryKeyOrder); Assert.IsNull(view.Columns[3].Description); Assert.AreEqual("MiddleName", view.Columns[3].MemberName); Assert.AreEqual("string", view.Columns[3].MemberType); Assert.AreEqual(null, view.Columns[3].ProviderSpecificType); Assert.AreEqual(typeof(string), view.Columns[3].SystemType); Assert.AreEqual(DataType.NVarChar, view.Columns[3].DataType); Assert.AreEqual(true, view.Columns[3].SkipOnInsert); Assert.AreEqual(true, view.Columns[3].SkipOnUpdate); Assert.AreEqual(50, view.Columns[3].Length); Assert.AreEqual(null, view.Columns[3].Precision); Assert.AreEqual(null, view.Columns[3].Scale); Assert.AreEqual(view, view.Columns[3].Table); Assert.AreEqual("Gender", view.Columns[4].ColumnName); Assert.AreEqual("character(1)", view.Columns[4].ColumnType); Assert.AreEqual(true, view.Columns[4].IsNullable); Assert.AreEqual(false, view.Columns[4].IsIdentity); Assert.AreEqual(false, view.Columns[4].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[4].PrimaryKeyOrder); Assert.IsNull(view.Columns[4].Description); Assert.AreEqual("Gender", view.Columns[4].MemberName); Assert.AreEqual("char?", view.Columns[4].MemberType); Assert.AreEqual(null, view.Columns[4].ProviderSpecificType); Assert.AreEqual(typeof(char), view.Columns[4].SystemType); Assert.AreEqual(DataType.NChar, view.Columns[4].DataType); Assert.AreEqual(true, view.Columns[4].SkipOnInsert); Assert.AreEqual(true, view.Columns[4].SkipOnUpdate); Assert.AreEqual(1, view.Columns[4].Length); Assert.AreEqual(null, view.Columns[4].Precision); Assert.AreEqual(null, view.Columns[4].Scale); Assert.AreEqual(view, view.Columns[4].Table); } } #endif >>>>>>> [Test] public void TestMaterializedViewSchema([IncludeDataSources(TestProvName.AllPostgreSQL)] string context) { using (var db = new TestDataConnection(context)) { var schema = db.DataProvider.GetSchemaProvider().GetSchema(db); var view = schema.Tables.FirstOrDefault(t => t.TableName == "Issue2023"); if (context.Contains("9.2")) { // test that schema load is not broken by materialized view support for old versions Assert.IsNull(view); return; } Assert.IsNotNull(view); Assert.AreEqual("public.Issue2023", view.ID); Assert.IsNull(view.CatalogName); Assert.AreEqual("public", view.SchemaName); Assert.AreEqual("Issue2023", view.TableName); Assert.AreEqual("This is the Issue2023 matview", view.Description); Assert.AreEqual(true, view.IsDefaultSchema); Assert.AreEqual(true, view.IsView); Assert.AreEqual(false, view.IsProcedureResult); Assert.AreEqual("Issue2023", view.TypeName); Assert.AreEqual(false, view.IsProviderSpecific); Assert.AreEqual(0, view.ForeignKeys.Count); Assert.AreEqual(5, view.Columns.Count); Assert.AreEqual("PersonID", view.Columns[0].ColumnName); Assert.AreEqual("int4", view.Columns[0].ColumnType); Assert.AreEqual(true, view.Columns[0].IsNullable); Assert.AreEqual(false, view.Columns[0].IsIdentity); Assert.AreEqual(false, view.Columns[0].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[0].PrimaryKeyOrder); Assert.AreEqual("This is the Issue2023.PersonID column", view.Columns[0].Description); Assert.AreEqual("PersonID", view.Columns[0].MemberName); Assert.AreEqual("int?", view.Columns[0].MemberType); Assert.AreEqual(null, view.Columns[0].ProviderSpecificType); Assert.AreEqual(typeof(int), view.Columns[0].SystemType); Assert.AreEqual(DataType.Int32, view.Columns[0].DataType); Assert.AreEqual(true, view.Columns[0].SkipOnInsert); Assert.AreEqual(true, view.Columns[0].SkipOnUpdate); Assert.AreEqual(null, view.Columns[0].Length); // TODO: maybe we should fix it? Assert.AreEqual(32, view.Columns[0].Precision); Assert.AreEqual(0, view.Columns[0].Scale); Assert.AreEqual(view, view.Columns[0].Table); Assert.AreEqual("FirstName", view.Columns[1].ColumnName); Assert.AreEqual("character varying(50)", view.Columns[1].ColumnType); Assert.AreEqual(true, view.Columns[1].IsNullable); Assert.AreEqual(false, view.Columns[1].IsIdentity); Assert.AreEqual(false, view.Columns[1].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[1].PrimaryKeyOrder); Assert.IsNull(view.Columns[1].Description); Assert.AreEqual("FirstName", view.Columns[1].MemberName); Assert.AreEqual("string", view.Columns[1].MemberType); Assert.AreEqual(null, view.Columns[1].ProviderSpecificType); Assert.AreEqual(typeof(string), view.Columns[1].SystemType); Assert.AreEqual(DataType.NVarChar, view.Columns[1].DataType); Assert.AreEqual(true, view.Columns[1].SkipOnInsert); Assert.AreEqual(true, view.Columns[1].SkipOnUpdate); Assert.AreEqual(50, view.Columns[1].Length); Assert.AreEqual(null, view.Columns[1].Precision); Assert.AreEqual(null, view.Columns[1].Scale); Assert.AreEqual(view, view.Columns[1].Table); Assert.AreEqual("LastName", view.Columns[2].ColumnName); Assert.AreEqual("character varying(50)", view.Columns[2].ColumnType); Assert.AreEqual(true, view.Columns[2].IsNullable); Assert.AreEqual(false, view.Columns[2].IsIdentity); Assert.AreEqual(false, view.Columns[2].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[2].PrimaryKeyOrder); Assert.IsNull(view.Columns[2].Description); Assert.AreEqual("LastName", view.Columns[2].MemberName); Assert.AreEqual("string", view.Columns[2].MemberType); Assert.AreEqual(null, view.Columns[2].ProviderSpecificType); Assert.AreEqual(typeof(string), view.Columns[2].SystemType); Assert.AreEqual(DataType.NVarChar, view.Columns[2].DataType); Assert.AreEqual(true, view.Columns[2].SkipOnInsert); Assert.AreEqual(true, view.Columns[2].SkipOnUpdate); Assert.AreEqual(50, view.Columns[2].Length); Assert.AreEqual(null, view.Columns[2].Precision); Assert.AreEqual(null, view.Columns[2].Scale); Assert.AreEqual(view, view.Columns[2].Table); Assert.AreEqual("MiddleName", view.Columns[3].ColumnName); Assert.AreEqual("character varying(50)", view.Columns[3].ColumnType); Assert.AreEqual(true, view.Columns[3].IsNullable); Assert.AreEqual(false, view.Columns[3].IsIdentity); Assert.AreEqual(false, view.Columns[3].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[3].PrimaryKeyOrder); Assert.IsNull(view.Columns[3].Description); Assert.AreEqual("MiddleName", view.Columns[3].MemberName); Assert.AreEqual("string", view.Columns[3].MemberType); Assert.AreEqual(null, view.Columns[3].ProviderSpecificType); Assert.AreEqual(typeof(string), view.Columns[3].SystemType); Assert.AreEqual(DataType.NVarChar, view.Columns[3].DataType); Assert.AreEqual(true, view.Columns[3].SkipOnInsert); Assert.AreEqual(true, view.Columns[3].SkipOnUpdate); Assert.AreEqual(50, view.Columns[3].Length); Assert.AreEqual(null, view.Columns[3].Precision); Assert.AreEqual(null, view.Columns[3].Scale); Assert.AreEqual(view, view.Columns[3].Table); Assert.AreEqual("Gender", view.Columns[4].ColumnName); Assert.AreEqual("character(1)", view.Columns[4].ColumnType); Assert.AreEqual(true, view.Columns[4].IsNullable); Assert.AreEqual(false, view.Columns[4].IsIdentity); Assert.AreEqual(false, view.Columns[4].IsPrimaryKey); Assert.AreEqual(-1, view.Columns[4].PrimaryKeyOrder); Assert.IsNull(view.Columns[4].Description); Assert.AreEqual("Gender", view.Columns[4].MemberName); Assert.AreEqual("char?", view.Columns[4].MemberType); Assert.AreEqual(null, view.Columns[4].ProviderSpecificType); Assert.AreEqual(typeof(char), view.Columns[4].SystemType); Assert.AreEqual(DataType.NChar, view.Columns[4].DataType); Assert.AreEqual(true, view.Columns[4].SkipOnInsert); Assert.AreEqual(true, view.Columns[4].SkipOnUpdate); Assert.AreEqual(1, view.Columns[4].Length); Assert.AreEqual(null, view.Columns[4].Precision); Assert.AreEqual(null, view.Columns[4].Scale); Assert.AreEqual(view, view.Columns[4].Table); } }
<<<<<<< var serverName = options.ServerName ?? descriptor.ServerName; var databaseName = options.DatabaseName ?? descriptor.DatabaseName; var schemaName = options.SchemaName ?? descriptor.SchemaName; var tableName = options.TableName ?? descriptor.TableName; ======= var databaseName = options.DatabaseName ?? table.DatabaseName; var schemaName = options.SchemaName ?? table.SchemaName; var tableName = options.TableName ?? table.TableName; >>>>>>> var serverName = options.ServerName ?? descriptor.ServerName; var databaseName = options.DatabaseName ?? table.DatabaseName; var schemaName = options.SchemaName ?? table.SchemaName; var tableName = options.TableName ?? table.TableName;
<<<<<<< case TestProvName.SqlAzure : RunScript(context, "\nGO\n", "SqlServer"); break; case TestProvName.Default : RunScript(context, "\nGO\n", "SQLite", SQLiteAction); break; ======= case TestProvName.SqlServer2019SequentialAccess : case TestProvName.SqlAzure : RunScript(context, "\nGO\n", "SqlServer"); break; >>>>>>> case TestProvName.Default : RunScript(context, "\nGO\n", "SQLite", SQLiteAction); break; case TestProvName.SqlServer2019SequentialAccess : case TestProvName.SqlAzure : RunScript(context, "\nGO\n", "SqlServer"); break;
<<<<<<< if (ce.IsAssociation(MappingSchema)) { var ctx = GetContext(context, ce); if (ctx == null) throw new InvalidOperationException(); return new TransformInfo(ctx.BuildExpression(ce, 0)); } if ((_buildMultipleQueryExpressions == null || !_buildMultipleQueryExpressions.Contains(ce)) && IsSubQuery(context, ce)) { if (IsMultipleQuery(ce)) return new TransformInfo(BuildMultipleQuery(context, ce)); ======= break; } >>>>>>> if (ce.IsAssociation(MappingSchema)) { var ctx = GetContext(context, ce); if (ctx == null) throw new InvalidOperationException(); break; } return new TransformInfo(ctx.BuildExpression(ce, 0)); }
<<<<<<< static class AdditionalSql { [Sql.Expression("(({2} * ({1} - {0}) / {2}) * {0})", ServerSideOnly = true)] public static int Operation(int item1, int item2, int item3) { return (item3 * (item2 - item1) / item3) * item1; } } [Test] public void TestPositionedParameters([DataSources] string context) { using (var db = GetDataContext(context)) { var x3 = 3; var y10 = 10; var z2 = 2; var query = from child in db.Child select new { Value1 = Sql.AsSql(AdditionalSql.Operation(child.ChildID, AdditionalSql.Operation(z2, y10, AdditionalSql.Operation(z2, y10, x3)), AdditionalSql.Operation(z2, y10, x3))) }; var expected = from child in Child select new { Value1 = AdditionalSql.Operation(child.ChildID, AdditionalSql.Operation(z2, y10, AdditionalSql.Operation(z2, y10, x3)), AdditionalSql.Operation(z2, y10, x3)) }; AreEqual(expected, query); } } ======= [Test] public void TestQueryableCall([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildren(db).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } [Test] public void TestQueryableCallWithParameters([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildrenFiltered(db, c => c.ChildID != 5).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } [Test] public void TestQueryableCallWithParametersWorkaround([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildrenFiltered(db, ChildFilter).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } // sequence evaluation fails in GetChildrenFiltered2 [ActiveIssue("Unable to cast object of type 'System.Linq.Expressions.FieldExpression' to type 'System.Linq.Expressions.LambdaExpression'.")] [Test] public void TestQueryableCallWithParametersWorkaround2([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildrenFiltered2(db, ChildFilter).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } [Test] public void TestQueryableCallMustFail([DataSources] string context) { using (var db = GetDataContext(context)) { // we use external parameter p in GetChildrenFiltered parameter expression // Sequence 'GetChildrenFiltered(value(Tests.Linq.ParameterTests+<>c__DisplayClass18_0).db, c => (c.ChildID != p.ParentID))' cannot be converted to SQL. Assert.Throws<LinqException>(() => db.Parent.Where(p => GetChildrenFiltered(db, c => c.ChildID != p.ParentID).Select(c => c.ParentID).Contains(p.ParentID)).ToList()); } } private static bool ChildFilter(Model.Child c) => c.ChildID != 5; private static IQueryable<Model.Child> GetChildren(Model.ITestDataContext db) { return db.Child; } private static IQueryable<Model.Child> GetChildrenFiltered(Model.ITestDataContext db, Func<Model.Child, bool> filter) { // looks strange, but it's just to make testcase work var list = db.Child.Where(filter).Select(r => r.ChildID).ToList(); return db.Child.Where(c => list.Contains(c.ChildID)); } private static IQueryable<Model.Child> GetChildrenFiltered2(Model.ITestDataContext db, Func<Model.Child, bool> filter) { var list = db.Child.ToList(); return db.Child.Where(c => list.Where(filter).Select(r => r.ChildID).Contains(c.ChildID)); } >>>>>>> static class AdditionalSql { [Sql.Expression("(({2} * ({1} - {0}) / {2}) * {0})", ServerSideOnly = true)] public static int Operation(int item1, int item2, int item3) { return (item3 * (item2 - item1) / item3) * item1; } } [Test] public void TestPositionedParameters([DataSources] string context) { using (var db = GetDataContext(context)) { var x3 = 3; var y10 = 10; var z2 = 2; var query = from child in db.Child select new { Value1 = Sql.AsSql(AdditionalSql.Operation(child.ChildID, AdditionalSql.Operation(z2, y10, AdditionalSql.Operation(z2, y10, x3)), AdditionalSql.Operation(z2, y10, x3))) }; var expected = from child in Child select new { Value1 = AdditionalSql.Operation(child.ChildID, AdditionalSql.Operation(z2, y10, AdditionalSql.Operation(z2, y10, x3)), AdditionalSql.Operation(z2, y10, x3)) }; AreEqual(expected, query); } } [Test] public void TestQueryableCall([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildren(db).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } [Test] public void TestQueryableCallWithParameters([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildrenFiltered(db, c => c.ChildID != 5).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } [Test] public void TestQueryableCallWithParametersWorkaround([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildrenFiltered(db, ChildFilter).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } // sequence evaluation fails in GetChildrenFiltered2 [ActiveIssue("Unable to cast object of type 'System.Linq.Expressions.FieldExpression' to type 'System.Linq.Expressions.LambdaExpression'.")] [Test] public void TestQueryableCallWithParametersWorkaround2([DataSources] string context) { using (var db = GetDataContext(context)) { db.Parent.Where(p => GetChildrenFiltered2(db, ChildFilter).Select(c => c.ParentID).Contains(p.ParentID)).ToList(); } } [Test] public void TestQueryableCallMustFail([DataSources] string context) { using (var db = GetDataContext(context)) { // we use external parameter p in GetChildrenFiltered parameter expression // Sequence 'GetChildrenFiltered(value(Tests.Linq.ParameterTests+<>c__DisplayClass18_0).db, c => (c.ChildID != p.ParentID))' cannot be converted to SQL. Assert.Throws<LinqException>(() => db.Parent.Where(p => GetChildrenFiltered(db, c => c.ChildID != p.ParentID).Select(c => c.ParentID).Contains(p.ParentID)).ToList()); } } private static bool ChildFilter(Model.Child c) => c.ChildID != 5; private static IQueryable<Model.Child> GetChildren(Model.ITestDataContext db) { return db.Child; } private static IQueryable<Model.Child> GetChildrenFiltered(Model.ITestDataContext db, Func<Model.Child, bool> filter) { // looks strange, but it's just to make testcase work var list = db.Child.Where(filter).Select(r => r.ChildID).ToList(); return db.Child.Where(c => list.Contains(c.ChildID)); } private static IQueryable<Model.Child> GetChildrenFiltered2(Model.ITestDataContext db, Func<Model.Child, bool> filter) { var list = db.Child.ToList(); return db.Child.Where(c => list.Where(filter).Select(r => r.ChildID).Contains(c.ChildID)); }
<<<<<<< List<string> first = null; foreach (IActiveDebugFrameworkServices activeDebugFramework in activeDebugFrameworks) { frameworks = await activeDebugFramework.GetProjectFrameworksAsync().ConfigureAwait(false); if (first == null) { first = frameworks; } else { if (!first.SequenceEqual(frameworks)) { frameworks = null; break; } } } ======= frameworks = await activeDebugFramework.GetProjectFrameworksAsync(); >>>>>>> List<string> first = null; foreach (IActiveDebugFrameworkServices activeDebugFramework in activeDebugFrameworks) { frameworks = await activeDebugFramework.GetProjectFrameworksAsync(); if (first == null) { first = frameworks; } else { if (!first.SequenceEqual(frameworks)) { frameworks = null; break; } } } <<<<<<< // Only call this if we will need it down below. activeFramework = await activeDebugFrameworks[0].GetActiveDebuggingFrameworkPropertyAsync().ConfigureAwait(false); ======= // Only call this if we will need it down below. activeFramework = await activeDebugFramework.GetActiveDebuggingFrameworkPropertyAsync(); >>>>>>> // Only call this if we will need it down below. activeFramework = await activeDebugFrameworks[0].GetActiveDebuggingFrameworkPropertyAsync(); <<<<<<< #pragma warning disable VSTHRD102 // Only wrapped for test purposes ThreadHelper.JoinableTaskFactory.Run(async () => #pragma warning restore VSTHRD102 { await asyncFunction().ConfigureAwait(false); }); ======= #pragma warning disable VSTHRD102 // Implement internal logic asynchronously ThreadHelper.JoinableTaskFactory.Run(asyncFunction); #pragma warning restore VSTHRD102 // Implement internal logic asynchronously >>>>>>> #pragma warning disable VSTHRD102 // Implement internal logic asynchronously ThreadHelper.JoinableTaskFactory.Run(asyncFunction); #pragma warning restore VSTHRD102 // Implement internal logic asynchronously
<<<<<<< using System; using System.Collections.Generic; using System.Linq; namespace LinqToDB.SqlQuery ======= using System; namespace LinqToDB.SqlQuery >>>>>>> using System; using System.Collections.Generic; namespace LinqToDB.SqlQuery <<<<<<< public static SqlInsertClause RequireInsertClause(this SqlStatement statement) ======= public static ISqlExpression AsExpression(this SqlStatement statement) >>>>>>> public static SqlInsertClause RequireInsertClause(this SqlStatement statement) <<<<<<< public static SqlUpdateClause GetUpdateClause(this SqlStatement statement) { switch (statement) { case SqlUpdateStatement update: return update.Update; case SqlInsertOrUpdateStatement insertOrUpdate: return insertOrUpdate.Update; } return null; } public static SqlUpdateClause RequireUpdateClause(this SqlStatement statement) { var result = statement.GetUpdateClause(); if (result == null) throw new LinqToDBException($"Update clause not found in {statement.GetType().Name}"); return result; } public static SelectQuery EnsureQuery(this SqlStatement statement) { var selectQuery = statement.SelectQuery; if (selectQuery == null) throw new LinqToDBException("Sqlect Query required"); return selectQuery; } public static T Clone<T>(this T cloneable) where T: ICloneableElement { return (T)cloneable.Clone(new Dictionary<ICloneableElement,ICloneableElement>(), _ => true); } public static T Clone<T>(this T cloneable, Predicate<ICloneableElement> doClone) where T: ICloneableElement { return (T)cloneable.Clone(new Dictionary<ICloneableElement,ICloneableElement>(), doClone); } ======= >>>>>>> public static SqlUpdateClause GetUpdateClause(this SqlStatement statement) { switch (statement) { case SqlUpdateStatement update: return update.Update; case SqlInsertOrUpdateStatement insertOrUpdate: return insertOrUpdate.Update; } return null; } public static SqlUpdateClause RequireUpdateClause(this SqlStatement statement) { var result = statement.GetUpdateClause(); if (result == null) throw new LinqToDBException($"Update clause not found in {statement.GetType().Name}"); return result; } public static SelectQuery EnsureQuery(this SqlStatement statement) { var selectQuery = statement.SelectQuery; if (selectQuery == null) throw new LinqToDBException("Sqlect Query required"); return selectQuery; } public static T Clone<T>(this T cloneable) where T: ICloneableElement { return (T)cloneable.Clone(new Dictionary<ICloneableElement,ICloneableElement>(), _ => true); } public static T Clone<T>(this T cloneable, Predicate<ICloneableElement> doClone) where T: ICloneableElement { return (T)cloneable.Clone(new Dictionary<ICloneableElement,ICloneableElement>(), doClone); }
<<<<<<< [Test, DataContextSource( ProviderName.SQLite, ProviderName.Access, ProviderName.Informix, ProviderName.Firebird, ProviderName.PostgreSQL, ProviderName.MySql, ProviderName.Sybase)] public void UpdateIssue319Regression(string context) { using (var db = GetDataContext(context)) { var id = 100500; try { db.Insert(new Parent1() { ParentID = id }); var query = db.GetTable<Parent1>() .Where(_ => _.ParentID == id) .Select(_ => new Parent1() { ParentID = _.ParentID }); var queryResult = new Lazy<Parent1>(() => query.First()); var cnt = db.GetTable<Parent1>() .Where(_ => _.ParentID == id && query.Count() > 0) .Update(_ => new Parent1() { Value1 = queryResult.Value.ParentID }); Assert.AreEqual(1, cnt); } finally { db.GetTable<Parent1>().Delete(_ => _.ParentID == id); } } } ======= [Test, DataContextSource] public void UpdateIssue321Regression(string context) { using (var db = GetDataContext(context)) { var id = 100500; try { var value1 = 3000m; var value2 = 13621m; var value3 = 60; db.Insert(new LinqDataTypes2() { ID = id, MoneyValue = value1, IntValue = value3 }); db.GetTable<LinqDataTypes2>() .Update(_ => new LinqDataTypes2() { SmallIntValue = (short)(_.MoneyValue / (value2 / _.IntValue)) }); var dbResult = db.GetTable<LinqDataTypes2>() .Where(_ => _.ID == id) .Select(_ => _.SmallIntValue).First(); var expected = (short)(value1 / (value2 / value3)); Assert.AreEqual(expected, dbResult); } finally { db.GetTable<LinqDataTypes2>().Delete(c => c.ID == id); } } } >>>>>>> [Test, DataContextSource( ProviderName.SQLite, ProviderName.Access, ProviderName.Informix, ProviderName.Firebird, ProviderName.PostgreSQL, ProviderName.MySql, ProviderName.Sybase)] public void UpdateIssue319Regression(string context) { using (var db = GetDataContext(context)) { var id = 100500; try { db.Insert(new Parent1() { ParentID = id }); var query = db.GetTable<Parent1>() .Where(_ => _.ParentID == id) .Select(_ => new Parent1() { ParentID = _.ParentID }); var queryResult = new Lazy<Parent1>(() => query.First()); var cnt = db.GetTable<Parent1>() .Where(_ => _.ParentID == id && query.Count() > 0) .Update(_ => new Parent1() { Value1 = queryResult.Value.ParentID }); Assert.AreEqual(1, cnt); } finally { db.GetTable<Parent1>().Delete(_ => _.ParentID == id); } } } [Test, DataContextSource] public void UpdateIssue321Regression(string context) { using (var db = GetDataContext(context)) { var id = 100500; try { var value1 = 3000m; var value2 = 13621m; var value3 = 60; db.Insert(new LinqDataTypes2() { ID = id, MoneyValue = value1, IntValue = value3 }); db.GetTable<LinqDataTypes2>() .Update(_ => new LinqDataTypes2() { SmallIntValue = (short)(_.MoneyValue / (value2 / _.IntValue)) }); var dbResult = db.GetTable<LinqDataTypes2>() .Where(_ => _.ID == id) .Select(_ => _.SmallIntValue).First(); var expected = (short)(value1 / (value2 / value3)); Assert.AreEqual(expected, dbResult); } finally { db.GetTable<LinqDataTypes2>().Delete(c => c.ID == id); } } }
<<<<<<< _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName, isTemporary: isTemporary); Copy(items, options); ======= _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName); try { Copy(items, options); } catch { try { _table.DropTable(); } catch { } throw; } >>>>>>> _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName, isTemporary: isTemporary); try { Copy(items, options); } catch { try { _table.DropTable(); } catch { } throw; } <<<<<<< _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName, isTemporary: isTemporary); action?.Invoke(_table); Insert(items); ======= _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName); try { action?.Invoke(_table); Insert(items); } catch { try { _table.DropTable(); } catch { } throw; } >>>>>>> _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName, isTemporary: isTemporary); try { action?.Invoke(_table); Insert(items); } catch { try { _table.DropTable(); } catch { } throw; } <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) : this(db, items, tableName, databaseName, schemaName, action, serverName) >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) : this(db, items, tableName, databaseName, schemaName, action, serverName) <<<<<<< _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName, isTemporary: isTemporary); action?.Invoke(_table); Insert(items); ======= var table = await CreateAsync(db, tableName, databaseName, schemaName, serverName, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); try { await table.CopyAsync(items, options, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); } catch { try { #if NETFRAMEWORK table.Dispose(); #else await table.DisposeAsync(); #endif } catch { } throw; } return table; } /// <summary> /// Creates new temporary table and populate it using data from provided query. /// </summary> /// <param name="db">Database connection instance.</param> /// <param name="items">Query to get records to populate created table with initial data.</param> /// <param name="tableName">Optional name of temporary table. If not specified, value from mapping will be used.</param> /// <param name="databaseName">Optional name of table's database. If not specified, value from mapping will be used.</param> /// <param name="schemaName">Optional name of table schema/owner. If not specified, value from mapping will be used.</param> /// <param name="action">Optional asynchronous action that will be executed after table creation but before it populated with data from <paramref name="items"/>.</param> /// <param name="serverName">Optional name of linked server. If not specified, value from mapping will be used.</param> /// <param name="cancellationToken">Asynchronous operation cancellation token.</param> public static async Task<TempTable<T>> CreateAsync(IDataContext db, IQueryable<T> items, string? tableName = null, string? databaseName = null, string? schemaName = null, Func<ITable<T>, Task>? action = null, string? serverName = null, CancellationToken cancellationToken = default) { if (db == null) throw new ArgumentNullException(nameof(db)); if (items == null) throw new ArgumentNullException(nameof(items)); var table = await CreateAsync(db, tableName, databaseName, schemaName, serverName, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); try { if (action != null) await action.Invoke(table) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); await table.InsertAsync(items, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); } catch { try { #if NETFRAMEWORK table.Dispose(); #else await table.DisposeAsync(); #endif } catch { } throw; } return table; } /// <summary> /// Creates new temporary table and populate it using data from provided query. /// </summary> /// <param name="db">Database connection instance.</param> /// <param name="tableName">Optional name of temporary table. If not specified, value from mapping will be used.</param> /// <param name="items">Query to get records to populate created table with initial data.</param> /// <param name="databaseName">Optional name of table's database. If not specified, value from mapping will be used.</param> /// <param name="schemaName">Optional name of table schema/owner. If not specified, value from mapping will be used.</param> /// <param name="action">Optional asynchronous action that will be executed after table creation but before it populated with data from <paramref name="items"/>.</param> /// <param name="serverName">Optional name of linked server. If not specified, value from mapping will be used.</param> /// <param name="cancellationToken">Asynchronous operation cancellation token.</param> public static Task<TempTable<T>> CreateAsync(IDataContext db, string? tableName, IQueryable<T> items, string? databaseName = null, string? schemaName = null, Func<ITable<T>, Task>? action = null, string? serverName = null, CancellationToken cancellationToken = default) { return CreateAsync(db, items, tableName, databaseName, schemaName, action, serverName, cancellationToken); >>>>>>> var table = await CreateAsync(db, tableName, databaseName, schemaName, serverName, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); try { await table.CopyAsync(items, options, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); } catch { try { #if NETFRAMEWORK table.Dispose(); #else await table.DisposeAsync(); #endif } catch { } throw; } return table; } /// <summary> /// Creates new temporary table and populate it using data from provided query. /// </summary> /// <param name="db">Database connection instance.</param> /// <param name="items">Query to get records to populate created table with initial data.</param> /// <param name="tableName">Optional name of temporary table. If not specified, value from mapping will be used.</param> /// <param name="databaseName">Optional name of table's database. If not specified, value from mapping will be used.</param> /// <param name="schemaName">Optional name of table schema/owner. If not specified, value from mapping will be used.</param> /// <param name="action">Optional asynchronous action that will be executed after table creation but before it populated with data from <paramref name="items"/>.</param> /// <param name="serverName">Optional name of linked server. If not specified, value from mapping will be used.</param> /// <param name="cancellationToken">Asynchronous operation cancellation token.</param> public static async Task<TempTable<T>> CreateAsync(IDataContext db, IQueryable<T> items, string? tableName = null, string? databaseName = null, string? schemaName = null, Func<ITable<T>, Task>? action = null, string? serverName = null, CancellationToken cancellationToken = default) { if (db == null) throw new ArgumentNullException(nameof(db)); if (items == null) throw new ArgumentNullException(nameof(items)); _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName); action?.Invoke(_table); Insert(items); _table = db.CreateTable<T>(tableName, databaseName, schemaName, serverName: serverName, isTemporary: isTemporary); action?.Invoke(_table); Insert(items); var table = await CreateAsync(db, tableName, databaseName, schemaName, serverName, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); try { if (action != null) await action.Invoke(table) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); await table.InsertAsync(items, cancellationToken) .ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); } catch { try { #if NETFRAMEWORK table.Dispose(); #else await table.DisposeAsync(); #endif } catch { } throw; } return table; } /// <summary> /// Creates new temporary table and populate it using data from provided query. /// </summary> /// <param name="db">Database connection instance.</param> /// <param name="tableName">Optional name of temporary table. If not specified, value from mapping will be used.</param> /// <param name="items">Query to get records to populate created table with initial data.</param> /// <param name="databaseName">Optional name of table's database. If not specified, value from mapping will be used.</param> /// <param name="schemaName">Optional name of table schema/owner. If not specified, value from mapping will be used.</param> /// <param name="action">Optional asynchronous action that will be executed after table creation but before it populated with data from <paramref name="items"/>.</param> /// <param name="serverName">Optional name of linked server. If not specified, value from mapping will be used.</param> /// <param name="cancellationToken">Asynchronous operation cancellation token.</param> public static Task<TempTable<T>> CreateAsync(IDataContext db, string? tableName, IQueryable<T> items, string? databaseName = null, string? schemaName = null, Func<ITable<T>, Task>? action = null, string? serverName = null, CancellationToken cancellationToken = default) { return CreateAsync(db, items, tableName, databaseName, schemaName, action, serverName, cancellationToken); <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class <<<<<<< string? serverName = null, bool? isTemporary = null) ======= string? serverName = null) where T : class >>>>>>> string? serverName = null) string? serverName = null, bool? isTemporary = null) string? serverName = null) where T : class
<<<<<<< ======= /// <summary> /// Returns SqlField from specific expression. Usually from SqlColumn. /// Complex expressions ignored. /// </summary> /// <param name="expression"></param> /// <returns>Field instance associated with expression</returns> public static SqlField GetUnderlyingField(ISqlExpression expression) { switch (expression) { case SqlField field: return field; case SqlColumn column: return GetUnderlyingField(column.Expression, new HashSet<ISqlExpression>()); } return null; } static SqlField GetUnderlyingField(ISqlExpression expression, HashSet<ISqlExpression> visited) { switch (expression) { case SqlField field: return field; case SqlColumn column: { if (visited.Contains(column)) return null; visited.Add(column); return GetUnderlyingField(column.Expression, visited); } } return null; } >>>>>>> /// <summary> /// Returns SqlField from specific expression. Usually from SqlColumn. /// Complex expressions ignored. /// </summary> /// <param name="expression"></param> /// <returns>Field instance associated with expression</returns> public static SqlField GetUnderlyingField(ISqlExpression expression) { switch (expression) { case SqlField field: return field; case SqlColumn column: return GetUnderlyingField(column.Expression, new HashSet<ISqlExpression>()); } return null; } static SqlField GetUnderlyingField(ISqlExpression expression, HashSet<ISqlExpression> visited) { switch (expression) { case SqlField field: return field; case SqlColumn column: { if (visited.Contains(column)) return null; visited.Add(column); return GetUnderlyingField(column.Expression, visited); } } return null; }
<<<<<<< using System; ======= using NUnit.Framework; >>>>>>> using System; <<<<<<< ======= [TestFixture] >>>>>>> [TestFixture] <<<<<<< [Test] [ActiveIssue(873, Details = "Also check WCF test error for Access")] public void Test([DataSources] string context) ======= [Test] public void Test([DataSources(ProviderName.SqlCe)] string context) >>>>>>> [Test] public void Test([DataSources(ProviderName.SqlCe)] string context)
<<<<<<< [DebuggerDisplay("SQL = {" + nameof(SqlText) + "}")] public class SelectQuery : ISqlTableSource ======= [DebuggerDisplay("SQL = {" + nameof(SqlText) + "}")] public class SelectQuery : SqlStatement, ISqlTableSource >>>>>>> [DebuggerDisplay("SQL = {" + nameof(SqlText) + "}")] public class SelectQuery : ISqlTableSource <<<<<<< SqlSelectClause select, SqlFromClause from, SqlWhereClause where, SqlGroupByClause groupBy, SqlWhereClause having, SqlOrderByClause orderBy, List<SqlUnion> unions, SelectQuery parentSelect, bool parameterDependent, List<SqlParameter> parameters) ======= SqlInsertClause insert, SqlUpdateClause update, SqlDeleteClause delete, SqlSelectClause select, SqlFromClause from, SqlWhereClause where, SqlGroupByClause groupBy, SqlWhereClause having, SqlOrderByClause orderBy, List<SqlUnion> unions, SelectQuery parentSelect, bool parameterDependent, List<SqlParameter> parameters) >>>>>>> SqlSelectClause select, SqlFromClause from, SqlWhereClause where, SqlGroupByClause groupBy, SqlWhereClause having, SqlOrderByClause orderBy, List<SqlUnion> unions, SelectQuery parentSelect, bool parameterDependent, List<SqlParameter> parameters) <<<<<<< Select. SetSqlQuery(this); _from. SetSqlQuery(this); _where. SetSqlQuery(this); _groupBy.SetSqlQuery(this); _having. SetSqlQuery(this); _orderBy.SetSqlQuery(this); ======= Select. SetSqlQuery(this); From. SetSqlQuery(this); Where. SetSqlQuery(this); GroupBy.SetSqlQuery(this); Having. SetSqlQuery(this); OrderBy.SetSqlQuery(this); >>>>>>> Select. SetSqlQuery(this); From. SetSqlQuery(this); Where. SetSqlQuery(this); GroupBy.SetSqlQuery(this); Having. SetSqlQuery(this); OrderBy.SetSqlQuery(this); <<<<<<< Select = new SqlSelectClause (this, clone.Select, objectTree, doClone); _from = new SqlFromClause (this, clone._from, objectTree, doClone); _where = new SqlWhereClause (this, clone._where, objectTree, doClone); _groupBy = new SqlGroupByClause(this, clone._groupBy, objectTree, doClone); _having = new SqlWhereClause (this, clone._having, objectTree, doClone); _orderBy = new SqlOrderByClause(this, clone._orderBy, objectTree, doClone); ======= _queryType = clone._queryType; if (IsInsert) _insert = (SqlInsertClause)clone._insert.Clone(objectTree, doClone); if (IsUpdate) _update = (SqlUpdateClause)clone._update.Clone(objectTree, doClone); if (IsDelete) _delete = (SqlDeleteClause)clone._delete.Clone(objectTree, doClone); Select = new SqlSelectClause (this, clone.Select, objectTree, doClone); From = new SqlFromClause (this, clone.From, objectTree, doClone); Where = new SqlWhereClause (this, clone.Where, objectTree, doClone); GroupBy = new SqlGroupByClause(this, clone.GroupBy, objectTree, doClone); Having = new SqlWhereClause (this, clone.Having, objectTree, doClone); OrderBy = new SqlOrderByClause(this, clone.OrderBy, objectTree, doClone); >>>>>>> Select = new SqlSelectClause (this, clone.Select, objectTree, doClone); From = new SqlFromClause (this, clone.From, objectTree, doClone); Where = new SqlWhereClause (this, clone.Where, objectTree, doClone); GroupBy = new SqlGroupByClause(this, clone.GroupBy, objectTree, doClone); Having = new SqlWhereClause (this, clone.Having, objectTree, doClone); OrderBy = new SqlOrderByClause(this, clone.OrderBy, objectTree, doClone); <<<<<<< #endregion ======= public SelectQuery Clone() { return (SelectQuery)Clone(new Dictionary<ICloneableElement,ICloneableElement>(), _ => true); } public SelectQuery Clone(Predicate<ICloneableElement> doClone) { return (SelectQuery)Clone(new Dictionary<ICloneableElement,ICloneableElement>(), doClone); } #endregion >>>>>>> public SelectQuery Clone() { return (SelectQuery)Clone(new Dictionary<ICloneableElement,ICloneableElement>(), _ => true); } public SelectQuery Clone(Predicate<ICloneableElement> doClone) { return (SelectQuery)Clone(new Dictionary<ICloneableElement,ICloneableElement>(), doClone); } #endregion <<<<<<< #endregion #region Overrides ======= #endregion #region Overrides >>>>>>> #endregion #region Overrides <<<<<<< ((ISqlExpressionWalkable)Select) .Walk(skipColumns, func); ((ISqlExpressionWalkable)From) .Walk(skipColumns, func); ((ISqlExpressionWalkable)Where) .Walk(skipColumns, func); ((ISqlExpressionWalkable)GroupBy).Walk(skipColumns, func); ((ISqlExpressionWalkable)Having) .Walk(skipColumns, func); ((ISqlExpressionWalkable)OrderBy).Walk(skipColumns, func); ======= ((ISqlExpressionWalkable)_insert)?.Walk(skipColumns, func); ((ISqlExpressionWalkable)_update)?.Walk(skipColumns, func); ((ISqlExpressionWalkable)_delete)?.Walk(skipColumns, func); ((ISqlExpressionWalkable)Select) . Walk(skipColumns, func); ((ISqlExpressionWalkable)From) . Walk(skipColumns, func); ((ISqlExpressionWalkable)Where) . Walk(skipColumns, func); ((ISqlExpressionWalkable)GroupBy). Walk(skipColumns, func); ((ISqlExpressionWalkable)Having) . Walk(skipColumns, func); ((ISqlExpressionWalkable)OrderBy). Walk(skipColumns, func); >>>>>>> ((ISqlExpressionWalkable)Select) .Walk(skipColumns, func); ((ISqlExpressionWalkable)From) .Walk(skipColumns, func); ((ISqlExpressionWalkable)Where) .Walk(skipColumns, func); ((ISqlExpressionWalkable)GroupBy).Walk(skipColumns, func); ((ISqlExpressionWalkable)Having) .Walk(skipColumns, func); ((ISqlExpressionWalkable)OrderBy).Walk(skipColumns, func);
<<<<<<< if (value != null) value = value.ToString(); dataType = dataType.WithDataType(DataType.Char); ======= value = value?.ToString(); dataType = DataType.Char; >>>>>>> value = value?.ToString(); dataType = dataType.WithDataType(DataType.Char);
<<<<<<< SqlProviderFlags.IsUpdateFromSupported = true; ======= SqlProviderFlags.IsCountDistinctSupported = true; >>>>>>> SqlProviderFlags.IsCountDistinctSupported = true; SqlProviderFlags.IsUpdateFromSupported = true;
<<<<<<< using System.Reflection; ======= using Microsoft.VisualStudio.ProjectSystem.Logging; >>>>>>> <<<<<<< private bool _triedToRetrieveAddAnalyzerConfigFileMethod = false; private bool _triedToRetrieveRemoveAnalyzerConfigFileMethod = false; private MethodInfo? _addAnalyzerConfigFileMethod; private MethodInfo? _removeAnalyzerConfigFileMethod; ======= >>>>>>>
<<<<<<< foreach (var accessor in _parameters) if (accessor.Key.EqualsTo(expr, new Dictionary<Expression, QueryableAccessor>(), compareConstantValues: true)) p = accessor.Value; ======= if (!DataContext.SqlProviderFlags.IsParameterOrderDependent) foreach (var accessor in _parameters) if (accessor.Key.EqualsTo(expr, new Dictionary<Expression, QueryableAccessor>(), null, compareConstantValues: true)) p = accessor.Value; >>>>>>> foreach (var accessor in _parameters) if (accessor.Key.EqualsTo(expr, new Dictionary<Expression, QueryableAccessor>(), null, compareConstantValues: true)) p = accessor.Value;
<<<<<<< using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using LinqToDB.Data; using NUnit.Framework; using Tests.Model; using Tests.OrmBattle.Helper; ======= using System; using System.Collections.Generic; using System.Linq; using LinqToDB.Data; using NUnit.Framework; using Tests.Model; using Tests.OrmBattle.Helper; >>>>>>> using System; using System.Collections.Generic; using System.Linq; using LinqToDB.Data; using NUnit.Framework; using Tests.Model; using Tests.OrmBattle.Helper; <<<<<<< List<Northwind.Category> Categories; List<Northwind.Supplier> Suppliers; List<Northwind.Product> DiscontinuedProducts; List<Northwind.OrderDetail> OrderDetails; #pragma warning restore 0169 ======= // List<Northwind.Category> Categories; // List<Northwind.Supplier> Suppliers; // List<Northwind.Product> DiscontinuedProducts; // List<Northwind.OrderDetail> OrderDetails; >>>>>>> // List<Northwind.Category> Categories; // List<Northwind.Supplier> Suppliers; // List<Northwind.Product> DiscontinuedProducts; // List<Northwind.OrderDetail> OrderDetails; #pragma warning restore 0169
<<<<<<< static readonly ConcurrentDictionary<object,Query<object>> _queryCache = new ConcurrentDictionary<object,Query<object>>(); static Query<object> CreateQuery(IDataContext dataContext, string tableName, string serverName, string databaseName, string schemaName, Type type) ======= static Query<object> CreateQuery(IDataContext dataContext, EntityDescriptor descriptor, T obj, string tableName, string databaseName, string schemaName, Type type) >>>>>>> static Query<object> CreateQuery(IDataContext dataContext, EntityDescriptor descriptor, T obj, string tableName, string serverName, string databaseName, string schemaName, Type type) <<<<<<< var type = GetType<T>(obj, dataContext); var key = new { dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }; var ei = _queryCache.GetOrAdd(key, o => CreateQuery(dataContext, tableName, serverName, databaseName, schemaName, type)); ======= var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Common.Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Insert) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = "II", dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type); }); >>>>>>> var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Common.Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Insert) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = "II", dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type); }); <<<<<<< var type = GetType<T>(obj, dataContext); var key = new { dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }; var ei = _queryCache.GetOrAdd(key, o => CreateQuery(dataContext, tableName, serverName, databaseName, schemaName, type)); ======= var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Common.Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Insert) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = "II", dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type); }); >>>>>>> var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Common.Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Insert) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = "II", dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type); });
<<<<<<< [Test] public void SubQueryCount([IncludeDataSources( ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2014, ProviderName.SapHana)] string context) ======= [ActiveIssue("not supported?", Configuration = ProviderName.SapHana)] [Test, IncludeDataContextSource(ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2014, ProviderName.SapHana)] public void SubQueryCount(string context) >>>>>>> [ActiveIssue("not supported?", Configuration = ProviderName.SapHana)] [Test] public void SubQueryCount([IncludeDataSources( ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2014, ProviderName.SapHana)] string context)
<<<<<<< private readonly IProjectAsynchronousTasksService _tasksService; ======= private readonly IProjectItemSchemaService _projectItemSchemaService; >>>>>>> private readonly IProjectAsynchronousTasksService _tasksService; private readonly IProjectItemSchemaService _projectItemSchemaService; <<<<<<< Lazy<IFileTimestampCache> fileTimestampCache, IProjectAsynchronousTasksService tasksService) ======= Lazy<IFileTimestampCache> fileTimestampCache, IProjectItemSchemaService projectItemSchemaService) >>>>>>> Lazy<IFileTimestampCache> fileTimestampCache, IProjectAsynchronousTasksService tasksService, IProjectItemSchemaService projectItemSchemaService) <<<<<<< _tasksService = tasksService; ======= _projectItemSchemaService = projectItemSchemaService; >>>>>>> _tasksService = tasksService; _projectItemSchemaService = projectItemSchemaService;
<<<<<<< aggregate.enableMSAA = srcFrameSettings.enableMSAA && renderPipelineSettings.supportMSAAAntiAliasing; if (QualitySettings.antiAliasing < 1) aggregate.enableMSAA = false; ======= aggregate.enableMSAA = srcFrameSettings.enableMSAA && ((int)renderPipelineSettings.msaaSampleCount > 1); aggregate.msaaSampleCount = aggregate.enableMSAA ? renderPipelineSettings.msaaSampleCount : MSAASamples.None; >>>>>>> aggregate.enableMSAA = srcFrameSettings.enableMSAA && renderPipelineSettings.supportMSAAAntiAliasing;
<<<<<<< [Test, DataContextSource(ParallelScope = ParallelScope.None)] public void SelectNullPropagationWhereTest(string context) { using (var db = GetDataContext(context)) { var query1 = from p in db.Parent from c in db.Child.InnerJoin(c => c.ParentID == p.ParentID) select new { Info1 = p != null ? new { p.ParentID, p.Value1 } : null, Info2 = c != null ? (c.Parent != null ? new { c.Parent.Value1 } : null) : null }; var query2 = from q in query1 select new { InfoAll = q == null ? null : new { ParentID = q.Info1 != null ? (int?)q.Info1.ParentID : (int?)null, q.Info1.Value1, Value2 = q.Info2.Value1 } }; var query3 = query2.Where(p => p.InfoAll.ParentID.Value > 0 || p.InfoAll.Value1 > 0 || p.InfoAll.Value2 > 0 ); var result = query3.ToArray(); } } [Test, DataContextSource] public void SelectNullPropagationTest2(string context) { using (var db = GetDataContext(context)) { AreEqual( from p in Parent join c in Child on p.Value1 equals c.ParentID into gr from c in gr.DefaultIfEmpty() select new { Info2 = c != null ? (c.Parent != null ? new { c.Parent.Value1 } : null) : null } , from p in db.Parent join c in db.Child on p.Value1 equals c.ParentID into gr from c in gr.DefaultIfEmpty() select new { Info2 = c != null ? (c.Parent != null ? new { c.Parent.Value1 } : null) : null }); } } ======= [Test, DataContextSource(ParallelScope = ParallelScope.None)] public void SelectNullProjectionTests(string context) { using (var db = GetDataContext(context)) { var actual = from p in db.Parent select new { V1 = p.Value1.HasValue ? p.Value1 : null, }; var expected = from p in Parent select new { V1 = p.Value1.HasValue ? p.Value1 : null, }; AreEqual(expected, actual); } } >>>>>>> [Test, DataContextSource(ParallelScope = ParallelScope.None)] public void SelectNullPropagationWhereTest(string context) { using (var db = GetDataContext(context)) { var query1 = from p in db.Parent from c in db.Child.InnerJoin(c => c.ParentID == p.ParentID) select new { Info1 = p != null ? new { p.ParentID, p.Value1 } : null, Info2 = c != null ? (c.Parent != null ? new { c.Parent.Value1 } : null) : null }; var query2 = from q in query1 select new { InfoAll = q == null ? null : new { ParentID = q.Info1 != null ? (int?)q.Info1.ParentID : (int?)null, q.Info1.Value1, Value2 = q.Info2.Value1 } }; var query3 = query2.Where(p => p.InfoAll.ParentID.Value > 0 || p.InfoAll.Value1 > 0 || p.InfoAll.Value2 > 0 ); var result = query3.ToArray(); } } [Test, DataContextSource] public void SelectNullPropagationTest2(string context) { using (var db = GetDataContext(context)) { AreEqual( from p in Parent join c in Child on p.Value1 equals c.ParentID into gr from c in gr.DefaultIfEmpty() select new { Info2 = c != null ? (c.Parent != null ? new { c.Parent.Value1 } : null) : null } , from p in db.Parent join c in db.Child on p.Value1 equals c.ParentID into gr from c in gr.DefaultIfEmpty() select new { Info2 = c != null ? (c.Parent != null ? new { c.Parent.Value1 } : null) : null }); } } [Test, DataContextSource(ParallelScope = ParallelScope.None)] public void SelectNullProjectionTests(string context) { using (var db = GetDataContext(context)) { var actual = from p in db.Parent select new { V1 = p.Value1.HasValue ? p.Value1 : null, }; var expected = from p in Parent select new { V1 = p.Value1.HasValue ? p.Value1 : null, }; AreEqual(expected, actual); } }
<<<<<<< [AppliesTo(ProjectCapability.DotNet)] internal class BuildMacroInfo : IVsBuildMacroInfo ======= [AppliesTo(ProjectCapability.CSharpOrVisualBasicOrFSharp)] internal class BuildMacroInfo : IVsBuildMacroInfo, IDisposable >>>>>>> [AppliesTo(ProjectCapability.DotNet)] internal class BuildMacroInfo : IVsBuildMacroInfo, IDisposable
<<<<<<< var converted = attr.GetExpression(MappingSchema, context.SelectQuery, ma, e => ConvertToExtensionSql(context, e)); ======= var converted = attr.GetExpression(DataContext, context.SelectQuery, ma, e => ConvertToSql(context, e)); >>>>>>> var converted = attr.GetExpression(DataContext, context.SelectQuery, ma, e => ConvertToExtensionSql(context, e)); <<<<<<< var sqlExpression = attr.GetExpression(MappingSchema, context.SelectQuery, e, _ => ConvertToExtensionSql(context, _)); ======= var sqlExpression = attr.GetExpression(DataContext, context.SelectQuery, e, _ => ConvertToSql(context, _)); >>>>>>> var sqlExpression = attr.GetExpression(DataContext, context.SelectQuery, e, _ => ConvertToExtensionSql(context, _));
<<<<<<< private static readonly ImmutableArray<(HandlerFactory factory, string evaluationRuleName)> HandlerFactories = CreateHandlerFactories(); private static readonly ImmutableArray<string> AllEvaluationRuleNames = GetEvaluationRuleNames(); ======= private static readonly ImmutableArray<(HandlerFactory Factory, string EvaluationRuleName)> s_handlerFactories = CreateHandlerFactories(); private static readonly ImmutableArray<string> s_allEvaluationRuleNames = GetEvaluationRuleNames(); >>>>>>> private static readonly ImmutableArray<(HandlerFactory factory, string evaluationRuleName)> s_handlerFactories = CreateHandlerFactories(); private static readonly ImmutableArray<string> s_allEvaluationRuleNames = GetEvaluationRuleNames(); <<<<<<< var evaluationHandlers = ImmutableArray.CreateBuilder<(IEvaluationHandler handler, string evaluationRuleName)>(HandlerFactories.Length); var commandLineHandlers = ImmutableArray.CreateBuilder<ICommandLineHandler>(HandlerFactories.Length); ======= var evaluationHandlers = ImmutableArray.CreateBuilder<(IEvaluationHandler Value, string EvaluationRuleName)>(s_handlerFactories.Length); var commandLineHandlers = ImmutableArray.CreateBuilder<ICommandLineHandler>(s_handlerFactories.Length); >>>>>>> var evaluationHandlers = ImmutableArray.CreateBuilder<(IEvaluationHandler handler, string evaluationRuleName)>(s_handlerFactories.Length); var commandLineHandlers = ImmutableArray.CreateBuilder<ICommandLineHandler>(s_handlerFactories.Length); <<<<<<< return HandlerFactories.Select(e => e.evaluationRuleName) ======= return s_handlerFactories.Select(e => e.EvaluationRuleName) >>>>>>> return s_handlerFactories.Select(e => e.evaluationRuleName)
<<<<<<< public static void Query(IDataContext dataContext, string tableName, string serverName, string databaseName, string schemaName) ======= public static void Query(IDataContext dataContext, string tableName, string databaseName, string schemaName, bool ifExists) >>>>>>> public static void Query(IDataContext dataContext, string tableName, string serverName, string databaseName, string schemaName, bool ifExists) <<<<<<< public static async Task QueryAsync(IDataContext dataContext, string tableName, string serverName, string databaseName, string schemaName, CancellationToken token) ======= public static async Task QueryAsync( IDataContext dataContext, string tableName, string databaseName, string schemaName, bool ifExists, CancellationToken token) >>>>>>> public static async Task QueryAsync( IDataContext dataContext, string tableName, string serverName, string databaseName, string schemaName, bool ifExists, CancellationToken token)
<<<<<<< [Test] public void SqlPropertyGroupByAssociated([DataSources] string context) ======= [ActiveIssue(Configuration = ProviderName.SapHana)] [Test, DataContextSource] public void SqlPropertyGroupByAssociated(string context) >>>>>>> [ActiveIssue(Configuration = ProviderName.SapHana)] [Test] public void SqlPropertyGroupByAssociated([DataSources] string context)
<<<<<<< TestExternals.Log($"CurrentDirectory : {Environment.CurrentDirectory}"); var dataProvidersJsonFile = GetFilePath(assemblyPath, @"DataProviders.json"); var userDataProvidersJsonFile = GetFilePath(assemblyPath, @"UserDataProviders.json"); ======= var dataProvidersJsonFile = GetFilePath(assemblyPath, @"DataProviders.json")!; var userDataProvidersJsonFile = GetFilePath(assemblyPath, @"UserDataProviders.json")!; >>>>>>> TestExternals.Log($"CurrentDirectory : {Environment.CurrentDirectory}"); var dataProvidersJsonFile = GetFilePath(assemblyPath, @"DataProviders.json")!; var userDataProvidersJsonFile = GetFilePath(assemblyPath, @"UserDataProviders.json")!; <<<<<<< CopyDatabases(); ======= Directory.CreateDirectory(dataPath); foreach (var file in Directory.GetFiles(databasePath, "*.*")) { var destination = Path.Combine(dataPath, Path.GetFileName(file)); TestContext.WriteLine("{0} => {1}", file, destination); File.Copy(file, destination, true); } >>>>>>> CopyDatabases(); <<<<<<< Console.WriteLine("Connection strings:"); TestExternals.Log("Connection strings:"); ======= TestContext.WriteLine("Connection strings:"); >>>>>>> TestContext.WriteLine("Connection strings:"); TestExternals.Log("Connection strings:"); <<<<<<< var str = $"\tName=\"{provider.Key}\", Provider=\"{provider.Value.Provider}\", ConnectionString=\"{provider.Value.ConnectionString}\""; Console.WriteLine(str); TestExternals.Log(str); ======= TestContext.WriteLine($"\tName=\"{provider.Key}\", Provider=\"{provider.Value.Provider}\", ConnectionString=\"{provider.Value.ConnectionString}\""); >>>>>>> var str = $"\tName=\"{provider.Key}\", Provider=\"{provider.Value.Provider}\", ConnectionString=\"{provider.Value.ConnectionString}\""; TestContext.WriteLine(str); TestExternals.Log(str); <<<<<<< Console.WriteLine("Providers:"); TestExternals.Log("Providers:"); ======= TestContext.WriteLine("Providers:"); >>>>>>> TestContext.WriteLine("Providers:"); TestExternals.Log("Providers:"); <<<<<<< { Console.WriteLine($"\t{userProvider}"); TestExternals.Log($"\t{userProvider}"); } ======= TestContext.WriteLine($"\t{userProvider}"); >>>>>>> { TestContext.WriteLine($"\t{userProvider}"); TestExternals.Log($"\t{userProvider}"); } <<<<<<< public static class TestExternals { public static string? LogFilePath; public static bool IsParallelRun; public static int RunID; public static string? Configuration; static StreamWriter? _logWriter; public static void Log(string text) { if (LogFilePath != null) { if (_logWriter == null) _logWriter = File.CreateText(LogFilePath); _logWriter.WriteLine(text); _logWriter.Flush(); } } } ======= public class CustomCommandProcessor : IDisposable { private readonly IDbCommandProcessor? _original = DbCommandProcessorExtensions.Instance; public CustomCommandProcessor(IDbCommandProcessor? processor) { DbCommandProcessorExtensions.Instance = processor; } public void Dispose() { DbCommandProcessorExtensions.Instance = _original; } } public class OptimizeForSequentialAccess : IDisposable { private readonly bool _original = Configuration.OptimizeForSequentialAccess; public OptimizeForSequentialAccess(bool enable) { Configuration.OptimizeForSequentialAccess = enable; } public void Dispose() { Configuration.OptimizeForSequentialAccess = _original; } } >>>>>>> public static class TestExternals { public static string? LogFilePath; public static bool IsParallelRun; public static int RunID; public static string? Configuration; static StreamWriter? _logWriter; public static void Log(string text) { if (LogFilePath != null) { if (_logWriter == null) _logWriter = File.CreateText(LogFilePath); _logWriter.WriteLine(text); _logWriter.Flush(); } } } public class CustomCommandProcessor : IDisposable { private readonly IDbCommandProcessor? _original = DbCommandProcessorExtensions.Instance; public CustomCommandProcessor(IDbCommandProcessor? processor) { DbCommandProcessorExtensions.Instance = processor; } public void Dispose() { DbCommandProcessorExtensions.Instance = _original; } } public class OptimizeForSequentialAccess : IDisposable { private readonly bool _original = Configuration.OptimizeForSequentialAccess; public OptimizeForSequentialAccess(bool enable) { Configuration.OptimizeForSequentialAccess = enable; } public void Dispose() { Configuration.OptimizeForSequentialAccess = _original; } }
<<<<<<< ======= Requires.NotNull(commonServices, nameof(commonServices)); Requires.NotNull(tasksService, nameof(tasksService)); Requires.NotNull(taskScheduler, nameof(taskScheduler)); Requires.NotNull(activeConfiguredProjectsProvider, nameof(activeConfiguredProjectsProvider)); Requires.NotNull(targetFrameworkProvider, nameof(targetFrameworkProvider)); >>>>>>> <<<<<<< return await _taskScheduler.RunAsync(TaskSchedulerPriority.UIThreadBackgroundPriority, async () => { ProjectData projectData = GetProjectData(); // Get the set of active configured projects ignoring target framework. ======= // Get the set of active configured projects ignoring target framework. >>>>>>> // Get the set of active configured projects ignoring target framework. <<<<<<< ImmutableDictionary<string, ConfiguredProject> configuredProjectsMap = await _activeConfiguredProjectsProvider.GetActiveConfiguredProjectsMapAsync().ConfigureAwait(true); ======= var configuredProjectsMap = await _activeConfiguredProjectsProvider.GetActiveConfiguredProjectsMapAsync().ConfigureAwait(true); >>>>>>> ImmutableDictionary<string, ConfiguredProject> configuredProjectsMap = await _activeConfiguredProjectsProvider.GetActiveConfiguredProjectsMapAsync().ConfigureAwait(true); <<<<<<< bool isCrossTargeting = !(configuredProjectsMap.Count == 1 && string.IsNullOrEmpty(configuredProjectsMap.First().Key)); return new AggregateCrossTargetProjectContext(isCrossTargeting, innerProjectContextsBuilder.ToImmutable(), configuredProjectsMap, activeTargetFramework, _targetFrameworkProvider); }); ======= innerProjectContextsBuilder.Add(targetFramework, targetedProjectContext); if (activeTargetFramework.Equals(TargetFramework.Empty) && configuredProject.ProjectConfiguration.Equals(activeProjectConfiguration)) { activeTargetFramework = targetFramework; } } var isCrossTargeting = !(configuredProjectsMap.Count == 1 && string.IsNullOrEmpty(configuredProjectsMap.First().Key)); return new AggregateCrossTargetProjectContext(isCrossTargeting, innerProjectContextsBuilder.ToImmutable(), configuredProjectsMap, activeTargetFramework, _targetFrameworkProvider); >>>>>>> innerProjectContextsBuilder.Add(targetFramework, targetedProjectContext); if (activeTargetFramework.Equals(TargetFramework.Empty) && configuredProject.ProjectConfiguration.Equals(activeProjectConfiguration)) { activeTargetFramework = targetFramework; } } bool isCrossTargeting = !(configuredProjectsMap.Count == 1 && string.IsNullOrEmpty(configuredProjectsMap.First().Key)); return new AggregateCrossTargetProjectContext(isCrossTargeting, innerProjectContextsBuilder.ToImmutable(), configuredProjectsMap, activeTargetFramework, _targetFrameworkProvider);
<<<<<<< var data = LinqServiceSerializer.Serialize(SerializationMappingSchema, _queryBatch.ToArray()); await client.ExecuteBatchAsync(Configuration, data); ======= var data = LinqServiceSerializer.Serialize(_queryBatch.ToArray()); await client.ExecuteBatchAsync(Configuration, data).ConfigureAwait(Common.Configuration.ContinueOnCapturedContext); >>>>>>> var data = LinqServiceSerializer.Serialize(SerializationMappingSchema, _queryBatch.ToArray()); await client.ExecuteBatchAsync(Configuration, data).ConfigureAwait(Common.Configuration.ContinueOnCapturedContext);
<<<<<<< static readonly ConcurrentDictionary<object,Query<int>> _queryCache = new ConcurrentDictionary<object,Query<int>>(); static Query<int> CreateQuery(IDataContext dataContext, string tableName, string serverName, string databaseName, string schemaName, Type type) ======= static Query<int> CreateQuery(IDataContext dataContext, EntityDescriptor descriptor, T obj, string tableName, string databaseName, string schemaName, Type type) >>>>>>> static Query<int> CreateQuery(IDataContext dataContext, EntityDescriptor descriptor, T obj, string tableName, string serverName, string databaseName, string schemaName, Type type) <<<<<<< var type = GetType<T>(obj, dataContext); var key = new { dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }; var ei = _queryCache.GetOrAdd(key, o => CreateQuery(dataContext, tableName, serverName, databaseName, schemaName, type)); ======= var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Update) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = 'U', dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type); }); >>>>>>> var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Update) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = 'U', dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type); }); <<<<<<< var type = GetType<T>(obj, dataContext); var key = new { dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }; var ei = _queryCache.GetOrAdd(key, o => CreateQuery(dataContext, tableName, serverName, databaseName, schemaName, type)); ======= var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Update) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = 'U', dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, databaseName, schemaName, type); }); >>>>>>> var type = GetType<T>(obj, dataContext); var entityDescriptor = dataContext.MappingSchema.GetEntityDescriptor(type); var ei = Configuration.Linq.DisableQueryCache || entityDescriptor.SkipModificationFlags.HasFlag(SkipModification.Update) ? CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type) : Cache<T>.QueryCache.GetOrCreate( new { Operation = 'U', dataContext.MappingSchema.ConfigurationID, dataContext.ContextID, tableName, schemaName, databaseName, serverName, type }, o => { o.SlidingExpiration = Common.Configuration.Linq.CacheSlidingExpiration; return CreateQuery(dataContext, entityDescriptor, obj, tableName, serverName, databaseName, schemaName, type); });
<<<<<<< [TestMethod] public async Task RoomTest() { var client = new SocketIO("http://localhost:3000"); await client.ConnectAsync(); string room = Guid.NewGuid().ToString(); string roomMsg = string.Empty; client.On(room, res => { roomMsg = res.Text; }); await client.EmitAsync("create room", room); await Task.Delay(1000); Assert.AreEqual("\"I joined the room: " + room + "\"", roomMsg); } [TestMethod] public async Task RoomMessageTest() { string room = "ROOM"; string client1Msg = string.Empty; string client2Msg = string.Empty; var client1 = new SocketIO("http://localhost:3000"); client1.On(room, res => client1Msg = res.Text); await client1.ConnectAsync(); await client1.EmitAsync("create room", room); var client2 = new SocketIO("http://localhost:3000"); client2.On(room, res => client2Msg = res.Text); await client2.ConnectAsync(); await client2.EmitAsync("create room", room); //需要添加 EmitAsync("event",roomName,data); await Task.Delay(1000); Assert.AreEqual(client1Msg, client2Msg); } ======= [TestMethod] public async Task EventNameTest() { string text = string.Empty; var client = new SocketIO("http://localhost:3000/path"); client.On("ws_message -new", res => { text = res.Text; }); await client.ConnectAsync(); await client.EmitAsync("ws_message -new", "ws_message-new"); await Task.Delay(1000); Assert.AreEqual(text, "\"message from server\""); } //[TestMethod] //public async Task ReConnectTest() //{ // string text = string.Empty; // var client = new SocketIO("http://localhost:3000"); // await client.ConnectAsync(); // await client.CloseAsync() // await client.EmitAsync("ws_message -new", "ws_message-new"); // await Task.Delay(1000); // Assert.AreEqual(text, "\"message from server\""); //} >>>>>>> [TestMethod] public async Task RoomTest() { var client = new SocketIO("http://localhost:3000"); await client.ConnectAsync(); string room = Guid.NewGuid().ToString(); string roomMsg = string.Empty; client.On(room, res => { roomMsg = res.Text; }); await client.EmitAsync("create room", room); await Task.Delay(1000); Assert.AreEqual("\"I joined the room: " + room + "\"", roomMsg); } [TestMethod] public async Task RoomMessageTest() { string room = "ROOM"; string client1Msg = string.Empty; string client2Msg = string.Empty; var client1 = new SocketIO("http://localhost:3000"); client1.On(room, res => client1Msg = res.Text); await client1.ConnectAsync(); await client1.EmitAsync("create room", room); var client2 = new SocketIO("http://localhost:3000"); client2.On(room, res => client2Msg = res.Text); await client2.ConnectAsync(); await client2.EmitAsync("create room", room); //需要添加 EmitAsync("event",roomName,data); await Task.Delay(1000); Assert.AreEqual(client1Msg, client2Msg); } [TestMethod] public async Task EventNameTest() { string text = string.Empty; var client = new SocketIO("http://localhost:3000/path"); client.On("ws_message -new", res => { text = res.Text; }); await client.ConnectAsync(); await client.EmitAsync("ws_message -new", "ws_message-new"); await Task.Delay(1000); Assert.AreEqual(text, "\"message from server\""); } //[TestMethod] //public async Task ReConnectTest() //{ // string text = string.Empty; // var client = new SocketIO("http://localhost:3000"); // await client.ConnectAsync(); // await client.CloseAsync() // await client.EmitAsync("ws_message -new", "ws_message-new"); // await Task.Delay(1000); // Assert.AreEqual(text, "\"message from server\""); //}
<<<<<<< using System.Web.Mvc; using AttributeRouting.Web; using AttributeRouting.Web.Mvc; namespace AttributeRouting.Specs.Subjects { [RouteArea("Users", Subdomain = "users")] public class SubdomainController : Controller { [GET("")] public ActionResult Index() { return Content(""); } } [RouteArea("Admin", Subdomain = "private", AreaUrl = "admin")] public class SubdomainWithAreaUrlController : Controller { [GET("")] public ActionResult Index() { return Content(""); } } } ======= using System.Web.Mvc; namespace AttributeRouting.Specs.Subjects { [RouteArea("Users", Subdomain = "users")] public class SubdomainController : Controller { [GET("")] public ActionResult Index() { return Content(""); } } [RouteArea("NoSubdomain")] public class SubdomainControllerWithoutSubdomainInAttribute : Controller { [GET("")] public ActionResult Index() { return Content(""); } } [RouteArea("Admin", Subdomain = "private", AreaUrl = "admin")] public class SubdomainWithAreaUrlController : Controller { [GET("")] public ActionResult Index() { return Content(""); } } } >>>>>>> using System.Web.Mvc; using AttributeRouting.Web; using AttributeRouting.Web.Mvc; namespace AttributeRouting.Specs.Subjects { [RouteArea("Users", Subdomain = "users")] public class SubdomainController : Controller { [GET("")] public ActionResult Index() { return Content(""); } } [RouteArea("NoSubdomain")] public class SubdomainControllerWithoutSubdomainInAttribute : Controller { [GET("")] public ActionResult Index() { return Content(""); } } [RouteArea("Admin", Subdomain = "private", AreaUrl = "admin")] public class SubdomainWithAreaUrlController : Controller { [GET("")] public ActionResult Index() { return Content(""); } } }
<<<<<<< req.Add(new MaybeFreeExpression(e, isFree)); } else if (la.kind == 69) { ======= req.Add(new MaybeFreeExpression(e, isFree, reqAttrs)); } else if (la.kind == 68) { >>>>>>> req.Add(new MaybeFreeExpression(e, isFree, reqAttrs)); } else if (la.kind == 69) { <<<<<<< Expression/*!*/ e; FrameExpression/*!*/ fe; while (!(StartOf(20))) {SynErr(203); Get();} if (la.kind == 68) { ======= Expression/*!*/ e; FrameExpression/*!*/ fe; Attributes ensAttrs = null; Attributes reqAttrs = null; while (!(StartOf(20))) {SynErr(202); Get();} if (la.kind == 67) { >>>>>>> Expression/*!*/ e; FrameExpression/*!*/ fe; Attributes ensAttrs = null; Attributes reqAttrs = null; while (!(StartOf(20))) {SynErr(203); Get();} if (la.kind == 68) { <<<<<<< reqs.Add(e); } else if (la.kind == 67) { ======= reqs.Add(new MaybeFreeExpression(e, false, reqAttrs)); } else if (la.kind == 66) { >>>>>>> reqs.Add(new MaybeFreeExpression(e, false, reqAttrs)); } else if (la.kind == 67) { <<<<<<< ens.Add(e); } else if (la.kind == 42) { ======= ens.Add(new MaybeFreeExpression(e, false, ensAttrs)); } else if (la.kind == 41) { >>>>>>> ens.Add(new MaybeFreeExpression(e, false, ensAttrs)); } else if (la.kind == 42) {
<<<<<<< MapEmpty, ======= MapCard, >>>>>>> MapEmpty, MapCard, <<<<<<< case BuiltinFunction.MapEmpty: { Contract.Assert(args.Length == 0); Contract.Assert(typeInstantiation != null); Bpl.Type resultType = predef.MapType(tok, typeInstantiation, typeInstantiation); // use 'typeInstantiation' (which is really always just BoxType anyway) as both type arguments return Bpl.Expr.CoerceType(tok, FunctionCall(tok, "Map#Empty", resultType, args), resultType); } ======= case BuiltinFunction.MapCard: Contract.Assert(args.Length == 1); Contract.Assert(typeInstantiation == null); return FunctionCall(tok, "Map#Card", Bpl.Type.Int, args); >>>>>>> case BuiltinFunction.MapEmpty: { Contract.Assert(args.Length == 0); Contract.Assert(typeInstantiation != null); Bpl.Type resultType = predef.MapType(tok, typeInstantiation, typeInstantiation); // use 'typeInstantiation' (which is really always just BoxType anyway) as both type arguments return Bpl.Expr.CoerceType(tok, FunctionCall(tok, "Map#Empty", resultType, args), resultType); } case BuiltinFunction.MapCard: Contract.Assert(args.Length == 1); Contract.Assert(typeInstantiation == null); return FunctionCall(tok, "Map#Card", Bpl.Type.Int, args);
<<<<<<< public List<ComprehensionExpr.BoundedPool> Constraint_Bounds; // initialized and filled in by resolver; null for Exact=true and for a ghost statement // invariant Constraint_Bounds == null || Constraint_Bounds.Count == BoundVars.Count; public List<IVariable> Constraint_MissingBounds; // filled in during resolution; remains "null" if Exact==true or if bounds can be found // invariant Constraint_Bounds == null || Constraint_MissingBounds == null; ======= public readonly Attributes Attributes; >>>>>>> public readonly Attributes Attributes; public List<ComprehensionExpr.BoundedPool> Constraint_Bounds; // initialized and filled in by resolver; null for Exact=true and for a ghost statement // invariant Constraint_Bounds == null || Constraint_Bounds.Count == BoundVars.Count; public List<IVariable> Constraint_MissingBounds; // filled in during resolution; remains "null" if Exact==true or if bounds can be found // invariant Constraint_Bounds == null || Constraint_MissingBounds == null;
<<<<<<< [Order(Order.Default)] internal partial class VSProject : VSLangProj.VSProject ======= [Order(10)] public partial class VSProject : VSLangProj.VSProject >>>>>>> [Order(Order.Default)] public partial class VSProject : VSLangProj.VSProject
<<<<<<< ======= public Action<AdditionalInformation> AdditionalInformationReporter; internal void ReportAdditionalInformation(IToken token, string text) { Contract.Requires(token != null); Contract.Requires(text != null); if (AdditionalInformationReporter != null) { AdditionalInformationReporter(new AdditionalInformation { Token = token, Text = text, Length = token.val.Length }); } } >>>>>>> <<<<<<< reporter.Info(MessageSource.Resolver, iter.tok, Printer.IteratorClassToString(iter)); ======= ReportAdditionalInformation(iter.tok, Printer.IteratorClassToString(iter)); >>>>>>> reporter.Info(MessageSource.Resolver, iter.tok, Printer.IteratorClassToString(iter)); <<<<<<< reporter.Info(MessageSource.Resolver, clbl.Tok, s); ======= ReportAdditionalInformation(clbl.Tok, s); >>>>>>> reporter.Info(MessageSource.Resolver, clbl.Tok, s); <<<<<<< reporter.Info(MessageSource.Resolver, dd.tok, "{:nativeType \"" + dd.NativeType.Name + "\"}"); ======= ReportAdditionalInformation(dd.tok, "{:nativeType \"" + dd.NativeType.Name + "\"}"); >>>>>>> reporter.Info(MessageSource.Resolver, dd.tok, "{:nativeType \"" + dd.NativeType.Name + "\"}"); <<<<<<< reporter.Info(MessageSource.Resolver, c.CandidateCall.tok, "co-recursive call"); ======= ReportAdditionalInformation(c.CandidateCall.tok, "co-recursive call"); >>>>>>> reporter.Info(MessageSource.Resolver, c.CandidateCall.tok, "co-recursive call"); <<<<<<< ======= protected void Error(IToken tok, string msg, params object[] args) { Contract.Requires(tok != null); Contract.Requires(msg != null); Contract.Requires(args != null); resolver.Error(tok, msg, args); } protected void Error(Expression expr, string msg, params object[] args) { Contract.Requires(expr != null); Contract.Requires(msg != null); Contract.Requires(args != null); Error(expr.tok, msg, args); } protected void ReportAdditionalInformation(IToken tok, string text) { Contract.Requires(tok != null); resolver.ReportAdditionalInformation(tok, text); } >>>>>>> <<<<<<< reporter.Info(MessageSource.Resolver, m.tok, "tail recursive"); ======= ReportAdditionalInformation(m.tok, "tail recursive"); >>>>>>> reporter.Info(MessageSource.Resolver, m.tok, "tail recursive"); <<<<<<< resolver.reporter.Info(MessageSource.Resolver, e.tok, e.Function.Name + "#[_k - 1]"); ======= ReportAdditionalInformation(e.tok, e.Function.Name + "#[_k - 1]"); >>>>>>> resolver.reporter.Info(MessageSource.Resolver, e.tok, e.Function.Name + "#[_k - 1]"); <<<<<<< resolver.reporter.Info(MessageSource.Resolver, s.Tok, "ensures " + Printer.ExprToString(p) + ";"); ======= resolver.ReportAdditionalInformation(s.Tok, "ensures " + Printer.ExprToString(p)); >>>>>>> resolver.reporter.Info(MessageSource.Resolver, s.Tok, "ensures " + Printer.ExprToString(p) + ";"); <<<<<<< string text = "havoc {"; if (fvs.Count != 0) { string sep = ""; foreach (var fv in fvs) { text += sep + fv.Name; sep = ", "; } } text += "};"; // always terminate with a semi-colon reporter.Info(MessageSource.Resolver, s.Tok, text); ======= string text = "havoc {" + Util.Comma(", ", fvs, fv => fv.Name) + "};"; // always terminate with a semi-colon ReportAdditionalInformation(s.Tok, text); >>>>>>> string text = "havoc {" + Util.Comma(", ", fvs, fv => fv.Name) + "};"; // always terminate with a semi-colon reporter.Info(MessageSource.Resolver, s.Tok, text); <<<<<<< reporter.Info(MessageSource.Resolver, s.Tok, "ensures " + Printer.ExprToString(result) + ";"); ======= ReportAdditionalInformation(s.Tok, "ensures " + Printer.ExprToString(result)); >>>>>>> reporter.Info(MessageSource.Resolver, s.Tok, "ensures " + Printer.ExprToString(result)); <<<<<<< string s = "decreases "; if (theDecreases.Count != 0) { string sep = ""; foreach (var d in theDecreases) { s += sep + Printer.ExprToString(d); sep = ", "; } } s += ";"; // always terminate with a semi-colon, even in the case of an empty decreases clause reporter.Info(MessageSource.Resolver, loopStmt.Tok, s); ======= string s = "decreases " + Util.Comma(", ", theDecreases, Printer.ExprToString); ReportAdditionalInformation(loopStmt.Tok, s); >>>>>>> string s = "decreases " + Util.Comma(", ", theDecreases, Printer.ExprToString); reporter.Info(MessageSource.Resolver, loopStmt.Tok, s);
<<<<<<< var translator = new Dafny.Translator(reporter) { InsertChecksums = true, UniqueIdPrefix = null }; //FIXME check if null is OK for UniqueIdPrefix ======= var translator = new Dafny.Translator() { InsertChecksums = true, UniqueIdPrefix = fname }; >>>>>>> var translator = new Dafny.Translator(reporter) { InsertChecksums = true, UniqueIdPrefix = fname };
<<<<<<< /// This is a general constructor, but takes the layerInterCluster as an int. /// </summary> ExpressionTranslator(Translator translator, PredefinedDecls predef, Bpl.Expr heap, string thisVar, Function applyLimited_CurrentFunction, int layerInterCluster, Bpl.Expr layerIntraCluster, string modifiesFrame, bool stripLits) { Contract.Requires(translator != null); Contract.Requires(predef != null); Contract.Requires(heap != null); Contract.Requires(thisVar != null); Contract.Requires(0 <= layerInterCluster); Contract.Requires(modifiesFrame != null); this.translator = translator; this.predef = predef; this.HeapExpr = heap; this.This = thisVar; this.applyLimited_CurrentFunction = applyLimited_CurrentFunction; this.layerInterCluster = LayerN(layerInterCluster); this.layerIntraCluster = layerIntraCluster; this.modifiesFrame = modifiesFrame; this.stripLits = stripLits; } /// <summary> ======= >>>>>>> <<<<<<< Function applyLimited_CurrentFunction, Bpl.Expr layerInterCluster, Bpl.Expr layerIntraCluster, string modifiesFrame, bool stripLits) { ======= Function applyLimited_CurrentFunction, FuelSetting layerInterCluster, FuelSetting layerIntraCluster, string modifiesFrame) { >>>>>>> Function applyLimited_CurrentFunction, FuelSetting layerInterCluster, FuelSetting layerIntraCluster, string modifiesFrame, bool stripLits) { <<<<<<< : this(translator, predef, heap, thisVar, null, 1, null, "$_Frame", false) { ======= : this(translator, predef, heap, thisVar, null, new FuelSetting(translator, 1), null, "$_Frame") { >>>>>>> : this(translator, predef, heap, thisVar, null, new FuelSetting(translator, 1), null, "$_Frame", false) { <<<<<<< return new ExpressionTranslator(translator, predef, HeapExpr, This, null, layerArgument, layerArgument, modifiesFrame, stripLits); } public ExpressionTranslator WithNoLits() { Contract.Ensures(Contract.Result<ExpressionTranslator>() != null); return new ExpressionTranslator(translator, predef, HeapExpr, This, null, layerInterCluster, layerIntraCluster, modifiesFrame, true); ======= return new ExpressionTranslator(translator, predef, HeapExpr, This, null, new FuelSetting(translator, 0, layerArgument), new FuelSetting(translator, 0, layerArgument), modifiesFrame); >>>>>>> return new ExpressionTranslator(translator, predef, HeapExpr, This, null, new FuelSetting(translator, 0, layerArgument), new FuelSetting(translator, 0, layerArgument), modifiesFrame, stripLits); } public ExpressionTranslator WithNoLits() { Contract.Ensures(Contract.Result<ExpressionTranslator>() != null); return new ExpressionTranslator(translator, predef, HeapExpr, This, null, layerInterCluster, layerIntraCluster, modifiesFrame, true); <<<<<<< return new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, /* layerArgument */ layerInterCluster, layerArgument, modifiesFrame, stripLits); ======= return new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, /* layerArgument */ layerInterCluster, new FuelSetting(translator, 0, layerArgument), modifiesFrame); >>>>>>> return new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, /* layerArgument */ layerInterCluster, new FuelSetting(translator, 0, layerArgument), modifiesFrame, stripLits); <<<<<<< var et = new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, translator.LayerSucc(layerInterCluster, offset), layerIntraCluster, modifiesFrame, stripLits); ======= var et = new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, layerInterCluster.Offset(offset), layerIntraCluster, modifiesFrame); >>>>>>> var et = new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, layerInterCluster.Offset(offset), layerIntraCluster, modifiesFrame, stripLits); <<<<<<< var etOld = new ExpressionTranslator(translator, predef, Old.HeapExpr, This, applyLimited_CurrentFunction, translator.LayerSucc(layerInterCluster, offset), layerIntraCluster, modifiesFrame, stripLits); ======= var etOld = new ExpressionTranslator(translator, predef, Old.HeapExpr, This, applyLimited_CurrentFunction, layerInterCluster.Offset(offset), layerIntraCluster, modifiesFrame); >>>>>>> var etOld = new ExpressionTranslator(translator, predef, Old.HeapExpr, This, applyLimited_CurrentFunction, layerInterCluster.Offset(offset), layerIntraCluster, modifiesFrame, stripLits); <<<<<<< Expr layer = translator.LayerSucc(ly); bodyEtran = new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, layer, layer, modifiesFrame, stripLits); ======= bodyEtran = new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, new FuelSetting(translator, 1, ly), new FuelSetting(translator, 1, ly), modifiesFrame); >>>>>>> bodyEtran = new ExpressionTranslator(translator, predef, HeapExpr, This, applyLimited_CurrentFunction, new FuelSetting(translator, 1, ly), new FuelSetting(translator, 1, ly), modifiesFrame, stripLits);
<<<<<<< List<IVariable> missingBounds; var vars = new List<IVariable>(e.BoundVars); var bestBounds = DiscoverBestBounds_MultipleVars(vars, constraint, true, false, out missingBounds); ======= var allBounds = DiscoverBoundsAux(e.tok, new List<IVariable>(e.BoundVars), constraint, true, true, true, missingBounds, reporter); >>>>>>> List<IVariable> missingBounds; var vars = new List<IVariable>(e.BoundVars); var bestBounds = DiscoverBestBounds_MultipleVars(vars, constraint, true, false, out missingBounds); <<<<<<< var bounds = DiscoverAllBounds_SingleVar(dd.Var, dd.Constraint); ======= var missingBounds = new List<BoundVar>(); var bounds = DiscoverBounds(dd.Constraint.tok, new List<BoundVar> { dd.Var }, dd.Constraint, true, true, missingBounds, reporter); >>>>>>> var bounds = DiscoverAllBounds_SingleVar(dd.Var, dd.Constraint); <<<<<<< bool bodyMustBeSpecOnly = specContextOnly || (prevErrorCount == ErrorCount && UsesSpecFeatures(s.Range)); if (!bodyMustBeSpecOnly && prevErrorCount == ErrorCount) { ======= bool bodyMustBeSpecOnly = specContextOnly || (prevErrorCount == reporter.Count(ErrorLevel.Error) && UsesSpecFeatures(s.Range)); if (!bodyMustBeSpecOnly && prevErrorCount == reporter.Count(ErrorLevel.Error)) { var missingBounds = new List<BoundVar>(); >>>>>>> bool bodyMustBeSpecOnly = specContextOnly || (prevErrorCount == reporter.Count(ErrorLevel.Error) && UsesSpecFeatures(s.Range)); if (!bodyMustBeSpecOnly && prevErrorCount == reporter.Count(ErrorLevel.Error)) { <<<<<<< List<BoundVar> missingBounds; s.Bounds = DiscoverBestBounds_MultipleVars(s.BoundVars, s.Range, true, true, out missingBounds); ======= s.Bounds = DiscoverBounds(s.Tok, s.BoundVars, s.Range, true, false, missingBounds, reporter); >>>>>>> List<BoundVar> missingBounds; s.Bounds = DiscoverBestBounds_MultipleVars(s.BoundVars, s.Range, true, true, out missingBounds); <<<<<<< List<IVariable> missingBounds; var bestBounds = DiscoverBestBounds_MultipleVars(varLhss, s.Expr, true, false, out missingBounds); ======= var allBounds = DiscoverBoundsAux(s.Tok, varLhss, s.Expr, true, true, true, missingBounds, reporter); >>>>>>> List<IVariable> missingBounds; var bestBounds = DiscoverBestBounds_MultipleVars(varLhss, s.Expr, true, false, out missingBounds); <<<<<<< Contract.Assert(bestBounds != null); s.Bounds = bestBounds; ======= Contract.Assert(allBounds != null); s.Bounds = new List<ComprehensionExpr.BoundedPool>(); foreach (var pair in allBounds) { Contract.Assert(1 <= pair.Item2.Count); s.Bounds.Add(ComprehensionExpr.BoundedPool.GetBest(pair.Item2)); } >>>>>>> Contract.Assert(bestBounds != null); s.Bounds = bestBounds; <<<<<<< var e = (QuantifierExpr)expr; int prevErrorCount = ErrorCount; ======= QuantifierExpr e = (QuantifierExpr)expr; Contract.Assert(e.SplitQuantifier == null); // No split quantifiers during resolution int prevErrorCount = reporter.Count(ErrorLevel.Error); >>>>>>> var e = (QuantifierExpr)expr; Contract.Assert(e.SplitQuantifier == null); // No split quantifiers during resolution int prevErrorCount = reporter.Count(ErrorLevel.Error); <<<<<<< if (prevErrorCount == ErrorCount) { ======= if (prevErrorCount == reporter.Count(ErrorLevel.Error)) { var missingBounds = new List<BoundVar>(); >>>>>>> if (prevErrorCount == reporter.Count(ErrorLevel.Error)) { <<<<<<< List<BoundVar> missingBounds; e.Bounds = DiscoverBestBounds_MultipleVars(e.BoundVars, e.LogicalBody(), e is ExistsExpr, true, out missingBounds); ======= e.Bounds = DiscoverBounds(e.tok, e.BoundVars, e.LogicalBody(), e is ExistsExpr, false, missingBounds, reporter); >>>>>>> List<BoundVar> missingBounds; e.Bounds = DiscoverBestBounds_MultipleVars(e.BoundVars, e.LogicalBody(), e is ExistsExpr, true, out missingBounds); <<<<<<< if (expr is QuantifierExpr && ((QuantifierExpr)expr).Bounds.Contains(null)) { ======= var q = expr as QuantifierExpr; Contract.Assert(q == null || q.SplitQuantifier == null); // No split quantifiers during resolution if (q != null && q.Bounds == null) { >>>>>>> var q = expr as QuantifierExpr; Contract.Assert(q == null || q.SplitQuantifier == null); // No split quantifiers during resolution if (q != null && q.Bounds.Contains(null)) {