diff --git a/.editorconfig b/.editorconfig index fa08a1f..f0ca40d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,13 @@ indent_size = 2 [*.json] indent_size = 2 +# npm package files +[package.json] +indent_style = space +indent_size = 2 +insert_final_newline = false +charset = utf-8 + # Powershell files [*.ps1] indent_size = 2 @@ -38,6 +45,13 @@ indent_size = 2 # Dotnet code style settings: [*.{cs,vb}] +dotnet_diagnostic.IDE0005.severity = suggestion +dotnet_diagnostic.IDE0007.severity = none +dotnet_diagnostic.IDE0008.severity = none +dotnet_diagnostic.IDE0011.severity = none + +file_header_template = This Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at https://mozilla.org/MPL/2.0/. + # Sort using and Import directives with System.* appearing first and seperate groups dotnet_sort_system_directives_first = true:error dotnet_separate_import_directive_groups = true:suggestion @@ -246,5 +260,5 @@ csharp_style_deconstructed_variable_declaration = true:suggestion csharp_style_pattern_local_over_anonymous_function = true:error csharp_using_directive_placement = outside_namespace:error csharp_prefer_static_local_function = true:error -csharp_prefer_simple_using_statement = true:error +csharp_prefer_simple_using_statement = true:suggestion csharp_style_prefer_switch_expression = true:suggestion diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1ff0c42..0000000 --- a/.gitattributes +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/.gitignore b/.gitignore index f357a43..7a47522 100644 --- a/.gitignore +++ b/.gitignore @@ -212,6 +212,7 @@ _pkginfo.txt ClientBin/ ~$* *~ +!*~/ *.dbmdl *.dbproj.schemaview *.jfm @@ -313,3 +314,6 @@ OpenCover/ # SpecFlow autogenerated feature code *.feature.cs + +# macOS +**/.DS_Store diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..99922ad --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +.github +.gitattributes +.gitmodules +.gitignore +.editorconfig +.DS_Store +MSBuild~ diff --git a/BUILDING.md b/BUILDING.md deleted file mode 100644 index 1634766..0000000 --- a/BUILDING.md +++ /dev/null @@ -1,28 +0,0 @@ -To build the DarkRift 2 solution *you must have Microsoft Visual Studio 2022* installed. The Community edition is fine for open source projects, and is easily attained from https://visualstudio.microsoft.com/vs/community/ - -## Configurations - -Currently, DarkRift can be built in the following configurations: -* Debug: Self evident. -* Free: The same as the old Free version. -* Pro: The same as the old Pro version. This is probably want you want for release builds. Going forward, it is also what will be supported in future DR2 versions. - -## Output Assemblies - -Builds emit to the ./Build subdirectory. A subfolder is created for each configuration, which in turn has a subfolder for each output platform (e.g. .NET 4.0). - -In each platform subfolder, there is: -* A Lib subfolder containing assembles, debug symbol .pdb files, etc. -* A Run command to launch the standalone DarkRift server. -* A default Server.config. -* DarkRift Server.zip containing the files in the platform folder. - -Additionally, there is a ./Build/DarkRift Source.zip containing a cleaned copy of the project, which corresponds to the old way the DR2 source code used to be distributed with the Pro version. It is recommended to simply refer users to this GitHub repo instead. - -If you're looking to manually copy assemblies into your Unity assets, you should look for .dll files from the ./Build/($configuration)/net4.0/Lib subfolder. Remember to paste assemblies into a Plugins folder or subfolder in order for Unity to recognize them. - -## Producing a .unitypackage - -If you're an existing DarkRift 2 user, there's a decent chance you will want to reproduce the Free or Pro .unitypackage DarkRift 2 used to ship with in order to stick with the way DR2 in your Assets folder is organized. Even as a new user, a .unitypackage can be a practical way install the typical DarkRift version into your Unity project if you don't intend to make changes. - -*TODO: Fix package building in post_release.sh and write guide for how to export packages* \ No newline at end of file diff --git a/DarkRift.Server/Properties/AssemblyInfo.cs b/DarkRift.Client/AssemblyInfo.cs similarity index 81% rename from DarkRift.Server/Properties/AssemblyInfo.cs rename to DarkRift.Client/AssemblyInfo.cs index 9d05642..665b73e 100644 --- a/DarkRift.Server/Properties/AssemblyInfo.cs +++ b/DarkRift.Client/AssemblyInfo.cs @@ -4,6 +4,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +using System.Reflection; using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("DarkRift.Server.Testing")] \ No newline at end of file +[assembly: DarkRift.Preserve] diff --git a/DarkRift.Testing/Properties/AssemblyInfo.cs b/DarkRift.Client/AssemblyInfo.gen.cs similarity index 53% rename from DarkRift.Testing/Properties/AssemblyInfo.cs rename to DarkRift.Client/AssemblyInfo.gen.cs index 4b4a452..47dbff7 100644 --- a/DarkRift.Testing/Properties/AssemblyInfo.cs +++ b/DarkRift.Client/AssemblyInfo.gen.cs @@ -4,3 +4,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +// +// Do not modify this file manually +// This file is is updated based on the version found on package.json +[assembly: System.Reflection.AssemblyVersion("2.10.1")] diff --git a/DarkRift.Client/DarkRift.Client.asmdef b/DarkRift.Client/DarkRift.Client.asmdef new file mode 100644 index 0000000..dc5591a --- /dev/null +++ b/DarkRift.Client/DarkRift.Client.asmdef @@ -0,0 +1,18 @@ +{ + "name": "DarkRift.Client", + "rootNamespace": "", + "references": [ + "GUID:74b22b8f1e899468c828514608b766c6" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "!DARKRIFT_NO_CLIENT" + ], + "versionDefines": [], + "noEngineReferences": true +} \ No newline at end of file diff --git a/DarkRift.Schemas/Cluster.config.xsd b/DarkRift.Schemas/Cluster.config.xsd deleted file mode 100644 index 84f2e21..0000000 --- a/DarkRift.Schemas/Cluster.config.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.Schemas/Server.config.xsd b/DarkRift.Schemas/Server.config.xsd deleted file mode 100644 index 04da7ec..0000000 --- a/DarkRift.Schemas/Server.config.xsd +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.Server.Console/App.config b/DarkRift.Server.Console/App.config deleted file mode 100644 index 2153663..0000000 --- a/DarkRift.Server.Console/App.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/DarkRift.Server.Console/DarkRift.Server.Console.csproj b/DarkRift.Server.Console/DarkRift.Server.Console.csproj deleted file mode 100644 index 8bf48e1..0000000 --- a/DarkRift.Server.Console/DarkRift.Server.Console.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - net4.0;netcoreapp2.0;netcoreapp3.1;net5.0;net6.0 - netcoreapp2.0;netcoreapp3.1;net5.0;net6.0 - Debug;Release - - - Exe - DarkRift.Server.Console.Program - true - - - false - - - - DEBUG;TRACE - - - - - - PreserveNewest - - - - - - - PreserveNewest - - - - - - - - - - - - diff --git a/DarkRift.Server.Console/Program.cs b/DarkRift.Server.Console/Program.cs deleted file mode 100644 index 2d69991..0000000 --- a/DarkRift.Server.Console/Program.cs +++ /dev/null @@ -1,161 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using DarkRift.Server; -using System.Threading; -using System.IO; -using System.Collections.Specialized; -using System.Collections; -using DarkRift.Server.Configuration; - -namespace DarkRift.Server.Console -{ - internal class Program - { - /// - /// The server instance. - /// - private static DarkRiftServer server; - - /// - /// Main entry point of the server which starts a single server. - /// - /// - private static void Main(string[] args) - { - string[] rawArguments = CommandEngine.ParseArguments(string.Join(" ", args)); - string[] arguments = CommandEngine.GetArguments(rawArguments); - NameValueCollection variables = CommandEngine.GetFlags(rawArguments); - - foreach (DictionaryEntry environmentVariable in Environment.GetEnvironmentVariables()) - variables.Add((string)environmentVariable.Key, (string)environmentVariable.Value); - - string serverConfigFile; - string clusterConfigFile; - if (arguments.Length < 1) - { - serverConfigFile = "Server.config"; - clusterConfigFile = "Cluster.config"; - } - else if (arguments.Length == 1) - { - serverConfigFile = arguments[0]; - clusterConfigFile = "Cluster.config"; - } - else if (arguments.Length == 2) - { - serverConfigFile = arguments[0]; - clusterConfigFile = arguments[1]; - } - else - { - System.Console.Error.WriteLine("Unexpected number of comand line arguments passed. Expected 0-2 but found " + arguments.Length + "."); - System.Console.WriteLine("Press any key to exit..."); - System.Console.ReadKey(); - return; - } - - DarkRiftServerConfigurationBuilder serverConfigurationBuilder; - - try - { - serverConfigurationBuilder = DarkRiftServerConfigurationBuilder.CreateFromXml(serverConfigFile, variables); - } - catch (IOException e) - { - System.Console.Error.WriteLine("Could not load the server config file needed to start (" + e.Message + "). Are you sure it's present and accessible?"); - System.Console.WriteLine("Press any key to exit..."); - System.Console.ReadKey(); - return; - } - catch (XmlConfigurationException e) - { - System.Console.Error.WriteLine($"Failed to load '{serverConfigFile}': {e.Message}"); - System.Console.Error.WriteLine(); - System.Console.Error.WriteLine(e.DocumentationLink != null ? $"See {e.DocumentationLink} for more information." : "No additional documentation available."); - System.Console.Error.WriteLine(); - System.Console.Error.WriteLine(e.LineInfo != null && e.LineInfo.HasLineInfo() ? $"Line {e.LineInfo.LineNumber} Col: {e.LineInfo.LinePosition}" : "(Unknown location)"); - System.Console.Error.WriteLine(); - System.Console.WriteLine("Press any key to exit..."); - System.Console.ReadKey(); - return; - } - - // Set this thread as the one executing dispatcher tasks - serverConfigurationBuilder.WithDispatcherExecutorThreadID(Thread.CurrentThread.ManagedThreadId); - - if (File.Exists(clusterConfigFile)) - { - DarkRiftClusterConfigurationBuilder clusterConfigurationBuilder; - try - { - clusterConfigurationBuilder = DarkRiftClusterConfigurationBuilder.CreateFromXml(clusterConfigFile, variables); - } - catch (IOException e) - { - System.Console.Error.WriteLine("Could not load the cluster config file needed to start (" + e.Message + "). Are you sure it's present and accessible?"); - System.Console.WriteLine("Press any key to exit..."); - System.Console.ReadKey(); - return; - } - catch (XmlConfigurationException e) - { - System.Console.Error.WriteLine($"Failed to load '{clusterConfigFile}': {e.Message}"); - System.Console.Error.WriteLine(); - System.Console.Error.WriteLine(e.DocumentationLink != null ? $"See {e.DocumentationLink} for more information." : "No additional documentation available."); - System.Console.Error.WriteLine(); - System.Console.Error.WriteLine(e.LineInfo != null && e.LineInfo.HasLineInfo() ? $"Line {e.LineInfo.LineNumber} Col: {e.LineInfo.LinePosition}" : "(Unknown location)"); - System.Console.Error.WriteLine(); - System.Console.WriteLine("Press any key to exit..."); - System.Console.ReadKey(); - return; - } - - server = new DarkRiftServer(serverConfigurationBuilder.ServerSpawnData, clusterConfigurationBuilder.ClusterSpawnData); - } - else - { - server = new DarkRiftServer(serverConfigurationBuilder.ServerSpawnData); - } - - - server.StartServer(); - - new Thread(new ThreadStart(ConsoleLoop)).Start(); - - while (!server.Disposed) - { - server.DispatcherWaitHandle.WaitOne(); - server.ExecuteDispatcherTasks(); - } - } - - /// - /// Invoked from another thread to repeatedly execute commands from the console. - /// - private static void ConsoleLoop() - { - while (!server.Disposed) - { - string input = System.Console.ReadLine(); - - if (input == null) - { - System.Console.WriteLine("Stopping input loop as we seem to be running without an input stream."); - return; - } - - server.ExecuteCommand(input); - } - } - } -} diff --git a/DarkRift.Server.Console/Run.ps1 b/DarkRift.Server.Console/Run.ps1 deleted file mode 100644 index 5afd8e3..0000000 --- a/DarkRift.Server.Console/Run.ps1 +++ /dev/null @@ -1 +0,0 @@ -dotnet Lib/DarkRift.Server.Console.dll \ No newline at end of file diff --git a/DarkRift.Server.Console/Server.config b/DarkRift.Server.Console/Server.config deleted file mode 100644 index f2bc3ab..0000000 --- a/DarkRift.Server.Console/Server.config +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.Server.Testing/DarkRift.Server.Testing.csproj b/DarkRift.Server.Testing/DarkRift.Server.Testing.csproj deleted file mode 100644 index 44dae0c..0000000 --- a/DarkRift.Server.Testing/DarkRift.Server.Testing.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - net4.5;net6.0 - net6.0 - Debug;Release - true - - NU1701 - - - - - - - - - - - TRACE;DEBUG - - - - - - - - diff --git a/DarkRift.Server.Testing/PluginTestUtilTest.cs b/DarkRift.Server.Testing/PluginTestUtilTest.cs deleted file mode 100644 index c1c523d..0000000 --- a/DarkRift.Server.Testing/PluginTestUtilTest.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Moq; - -namespace DarkRift.Server.Testing -{ - [TestClass] - public class PluginTestUtilTest - { - [TestMethod] - public void TestRunCommandOnWhenCommandExists() - { - // GIVEN a mock event handler - Mock> mockHandler = new Mock>(); - mockHandler.Setup(h => h(It.IsAny(), It.IsAny())); - - // AND a command with that handler - Command command = new Command("my-command", "xyz", "abc", mockHandler.Object); - - // AND a mock plugin with that command - Mock mockPlugin = new Mock(new PluginLoadData(null, null, null, null, (Logger)null, null)); - mockPlugin.Setup(p => p.Commands).Returns(new Command[] { command }); - - // WHEN the command is run on the plugin through the test util - PluginTestUtil pluginTestUtil = new PluginTestUtil(); - pluginTestUtil.RunCommandOn("my-command with arguments -and=many -f -l -a -g -s", mockPlugin.Object); - - // THEN the command handler was invoked with the correct args - mockHandler.Verify(h => h(pluginTestUtil, It.Is(a => - a.OriginalCommand == "my-command with arguments -and=many -f -l -a -g -s" - && a.Arguments.Length == 2 - && a.Arguments[1] == "arguments" - && a.Command == command - && a.Flags.Count == 6 - && a.Flags.Get("and") == "many" - && a.RawArguments.Length == 8 - && a.RawArguments[3] == "-f" - )), Times.Once); - } - - [TestMethod] - public void TestRunCommandOnWhenCommandDoesNotExists() - { - // GIVEN a mock event handler - Mock> mockHandler = new Mock>(); - mockHandler.Setup(h => h(It.IsAny(), It.IsAny())); - - // AND a command with a different name - Command command = new Command("not-this", "xyz", "abc", mockHandler.Object); - - // AND a mock plugin with that command - Mock mockPlugin = new Mock(new PluginLoadData(null, null, null, null, (Logger)null, null)); - mockPlugin.Setup(p => p.Commands).Returns(new Command[] { command }); - - // THEN an exception is thrown - // TODO DR3 this is a poor choice of exception - Assert.ThrowsException(() => - { - // WHEN the command is run on the plugin through the test util - PluginTestUtil pluginTestUtil = new PluginTestUtil(); - pluginTestUtil.RunCommandOn("my-command with arguments -and=many -f -l -a -g -s", mockPlugin.Object); - }); - } - } -} diff --git a/DarkRift.Server.Testing/packages.config b/DarkRift.Server.Testing/packages.config deleted file mode 100644 index de82217..0000000 --- a/DarkRift.Server.Testing/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/DarkRift.Server.Testing/Configuration/DarkRiftClusterConfigurationBuilderTests.cs b/DarkRift.Server.Tests/Configuration/DarkRiftClusterConfigurationBuilderTests.cs similarity index 80% rename from DarkRift.Server.Testing/Configuration/DarkRiftClusterConfigurationBuilderTests.cs rename to DarkRift.Server.Tests/Configuration/DarkRiftClusterConfigurationBuilderTests.cs index 2e4c673..2c072d8 100644 --- a/DarkRift.Server.Testing/Configuration/DarkRiftClusterConfigurationBuilderTests.cs +++ b/DarkRift.Server.Tests/Configuration/DarkRiftClusterConfigurationBuilderTests.cs @@ -4,20 +4,14 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using NUnit.Framework; -namespace DarkRift.Server.Configuration.Testing +namespace DarkRift.Server.Configuration.Tests { - [TestClass] public class DarkRiftClusterConfigurationBuilderTests { - [TestMethod] - public void TestAddGroup() + [Test] + public void AddGroup() { // GIVEN an empty config builder DarkRiftClusterConfigurationBuilder builder = DarkRiftClusterConfigurationBuilder.Create(); diff --git a/DarkRift.Server.Testing/Configuration/DarkRiftServerConfigurationBuilderTests.cs b/DarkRift.Server.Tests/Configuration/DarkRiftServerConfigurationBuilderTests.cs similarity index 89% rename from DarkRift.Server.Testing/Configuration/DarkRiftServerConfigurationBuilderTests.cs rename to DarkRift.Server.Tests/Configuration/DarkRiftServerConfigurationBuilderTests.cs index 6d5761e..dffe7e8 100644 --- a/DarkRift.Server.Testing/Configuration/DarkRiftServerConfigurationBuilderTests.cs +++ b/DarkRift.Server.Tests/Configuration/DarkRiftServerConfigurationBuilderTests.cs @@ -4,22 +4,17 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using Microsoft.VisualStudio.TestTools.UnitTesting; using System; -using System.Collections.Generic; using System.Collections.Specialized; -using System.Linq; using System.Net; -using System.Text; -using System.Threading.Tasks; +using NUnit.Framework; -namespace DarkRift.Server.Configuration.Testing +namespace DarkRift.Server.Configuration.Tests { - [TestClass] public class DarkRiftServerConfigurationBuilderTests { - [TestMethod] - public void TestWithDataDirectory() + [Test] + public void WithDataDirectory() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -31,8 +26,8 @@ public void TestWithDataDirectory() Assert.AreEqual("directory", builder.ServerSpawnData.Data.Directory); } - [TestMethod] - public void TestWithDispatcherExecutorThreadID() + [Test] + public void WithDispatcherExecutorThreadID() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -44,8 +39,8 @@ public void TestWithDispatcherExecutorThreadID() Assert.AreEqual(1234, builder.ServerSpawnData.DispatcherExecutorThreadID); } - [TestMethod] - public void TestWithEventsFromDispatcher() + [Test] + public void WithEventsFromDispatcher() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -57,8 +52,8 @@ public void TestWithEventsFromDispatcher() Assert.IsTrue(builder.ServerSpawnData.EventsFromDispatcher); } - [TestMethod] - public void TestAddListener() + [Test] + public void AddListener() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -75,8 +70,8 @@ public void TestAddListener() Assert.AreEqual(0, builder.ServerSpawnData.Listeners.NetworkListeners[0].Settings.Count); } - [TestMethod] - public void TestAddListenerWithSettings() + [Test] + public void AddListenerWithSettings() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -98,8 +93,8 @@ public void TestAddListenerWithSettings() Assert.AreEqual("value", builder.ServerSpawnData.Listeners.NetworkListeners[0].Settings["key"]); } - [TestMethod] - public void TestWithStartupLogLevels() + [Test] + public void WithStartupLogLevels() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -113,8 +108,8 @@ public void TestWithStartupLogLevels() Assert.AreEqual(LogType.Fatal, builder.ServerSpawnData.Logging.StartupLogLevels[1]); } - [TestMethod] - public void TestAddLogWriter() + [Test] + public void AddLogWriter() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -131,8 +126,8 @@ public void TestAddLogWriter() Assert.AreEqual(0, builder.ServerSpawnData.Logging.LogWriters[0].Settings.Count); } - [TestMethod] - public void TestAddLogWriterWithSettings() + [Test] + public void AddLogWriterWithSettings() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -154,8 +149,8 @@ public void TestAddLogWriterWithSettings() Assert.AreEqual("value", builder.ServerSpawnData.Logging.LogWriters[0].Settings["key"]); } - [TestMethod] - public void TestWithPerMessageMetrics() + [Test] + public void WithPerMessageMetrics() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -167,8 +162,8 @@ public void TestWithPerMessageMetrics() Assert.IsTrue(builder.ServerSpawnData.Metrics.EnablePerMessageMetrics); } - [TestMethod] - public void TestWithMetricsWriter() + [Test] + public void WithMetricsWriter() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -181,8 +176,8 @@ public void TestWithMetricsWriter() Assert.AreEqual(0, builder.ServerSpawnData.Metrics.MetricsWriter.Settings.Count); } - [TestMethod] - public void TestWithMetricsWriterWithSettings() + [Test] + public void WithMetricsWriterWithSettings() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -200,8 +195,8 @@ public void TestWithMetricsWriterWithSettings() Assert.AreEqual("value", builder.ServerSpawnData.Metrics.MetricsWriter.Settings["key"]); } - [TestMethod] - public void TestWithLoadPluginsByDefault() + [Test] + public void WithLoadPluginsByDefault() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -213,8 +208,8 @@ public void TestWithLoadPluginsByDefault() Assert.IsTrue(builder.ServerSpawnData.Plugins.LoadByDefault); } - [TestMethod] - public void TestAddPlugin() + [Test] + public void AddPlugin() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -229,8 +224,8 @@ public void TestAddPlugin() Assert.AreEqual(0, builder.ServerSpawnData.Plugins.Plugins[0].Settings.Count); } - [TestMethod] - public void TestAddPluginWithSettings() + [Test] + public void AddPluginWithSettings() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -251,8 +246,8 @@ public void TestAddPluginWithSettings() Assert.AreEqual("value", builder.ServerSpawnData.Plugins.Plugins[0].Settings["key"]); } - [TestMethod] - public void TestExceptPlugin() + [Test] + public void ExceptPlugin() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -267,8 +262,8 @@ public void TestExceptPlugin() Assert.AreEqual(0, builder.ServerSpawnData.Plugins.Plugins[0].Settings.Count); } - [TestMethod] - public void TestAddPluginSearchPath() + [Test] + public void AddPluginSearchPath() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -283,8 +278,8 @@ public void TestAddPluginSearchPath() Assert.AreEqual(DependencyResolutionStrategy.Standard, builder.ServerSpawnData.PluginSearch.PluginSearchPaths[0].DependencyResolutionStrategy); } - [TestMethod] - public void TestAddPluginSearchPathWithCreateDir() + [Test] + public void AddPluginSearchPathWithCreateDir() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -299,8 +294,8 @@ public void TestAddPluginSearchPathWithCreateDir() Assert.AreEqual(DependencyResolutionStrategy.Standard, builder.ServerSpawnData.PluginSearch.PluginSearchPaths[0].DependencyResolutionStrategy); } - [TestMethod] - public void TestAddPluginSearchPathWithDependencyResolutionStrategy() + [Test] + public void AddPluginSearchPathWithDependencyResolutionStrategy() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -315,8 +310,8 @@ public void TestAddPluginSearchPathWithDependencyResolutionStrategy() Assert.AreEqual(DependencyResolutionStrategy.RecursiveFromDirectory, builder.ServerSpawnData.PluginSearch.PluginSearchPaths[0].DependencyResolutionStrategy); } - [TestMethod] - public void TestAddPluginSearchPathWithCreateDirAndDependencyResolutionStrategy() + [Test] + public void AddPluginSearchPathWithCreateDirAndDependencyResolutionStrategy() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -331,8 +326,8 @@ public void TestAddPluginSearchPathWithCreateDirAndDependencyResolutionStrategy( Assert.AreEqual(DependencyResolutionStrategy.RecursiveFromDirectory, builder.ServerSpawnData.PluginSearch.PluginSearchPaths[0].DependencyResolutionStrategy); } - [TestMethod] - public void TestAddPluginType() + [Test] + public void AddPluginType() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -345,8 +340,8 @@ public void TestAddPluginType() Assert.AreSame(typeof(DateTime), builder.ServerSpawnData.PluginSearch.PluginTypes[0]); } - [TestMethod] - public void TestWithMaxStrikes() + [Test] + public void WithMaxStrikes() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -358,8 +353,8 @@ public void TestWithMaxStrikes() Assert.AreEqual(123, builder.ServerSpawnData.Server.MaxStrikes); } - [TestMethod] - public void TestWithMaxReconnectAttempts() + [Test] + public void WithMaxReconnectAttempts() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -371,8 +366,8 @@ public void TestWithMaxReconnectAttempts() Assert.AreEqual(123, builder.ServerSpawnData.Server.ReconnectAttempts); } - [TestMethod] - public void TestWithServerGroup() + [Test] + public void WithServerGroup() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -384,8 +379,8 @@ public void TestWithServerGroup() Assert.AreEqual("group", builder.ServerSpawnData.Server.ServerGroup); } - [TestMethod] - public void TestWithAdvertisedHost() + [Test] + public void WithAdvertisedHost() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -397,8 +392,8 @@ public void TestWithAdvertisedHost() Assert.AreEqual("host", builder.ServerSpawnData.ServerRegistry.AdvertisedHost); } - [TestMethod] - public void TestWithAdvertisedPort() + [Test] + public void WithAdvertisedPort() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -410,8 +405,8 @@ public void TestWithAdvertisedPort() Assert.AreEqual(1234, builder.ServerSpawnData.ServerRegistry.AdvertisedPort); } - [TestMethod] - public void TestWithServerRegistryConnector() + [Test] + public void WithServerRegistryConnector() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); @@ -424,8 +419,8 @@ public void TestWithServerRegistryConnector() Assert.AreEqual(0, builder.ServerSpawnData.ServerRegistry.ServerRegistryConnector.Settings.Count); } - [TestMethod] - public void TestWithServerRegistryConnectorWithSettings() + [Test] + public void WithServerRegistryConnectorWithSettings() { // GIVEN an empty config builder DarkRiftServerConfigurationBuilder builder = DarkRiftServerConfigurationBuilder.Create(); diff --git a/DarkRift.Server.Tests/DarkRift.Server.Tests.asmdef b/DarkRift.Server.Tests/DarkRift.Server.Tests.asmdef new file mode 100644 index 0000000..3ff96ec --- /dev/null +++ b/DarkRift.Server.Tests/DarkRift.Server.Tests.asmdef @@ -0,0 +1,25 @@ +{ + "name": "DarkRift.Server.Tests", + "rootNamespace": "", + "references": [ + "GUID:27619889b8ba8c24980f49ee34dbb44a", + "GUID:0acc523941302664db1f4e527237feb3", + "GUID:74b22b8f1e899468c828514608b766c6", + "GUID:946957ecf1ca94f148ed5fbadd24e3de" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Server.Tests/PluginTestUtilTest.cs b/DarkRift.Server.Tests/PluginTestUtilTest.cs new file mode 100644 index 0000000..2b73fa6 --- /dev/null +++ b/DarkRift.Server.Tests/PluginTestUtilTest.cs @@ -0,0 +1,85 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +using System; +using NUnit.Framework; + +namespace DarkRift.Server.Tests +{ + public class PluginTestUtilTest + { + private class MockPlugin : ExtendedPluginBase + { + public MockPlugin(ExtendedPluginBaseLoadData pluginLoadData) : base(pluginLoadData) + { + } + + private Command[] commands; + + public override bool ThreadSafe => throw new NotImplementedException(); + public override Version Version => throw new NotImplementedException(); + public override Command[] Commands => commands; + + public void SetCommands(Command[] value) + { + commands = value; + } + } + + [Test] + public void RunCommandOnWhenCommandExists() + { + string commandString = "my-command with arguments -and=many -f -l -a -g -s"; + + // GIVEN a command with a handler + Command command = new Command("my-command", "xyz", "abc", (sender, e) => + { + // THEN the command handler was invoked with the correct args + Assert.IsInstanceOf(sender); + Assert.IsInstanceOf(e); + Assert.AreEqual(e.OriginalCommand, commandString); + Assert.AreEqual(e.Arguments.Length, 2); + Assert.AreEqual(e.Arguments[1], "arguments"); + Assert.AreEqual(e.Flags.Count, 6); + Assert.AreEqual(e.Flags.Get("and"), "many"); + Assert.AreEqual(e.RawArguments.Length, 8); + Assert.AreEqual(e.RawArguments[3], "-f"); + }); + + // AND a mock plugin with that command + MockPlugin mockPlugin = new MockPlugin(new PluginLoadData(null, null, null, null, (Logger)null, null)); + mockPlugin.SetCommands(new Command[] { command }); + + // WHEN the command is run on the plugin through the test util + PluginTestUtil pluginTestUtil = new PluginTestUtil(); + pluginTestUtil.RunCommandOn(commandString, mockPlugin); + } + + [Test] + public void RunCommandOnWhenCommandDoesNotExists() + { + // AND a command with a different name + Command command = new Command("not-this", "xyz", "abc", (sender, e) => + { + Assert.IsInstanceOf(sender); + Assert.IsInstanceOf(e); + }); + + // AND a mock plugin with that command + MockPlugin mockPlugin = new MockPlugin(new PluginLoadData(null, null, null, null, (Logger)null, null)); + mockPlugin.SetCommands(new Command[] { command }); + + // THEN an exception is thrown + // TODO DR3 this is a poor choice of exception + Assert.Throws(() => + { + // WHEN the command is run on the plugin through the test util + PluginTestUtil pluginTestUtil = new PluginTestUtil(); + pluginTestUtil.RunCommandOn("my-command with arguments -and=many -f -l -a -g -s", mockPlugin); + }); + } + } +} diff --git a/DarkRift.Server.Testing/Plugins/Chat/BadWordFilterTests.cs b/DarkRift.Server.Tests/Plugins/Chat/BadWordFilterTests.cs similarity index 71% rename from DarkRift.Server.Testing/Plugins/Chat/BadWordFilterTests.cs rename to DarkRift.Server.Tests/Plugins/Chat/BadWordFilterTests.cs index a66d338..cc2a851 100644 --- a/DarkRift.Server.Testing/Plugins/Chat/BadWordFilterTests.cs +++ b/DarkRift.Server.Tests/Plugins/Chat/BadWordFilterTests.cs @@ -5,23 +5,19 @@ */ using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - using System.Text.RegularExpressions; -using DarkRift.Server.Plugins.Chat; using System.Collections.Specialized; -using DarkRift.Server; using System.IO; +using NUnit.Framework; -namespace DarkRift.Server.Plugins.Chat.Testing +namespace DarkRift.Server.Plugins.Chat.Tests { - [TestClass] public class BadWordFilterTests { private BadWordFilter filter; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { filter = new BadWordFilter(new PluginLoadData("BadWordFilter", new NameValueCollection(), new DarkRiftInfo(DateTime.Now), new DarkRiftThreadHelper(false, null), (Logger)null, Path.GetTempPath())); @@ -29,32 +25,32 @@ public void Initialize() filter.PopulateBadWords(new string[] { "poop", "crap" }); } - [TestMethod] - public void ContainsTest() + [Test] + public void Contains() { Assert.IsTrue(filter.ContainsBadWords("poop")); } - [TestMethod] - public void ContainsCaseInsensitiveTest() + [Test] + public void ContainsCaseInsensitive() { Assert.IsTrue(filter.ContainsBadWords("pOOp")); } - [TestMethod] - public void FilterToCharTest() + [Test] + public void FilterToChar() { Assert.AreEqual("You smell like ~~~~.", filter.FilterToChar("You smell like crap.", '~')); } - [TestMethod] - public void FilterToSymbolsTest() + [Test] + public void FilterToSymbols() { Assert.IsTrue(Regex.IsMatch(filter.FilterToSymbols("Poop you."), @"^[\$#@%&\*!]{4} you.")); } - [TestMethod] - public void FilterToRandomStringTest() + [Test] + public void FilterToRandomString() { string a = filter.FilterToRandomString("Crap's going down.", new string[] { "Australia", "Gravity" }); Assert.IsTrue(a == "Australia's going down." || a == "Gravity's going down."); diff --git a/DarkRift.Server.Testing/Plugins/Matchmaking/MatchmakerRankingBuilderTests.cs b/DarkRift.Server.Tests/Plugins/Matchmaking/MatchmakerRankingBuilderTests.cs similarity index 81% rename from DarkRift.Server.Testing/Plugins/Matchmaking/MatchmakerRankingBuilderTests.cs rename to DarkRift.Server.Tests/Plugins/Matchmaking/MatchmakerRankingBuilderTests.cs index 7b7e038..c418b50 100644 --- a/DarkRift.Server.Testing/Plugins/Matchmaking/MatchmakerRankingBuilderTests.cs +++ b/DarkRift.Server.Tests/Plugins/Matchmaking/MatchmakerRankingBuilderTests.cs @@ -4,29 +4,23 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using DarkRift.Server.Plugins.Matchmaking; -using Microsoft.VisualStudio.TestTools.UnitTesting; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using NUnit.Framework; -namespace DarkRift.Server.Plugins.Rooms.Tests.Plugins.Matchmaking +namespace DarkRift.Server.Plugins.Matchmaking.Tests { - [TestClass] public class MatchmakerRankingBuilderTests { private MatchmakerRankingBuilder builder; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { builder = new MatchmakerRankingBuilder(); } - [TestMethod] - public void TestMinimiseDifferenceLinearFloat() + [Test] + public void MinimiseDifferenceLinearFloat() { //Zero difference builder.MinimiseDifferenceLinear(0.5f, 0.5f, 1f, 0.5f); @@ -44,8 +38,8 @@ public void TestMinimiseDifferenceLinearFloat() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMinimiseDifferenceLinearDouble() + [Test] + public void MinimiseDifferenceLinearDouble() { //Zero difference builder.MinimiseDifferenceLinear(0.5, 0.5, 1.0, 0.5f); @@ -63,8 +57,8 @@ public void TestMinimiseDifferenceLinearDouble() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMinimiseDifferenceLinearInt() + [Test] + public void MinimiseDifferenceLinearInt() { //Zero difference builder.MinimiseDifferenceLinear(5, 5, 10, 0.5f); @@ -82,8 +76,8 @@ public void TestMinimiseDifferenceLinearInt() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMinimiseDifferenceLinearLong() + [Test] + public void MinimiseDifferenceLinearLong() { //Zero difference builder.MinimiseDifferenceLinear(5L, 5L, 10L, 0.5f); @@ -101,8 +95,8 @@ public void TestMinimiseDifferenceLinearLong() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMaximiseDifferenceLinearFloat() + [Test] + public void MaximiseDifferenceLinearFloat() { //Maximum difference builder.MaximiseDifferenceLinear(0f, 1f, 1f, 0.5f); @@ -120,8 +114,8 @@ public void TestMaximiseDifferenceLinearFloat() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMaximiseDifferenceLinearDouble() + [Test] + public void MaximiseDifferenceLinearDouble() { //Maximum difference builder.MaximiseDifferenceLinear(0, 1, 1, 0.5f); @@ -139,8 +133,8 @@ public void TestMaximiseDifferenceLinearDouble() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMaximiseDifferenceLinearInt() + [Test] + public void MaximiseDifferenceLinearInt() { //Maximum difference builder.MaximiseDifferenceLinear(0, 10, 10, 0.5f); @@ -158,8 +152,8 @@ public void TestMaximiseDifferenceLinearInt() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestMaximiseDifferenceLinearLong() + [Test] + public void MaximiseDifferenceLinearLong() { //Maximum difference builder.MaximiseDifferenceLinear(0L, 10L, 10L, 0.5f); @@ -177,8 +171,8 @@ public void TestMaximiseDifferenceLinearLong() Assert.AreEqual(0.6f, builder.Ranking); } - [TestMethod] - public void TestEqualFloat() + [Test] + public void EqualFloat() { //Equal builder.Equal(1f, 1f, 0.5f); @@ -191,8 +185,8 @@ public void TestEqualFloat() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestEqualDouble() + [Test] + public void EqualDouble() { //Equal builder.Equal(1.0, 1.0, 0.5f); @@ -205,8 +199,8 @@ public void TestEqualDouble() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestEqualInt() + [Test] + public void EqualInt() { //Equal builder.Equal(1, 1, 0.5f); @@ -219,8 +213,8 @@ public void TestEqualInt() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestEqualLong() + [Test] + public void EqualLong() { //Equal builder.Equal(1L, 1L, 0.5f); @@ -233,8 +227,8 @@ public void TestEqualLong() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestEqualIEquatable() + [Test] + public void EqualIEquatable() { //Equal builder.Equal((IEquatable)1, (IEquatable)1, 0.5f); @@ -247,8 +241,8 @@ public void TestEqualIEquatable() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestNotEqualFloat() + [Test] + public void NotEqualFloat() { //Not equal builder.NotEqual(0f, 1f, 0.5f); @@ -261,8 +255,8 @@ public void TestNotEqualFloat() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestNotEqualDouble() + [Test] + public void NotEqualDouble() { //Not equal builder.NotEqual(0.0, 1.0, 0.5f); @@ -275,8 +269,8 @@ public void TestNotEqualDouble() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestNotEqualInt() + [Test] + public void NotEqualInt() { //Not equal builder.NotEqual(0, 1, 0.5f); @@ -289,8 +283,8 @@ public void TestNotEqualInt() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestNotEqualLong() + [Test] + public void NotEqualLong() { //Not equal builder.NotEqual(0L, 1L, 0.5f); @@ -303,8 +297,8 @@ public void TestNotEqualLong() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestNotEqualIEquatable() + [Test] + public void NotEqualIEquatable() { //Not equal builder.NotEqual((IEquatable)0, (IEquatable)1, 0.5f); @@ -317,8 +311,8 @@ public void TestNotEqualIEquatable() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestIsTrue() + [Test] + public void IsTrue() { //True builder.IsTrue(true, 0.5f); @@ -331,8 +325,8 @@ public void TestIsTrue() Assert.AreEqual(0.5f, builder.Ranking); } - [TestMethod] - public void TestIsFalse() + [Test] + public void IsFalse() { //False builder.IsFalse(false, 0.5f); @@ -344,15 +338,15 @@ public void TestIsFalse() Assert.AreEqual(0.5f, builder.Ranking); } - - [TestMethod] - public void TestFail() + + [Test] + public void Fail() { Assert.AreEqual(false, builder.Failed); //Fail builder.Fail(); - + Assert.AreEqual(true, builder.Failed); //Add ranking as should always return 0 @@ -361,8 +355,8 @@ public void TestFail() Assert.AreEqual(0.0f, builder.Ranking); } - [TestMethod] - public void TestClear() + [Test] + public void Clear() { //Fail and give ranking builder.Fail(); diff --git a/DarkRift.Server.Testing/Plugins/Matchmaking/RankingMatchmakerTests.cs b/DarkRift.Server.Tests/Plugins/Matchmaking/RankingMatchmakerTests.cs similarity index 68% rename from DarkRift.Server.Testing/Plugins/Matchmaking/RankingMatchmakerTests.cs rename to DarkRift.Server.Tests/Plugins/Matchmaking/RankingMatchmakerTests.cs index 3a28c45..d15f9c2 100644 --- a/DarkRift.Server.Testing/Plugins/Matchmaking/RankingMatchmakerTests.cs +++ b/DarkRift.Server.Tests/Plugins/Matchmaking/RankingMatchmakerTests.cs @@ -7,18 +7,53 @@ using System; using System.Collections.Specialized; using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Moq; +using NUnit.Framework; namespace DarkRift.Server.Plugins.Matchmaking.Tests { - [TestClass] public class MatchmakerTests { - private Mock> matchmaker; + public class TestEntity + { + public float Mmr { get; } + + public TestEntity(float mmr) + { + if (mmr < 0 || mmr > 1) + { + throw new ArgumentException("Invalid MMR."); + } + + Mmr = mmr; + } + } + + public class MockMatchRankingContext : MatchRankingContext + { + internal MockMatchRankingContext(float discardThreshold) : base(discardThreshold) + { + } + } - [TestInitialize] - public void Initialize() + public class MockRankingMatchmaker : RankingMatchmaker + { + public MockRankingMatchmaker(PluginLoadData pluginLoadData) : base(pluginLoadData) + { + } + + public override bool ThreadSafe => throw new NotImplementedException(); + public override Version Version => throw new NotImplementedException(); + + public override float GetSuitabilityMetric(TestEntity entity1, TestEntity entity2, MatchRankingContext context) + { + return 1 - (Math.Abs(entity1.Mmr - entity2.Mmr) / 1); + } + } + + private RankingMatchmaker matchmaker; + + [SetUp] + public void SetUp() { NameValueCollection settings = new NameValueCollection() { @@ -32,26 +67,21 @@ public void Initialize() PluginLoadData loadData = new PluginLoadData("Matchmaker", settings, null, threadHelper, (Logger)null, null); - matchmaker = new Mock>(loadData) - { - CallBase = true - }; - - //Setup suitability metric function to be a simple minimization of MMRs - matchmaker.Setup(m => m.GetSuitabilityMetric(It.IsAny(), It.IsAny(), It.IsAny>())) - .Returns((TestEntity e1, TestEntity e2, MatchRankingContext context) => 1 - Math.Abs(e1.Mmr - e2.Mmr) / 1); + matchmaker = new MockRankingMatchmaker(loadData); } - [TestMethod] - public void TestMatchmakerAllPerfect() + [Test] + public void MatchmakerAllPerfect() { TestEntity[] entities = { new TestEntity(1f), new TestEntity(1f), new TestEntity(1f), new TestEntity(1f) }; foreach (TestEntity entity in entities) - matchmaker.Object.Enqueue(entity, null); + { + matchmaker.Enqueue(entity, null); + } bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; @@ -64,21 +94,23 @@ public void TestMatchmakerAllPerfect() Assert.IsTrue(args.Group.Contains(entities[3])); }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsTrue(invoked); } - [TestMethod] - public void TestMatchmakerMostlyPerfect() + [Test] + public void MatchmakerMostlyPerfect() { TestEntity[] entities = { new TestEntity(1f), new TestEntity(0.25f), new TestEntity(1f), new TestEntity(1f), new TestEntity(1f) }; foreach (TestEntity entity in entities) - matchmaker.Object.Enqueue(entity, null); - + { + matchmaker.Enqueue(entity, null); + } + bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; @@ -91,40 +123,44 @@ public void TestMatchmakerMostlyPerfect() Assert.IsTrue(args.Group.Contains(entities[4])); }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsTrue(invoked); } - [TestMethod] + [Test] public void TestMatchmakerTooFew() { TestEntity[] entities = { new TestEntity(1f), new TestEntity(1f), new TestEntity(1f) }; foreach (TestEntity entity in entities) - matchmaker.Object.Enqueue(entity, null); + { + matchmaker.Enqueue(entity, null); + } bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsFalse(invoked); } - [TestMethod] + [Test] public void TestMatchmakerMetrics() { TestEntity[] entities = { new TestEntity(1f), new TestEntity(0f), new TestEntity(0.5f), new TestEntity(0.25f), new TestEntity(0.75f), new TestEntity(0.6f), new TestEntity(0.55f), new TestEntity(0.45f) }; foreach (TestEntity entity in entities) - matchmaker.Object.Enqueue(entity, null); + { + matchmaker.Enqueue(entity, null); + } bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; @@ -137,12 +173,12 @@ public void TestMatchmakerMetrics() Assert.IsTrue(args.Group.Contains(entities[7])); }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsTrue(invoked); } - [TestMethod] + [Test] public void TestMatchmakerGroups() { TestEntity[][] entities = { @@ -151,10 +187,12 @@ public void TestMatchmakerGroups() }; foreach (TestEntity[] group in entities) - matchmaker.Object.EnqueueGroup(group, null); + { + matchmaker.EnqueueGroup(group, null); + } bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; @@ -167,7 +205,7 @@ public void TestMatchmakerGroups() Assert.IsTrue(args.Group.Contains(entities[1][1])); }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsTrue(invoked); } @@ -180,30 +218,32 @@ public void TestMatchmakerGroupsTooMany() }; foreach (TestEntity[] group in entities) - matchmaker.Object.EnqueueGroup(group, null); + { + matchmaker.EnqueueGroup(group, null); + } bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsFalse(invoked); } - [TestMethod] + [Test] public void TestMatchmakerMixed() { TestEntity[] group = new TestEntity[] { new TestEntity(1f), new TestEntity(1f), new TestEntity(1f) }; TestEntity individual = new TestEntity(1f); - matchmaker.Object.EnqueueGroup(group, null); - matchmaker.Object.Enqueue(individual, null); + matchmaker.EnqueueGroup(group, null); + matchmaker.Enqueue(individual, null); bool invoked = false; - matchmaker.Object.GroupFormed += (object sender, GroupFormedEventArgs args) => + matchmaker.GroupFormed += (object sender, GroupFormedEventArgs args) => { invoked = true; @@ -216,30 +256,9 @@ public void TestMatchmakerMixed() Assert.IsTrue(args.Group.Contains(group[2])); }; - matchmaker.Object.PerformFullSearch(); + matchmaker.PerformFullSearch(); Assert.IsTrue(invoked); } - - public class TestEntity - { - public float Mmr { get; } - - public TestEntity(float mmr) - { - if (mmr < 0 || mmr > 1) - throw new ArgumentException("Invalid MMR."); - - this.Mmr = mmr; - } - } - - private class TestRankingProvider - { - public float GetSuitabilityMetric(TestEntity entity1, TestEntity entity2, MatchRankingContext context) - { - return entity1.Mmr + entity2.Mmr / 2; - } - } } } diff --git a/DarkRift.Server.Console/Properties/AssemblyInfo.cs b/DarkRift.Server/AssemblyInfo.cs similarity index 58% rename from DarkRift.Server.Console/Properties/AssemblyInfo.cs rename to DarkRift.Server/AssemblyInfo.cs index cf577cc..000bc8a 100644 --- a/DarkRift.Server.Console/Properties/AssemblyInfo.cs +++ b/DarkRift.Server/AssemblyInfo.cs @@ -4,4 +4,8 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +using System.Reflection; +using System.Runtime.CompilerServices; +[assembly: DarkRift.Preserve] +[assembly: InternalsVisibleTo("DarkRift.Server.Tests")] diff --git a/DarkRift.Server.Testing/Properties/AssemblyInfo.cs b/DarkRift.Server/AssemblyInfo.gen.cs similarity index 53% rename from DarkRift.Server.Testing/Properties/AssemblyInfo.cs rename to DarkRift.Server/AssemblyInfo.gen.cs index 4b4a452..47dbff7 100644 --- a/DarkRift.Server.Testing/Properties/AssemblyInfo.cs +++ b/DarkRift.Server/AssemblyInfo.gen.cs @@ -4,3 +4,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +// +// Do not modify this file manually +// This file is is updated based on the version found on package.json +[assembly: System.Reflection.AssemblyVersion("2.10.1")] diff --git a/DarkRift.Server/DarkRift.Server.asmdef b/DarkRift.Server/DarkRift.Server.asmdef new file mode 100644 index 0000000..bf106d0 --- /dev/null +++ b/DarkRift.Server/DarkRift.Server.asmdef @@ -0,0 +1,19 @@ +{ + "name": "DarkRift.Server", + "rootNamespace": "", + "references": [ + "GUID:74b22b8f1e899468c828514608b766c6", + "GUID:76832b94ba439479ca17ebb829c50a03" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "!DARKRIFT_NO_SERVER" + ], + "versionDefines": [], + "noEngineReferences": true +} \ No newline at end of file diff --git a/DarkRift.SystemTesting/Clustering.feature b/DarkRift.SystemTesting/Clustering.feature deleted file mode 100644 index 99f136d..0000000 --- a/DarkRift.SystemTesting/Clustering.feature +++ /dev/null @@ -1,62 +0,0 @@ -Feature: ISC - AS A game developer - I WANT to be able to connect servers together - SO THAT I can scale my system - -Scenario: I can connect two servers together - Given I have a running server from ServerInGroup1.config and ClusterWithTwoGroups.config - And I have a running server from ServerInGroup2.config and ClusterWithTwoGroups.config - Then server 0 should synchronise to have 1 server in Group2 - And server 1 should synchronise to have 1 server in Group1 - And there are no recycling issues - And the ServerConnected event has been fired 2 times - -Scenario Outline: I can send a message to an upstream server - Given I have a running server from ServerInGroup1.config and ClusterWithTwoGroups.config - And I have a running server from ServerInGroup2.config and ClusterWithTwoGroups.config - Then server 0 should synchronise to have 1 server in Group2 - And server 1 should synchronise to have 1 server in Group1 - When server 0 sends 'Hello World' to server 1 in Group2 with tag 7 - And server 1 has received 1 message - Then all messages are accounted for - And there are no recycling issues - - Examples: - | mode | - | reliably | - | unreliably | - -Scenario Outline: I can send a message to a downstream server - Given I have a running server from ServerInGroup1.config and ClusterWithTwoGroups.config - And I have a running server from ServerInGroup2.config and ClusterWithTwoGroups.config - Then server 0 should synchronise to have 1 server in Group2 - And server 1 should synchronise to have 1 server in Group1 - When server 1 sends 'Hello World' to server 0 in Group1 with tag 7 - And server 0 has received 1 message - Then all messages are accounted for - And there are no recycling issues - - Examples: - | mode | - | reliably | - | unreliably | - -Scenario: Servers can join during a scenario - Given I have a running server from ServerInGroup1.config and ClusterWithTwoGroups.config - And I have a running server from ServerInGroup2.config and ClusterWithTwoGroups.config - Then server 0 should synchronise to have 1 server in Group2 - And server 1 should synchronise to have 1 server in Group1 - And the ServerConnected event has been fired 2 times - When I have a running server from ServerInGroup2.config and ClusterWithTwoGroups.config - Then server 0 should synchronise to have 2 servers in Group2 - And server 2 should synchronise to have 1 server in Group1 - And the ServerConnected event has been fired 4 times - -Scenario: Servers can leave during a scenario - Given I have a running server from ServerInGroup1.config and ClusterWithTwoGroups.config - And I have a running server from ServerInGroup2.config and ClusterWithTwoGroups.config - Then server 0 should synchronise to have 1 server in Group2 - And server 1 should synchronise to have 1 server in Group1 - When I close server 0 - Then server 1 should synchronise to have 0 servers in Group1 - And the ServerDisconnected event has been fired 1 time diff --git a/DarkRift.SystemTesting/Configurations/Cluster/ClusterWithTwoGroups.config b/DarkRift.SystemTesting/Configurations/Cluster/ClusterWithTwoGroups.config deleted file mode 100644 index 3348aa2..0000000 --- a/DarkRift.SystemTesting/Configurations/Cluster/ClusterWithTwoGroups.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/Server.config b/DarkRift.SystemTesting/Configurations/Server/Server.config deleted file mode 100644 index 5b7a10b..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/Server.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerInGroup1.config b/DarkRift.SystemTesting/Configurations/Server/ServerInGroup1.config deleted file mode 100644 index 4441b6a..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerInGroup1.config +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerInGroup2.config b/DarkRift.SystemTesting/Configurations/Server/ServerInGroup2.config deleted file mode 100644 index 6ed4bd2..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerInGroup2.config +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerOnIPv6.config b/DarkRift.SystemTesting/Configurations/Server/ServerOnIPv6.config deleted file mode 100644 index 7eae378..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerOnIPv6.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerWithDifferentUdpPort.config b/DarkRift.SystemTesting/Configurations/Server/ServerWithDifferentUdpPort.config deleted file mode 100644 index 6265919..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerWithDifferentUdpPort.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerWithHealthCheck.config b/DarkRift.SystemTesting/Configurations/Server/ServerWithHealthCheck.config deleted file mode 100644 index 73d1691..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerWithHealthCheck.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerWithNoCache.config b/DarkRift.SystemTesting/Configurations/Server/ServerWithNoCache.config deleted file mode 100644 index 2bf02ad..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerWithNoCache.config +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Configurations/Server/ServerWithPrometheusEndpoint.config b/DarkRift.SystemTesting/Configurations/Server/ServerWithPrometheusEndpoint.config deleted file mode 100644 index ad47ba9..0000000 --- a/DarkRift.SystemTesting/Configurations/Server/ServerWithPrometheusEndpoint.config +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DarkRift.SystemTesting/Connecting.feature b/DarkRift.SystemTesting/Connecting.feature deleted file mode 100644 index 19bfc3a..0000000 --- a/DarkRift.SystemTesting/Connecting.feature +++ /dev/null @@ -1,68 +0,0 @@ -Feature: Connecting - AS A game developer - I WANT to be able to connect clients to my servers - SO THAT I can make multiplayer games - -Scenario: I can connect a single client to a server - Given I have a running server from Server.config - And 1 client connected - Then all clients should be connected - And server 0 should have 1 client - And there are no recycling issues - -Scenario: I can connect multiple clients to a server - Given I have a running server from Server.config - And 5 clients connected - Then all clients should be connected - And server 0 should have 5 clients - And there are no recycling issues - -Scenario: I can disconnect from a server - Given I have a running server from Server.config - And 1 client connected - Then all clients should be connected - And server 0 should have 1 client - When I disconnect client 0 - Then 0 clients should be connected - And 1 client should be disconnected - And server 0 should have 0 clients - -Scenario: I receive an ID from the server - Given I have a running server from Server.config - And 2 clients connected - Then all clients should be connected - And server 0 should have 2 clients - And client 1 has an ID of 1 - And there are no recycling issues - -Scenario: I can start and stop multiple servers on the same address/port - Given I have a running server from Server.config - When I close and forget server 0 - Then I can start a new server from Server.config - -Scenario: I can connect a single client to a server with differing UDP and TCP ports - Given I have a running server from ServerWithDifferentUdpPort.config - And 1 client connected - Then all clients should be connected - And server 0 should have 1 client - -Scenario: I can connect a single client to a server over IPv6 - Given I have a running server from ServerOnIPv6.config - And 1 client connected over IPv6 - Then all clients should be connected - And server 0 should have 1 client - And there are no recycling issues - -Scenario: I can query the server's health check - Given I have a running server from ServerWithHealthCheck.config - When I query the health check port - Then the server returns the expected fields - -Scenario: I can start and stop multiple servers with health checks - Given I have a running server from ServerWithHealthCheck.config - When I close and forget server 0 - Then I can start a new server from ServerWithHealthCheck.config - -Scenario: Issue #81 Being unable to connect does not stop the client from closing - Given 1 client that fails to connect - Then I can close client 0 diff --git a/DarkRift.SystemTesting/ConnectingSteps.cs b/DarkRift.SystemTesting/ConnectingSteps.cs deleted file mode 100644 index 0a75fc8..0000000 --- a/DarkRift.SystemTesting/ConnectingSteps.cs +++ /dev/null @@ -1,381 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using DarkRift.Client; -using DarkRift.Server; -using DarkRift.Server.Configuration; -using DarkRift.Server.Plugins.Listeners.Bichannel; -using DarkRift.SystemTesting.Plugins; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Specialized; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Threading; -using TechTalk.SpecFlow; - -namespace DarkRift.SystemTesting -{ - /// - /// Steps for basic DarkRift client/server connection operations. - /// - [Binding] - public class ConnectingSteps - { - /// - /// The world to store state in. - /// - private readonly World world; - - /// - /// The performance related test steps. - /// - private readonly PerformanceSteps performanceSteps; - - /// - /// The thread executing dispatcher tasks. - /// - private Thread dispatcherThread; - - public ConnectingSteps(World world, PerformanceSteps performanceSteps) - { - this.world = world; - this.performanceSteps = performanceSteps; - world.ServerJoined += ServerJoined; - world.ServerLeft += ServerLeft; - } - - private void ServerJoined(object sender, ServerJoinedEventArgs e) { -#if DEBUG - // We've just requested a load of objects that wont be returned until we disconnect the servers again - // UDP receive TCP receive in the connecting server; TCP receive in listening server - // Only do this once, this event will be fired from both the upstream and downstream server - if (e.ServerGroup.Direction == ServerConnectionDirection.Downstream) - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs += 3; -#endif - } - - private void ServerLeft(object sender, ServerLeftEventArgs e) - { -#if DEBUG - // We've just returned a load of objects that we don't normally expect - // UDP receive TCP receive in the connecting server; TCP receive in listening server - // Only do this once, this event will be fired from both the upstream and downstream server - if (e.ServerGroup.Direction == ServerConnectionDirection.Downstream) - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs -= 3; -#endif - } - - /// - /// Starts a server. - /// - /// The configuration file for the server. - [Given(@"I have a running server from ([\w\.]+)")] - public void GivenIHaveARunningServer(string serverConfig) - { - NameValueCollection parameters = new NameValueCollection { - { "port", GetFreePort().ToString() } - }; - - DarkRiftServer server = new DarkRiftServer(ServerSpawnData.CreateFromXml("Configurations/Server/" + serverConfig, parameters)); - server.StartServer(); - - world.AddServer(server); - -#if DEBUG - // We've just requested a load of objects that wont be returned until we close - // UDP receive TCP accept - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs += 2; -#endif - } - - /// - /// Starts a server inside a cluster. - /// - /// The configuration file for the server. - /// The configuration file for the cluster. - [Given(@"I have a running server from ([\w\.]+) and ([\w\.]+)")] - [When(@"I have a running server from ([\w\.]+) and ([\w\.]+)")] - public void GivenIHaveARunningServer(string serverConfig, string clusterConfig) - { - NameValueCollection parameters = new NameValueCollection { - { "port", GetFreePort().ToString() } - }; - - DarkRiftServerConfigurationBuilder serverConfigurationBuilder = DarkRiftServerConfigurationBuilder.CreateFromXml("Configurations/Server/" + serverConfig, parameters); - serverConfigurationBuilder.AddPluginType(typeof(InMemoryServerRegistryConnector)); - - DarkRiftServer server = new DarkRiftServer( - serverConfigurationBuilder.ServerSpawnData, - ClusterSpawnData.CreateFromXml("Configurations/Cluster/" + clusterConfig, new NameValueCollection()) - ); - - server.StartServer(); - - world.AddServer(server); - -#if DEBUG - // We've just requested a load of objects that wont be returned until we close - // UDP receive TCP accept - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs += 2; -#endif - } - - /// - /// The specified server is using the dispatcher. - /// - [Given(@"server (\d+) is using the dispatcher")] - public void GivenTheServerIsUsingTheDispatcher(ushort serverID) - { - world.GetServer(serverID).ThreadHelper.EventsFromDispatcher = true; - - // Create a snapshot view of the server so we have a consistent reference to it between tests - DarkRiftServer server = world.GetServer(serverID); - dispatcherThread = new Thread(() => - { - while (!server.Disposed) - { - server.DispatcherWaitHandle.WaitOne(); - - server.ExecuteDispatcherTasks(); - } - }); - dispatcherThread.Start(); - } - - /// - /// Connects a given number of clients to the server. - /// - /// The number of clients to connect. - [Given(@"(\d+) clients? connected")] - public void GivenConnectedClients(int numberOfClients) - { - for (int i = 0; i < numberOfClients; i++) - { - DarkRiftClient client = new DarkRiftClient(); - client.Connect( - new BichannelClientConnection( - IPAddress.Loopback, - world.GetServer(0).ClientManager.Port, - world.GetServer(0).NetworkListenerManager.GetNetworkListenersByType()[0].UdpPort, - true - ) - ); - world.AddClient(client); - -#if DEBUG - // We've just requested a load of objects that wont be returned until we close - // UDP receive TCP receive in client; TCP receive in server - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs += 3; -#endif - } - } - - /// - /// Connects a given number of clients to the server expecting them to fail to connect. - /// - /// The number of clients to fail to connect. - [Given(@"(\d+) clients? that fails? to connect")] - public void GivenClientsThatFailToConnect(int numberOfClients) - { - for (int i = 0; i < numberOfClients; i++) - { - DarkRiftClient client = new DarkRiftClient(); - try - { - client.Connect( - new BichannelClientConnection( - IPAddress.Loopback, - 4296, // Don't want to be able to connect so any port is fine - true - ) - ); - - Assert.Fail("Did not expect client to connect successfully."); - } - catch (SocketException) - { - // Expected - } - - world.AddClient(client); - } - } - - /// - /// Connects a given number of clients to the server over IPv6. - /// - /// The number of clients to connect. - [Given(@"^(\d+) clients? connected over IPv6$")] - public void GivenConnectedClientsOverIPv6(int numberOfClients) - { - for (int i = 0; i < numberOfClients; i++) - { - DarkRiftClient client = new DarkRiftClient(); - client.Connect( - new BichannelClientConnection( - IPAddress.IPv6Loopback, - world.GetServer(0).ClientManager.Port, - world.GetServer(0).NetworkListenerManager.GetNetworkListenersByType()[0].UdpPort, - true - ) - ); - - world.AddClient(client); -#if DEBUG - // We've just requested a load of objects that wont be returned until we close - // UDP receive TCP receive in client; TCP receive in server - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs += 3; -#endif - } - } - - /// - /// Checks that all clients created so far are connected to the server. - /// - [Then(@"all clients should be (connected|connecting|disconnected|disconnecting|interrupted)")] - public void AllClientsShouldBe(string expectedState) - { - ThenClientsShouldBe(world.GetClients().Count(), expectedState); - } - - /// - /// Checks that the given number of clients are connected to the server. - /// - /// The ID of the server to query. - /// The number of clients to check for. - [Then(@"server (\d+) should have (\d+) clients?")] - public void ThenTheServerShouldHaveClients(ushort serverID, int numberOfClients) - { - WaitUtility.WaitUntil("Expected server " + serverID + " to have " + numberOfClients + " clients connected.", () => - { - Assert.AreEqual(numberOfClients, world.GetServer(serverID).ClientManager.Count); - }); - } - - /// - /// Disconnects the specified client. - /// - /// The client to disconnect. - [When(@"I disconnect client (\d+)")] - public void WhenIDisconnectClient(ushort client) - { - world.GetClient(client).Disconnect(); - -#if DEBUG - // We've just returned a load of objects that we don't normally expect - // UDP receive TCP receive in client; TCP receive in server - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs -= 3; -#endif - } - - [Then(@"(\d+) clients? should be (connected|connecting|disconnected|disconnecting|interrupted)")] - public void ThenClientsShouldBe(int numberOfClients, string state) - { - ConnectionState expectedState; - if (state == "connected") - expectedState = ConnectionState.Connected; - else if (state == "connecting") - expectedState = ConnectionState.Connecting; - else if (state == "disconnected") - expectedState = ConnectionState.Disconnected; - else if (state == "disconnecting") - expectedState = ConnectionState.Disconnecting; - else if (state == "interrupted") - expectedState = ConnectionState.Interrupted; - else - throw new ArgumentException("Invalid expected state"); - - int count = world.GetClients().Count(c => c.ConnectionState == expectedState); - Assert.AreEqual(numberOfClients, count); - } - - //TODO the below step is pointless as we access by ID - [Then(@"client (\d+) has an ID of (\d+)")] - public void ThenClientHasAnIDOf(ushort client, int id) - { - Assert.AreEqual(id, world.GetClient(client).ID); - } - - [Then(@"I can start a new server from ([\w\.]+)")] - public void ThenICanStartANewServerFrom(string config) - { - GivenIHaveARunningServer(config); - } - - [Then(@"server (\d)+ should synchronise to have (\d+) servers? in (\w+)")] - public void ThenServerShouldSynchroniseToHaveServersInGroup(ushort serverID, ushort numberOfServers, string group) - { - // 30 second wait as we only update every 10 - WaitUtility.WaitUntil("Incorrect number of servers present in group " + group + ".", () => - { - Assert.AreEqual(numberOfServers, world.GetServer(serverID).RemoteServerManager.GetGroup(group).Count); - }, TimeSpan.FromSeconds(30)); - - WaitUtility.WaitUntil("Servers in group " + group + " are not all connected.", () => - { - Assert.IsTrue( - world.GetServer(serverID) - .RemoteServerManager.GetGroup(group) - .GetAllRemoteServers() - .All(s => s.ConnectionState == ConnectionState.Connected) - ); - }); - } - - [When(@"I close (and forget )?server (\d+)")] - public void WhenICloseServer(string andForget, ushort server) - { - world.GetServer(server).Dispose(); - - if (andForget != "") - world.RemoveServer(server); - -#if DEBUG - // We've just returned a load of objects that we don't normally expect - // UDP receive, TCP accept - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs -= 2; -#endif - } - - [Then(@"the ServerConnected event has been fired (\d) times?$")] - public void ThenTheServerConnectedEventHasBeenFired(int times) - { - Assert.AreEqual(times, world.ServerConnectedEvents); - } - - [Then(@"the ServerDisconnected event has been fired (\d) times?$")] - public void ThenTheServerDisconnectedEventHasBeenFired(int times) - { - Assert.AreEqual(times, world.ServerDisconnectedEvents); - } - - [Then(@"I can close client (\d+)")] - public void ThenICanClose(ushort client) - { - world.GetClient(client).Dispose(); - } - - [Given(@"a delay of (\d+)ms when a client connects before assigning message handlers")] - public void GivenADelayWhenAClientConnectsBeforeAssigningMessageHandlers(int delayMs) - { - world.ClientConnectionDelay = delayMs; - } - - /// - /// Returns a port that is unallocated. - /// - /// The port found. - private ushort GetFreePort() - { - using Socket socket = new Socket(SocketType.Stream, ProtocolType.Tcp); - - socket.Bind(new IPEndPoint(IPAddress.Any, 0)); - return (ushort)((IPEndPoint)socket.LocalEndPoint).Port; - } - } -} diff --git a/DarkRift.SystemTesting/DarkRift.SystemTesting.csproj b/DarkRift.SystemTesting/DarkRift.SystemTesting.csproj deleted file mode 100644 index f12deb4..0000000 --- a/DarkRift.SystemTesting/DarkRift.SystemTesting.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - net6.0 - Debug;Release - true - true - false - - - - - - - - - - - - - TRACE;DEBUG - - - - - - - - - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - diff --git a/DarkRift.SystemTesting/ExpectedPrometheusMetrics.txt b/DarkRift.SystemTesting/ExpectedPrometheusMetrics.txt deleted file mode 100644 index f65bd58..0000000 --- a/DarkRift.SystemTesting/ExpectedPrometheusMetrics.txt +++ /dev/null @@ -1,51 +0,0 @@ -# HELP client_connected_event_failures The number of failures executing the ClientConnected event. -# TYPE client_connected_event_failures counter -darkrift_client_manager_client_connected_event_failures 0 - -# HELP client_disconnected_event_failures The number of failures executing the ClientDisconnected event. -# TYPE client_disconnected_event_failures counter -darkrift_client_manager_client_disconnected_event_failures 0 - -# HELP connection_attempt_timeouts The number of connection attempts made to this listener that timed out. -# TYPE connection_attempt_timeouts counter -darkrift_default_network_listener_connection_attempt_timeouts 0 - -# HELP clients_connected The number of clients connected to the server. -# TYPE clients_connected gauge -darkrift_client_manager_clients_connected 0 - -# HELP client_connected_event_time The time taken to execute the ClientConnected event. -# TYPE client_connected_event_time histogram -darkrift_client_manager_client_connected_event_time_bucket{le="0.005"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="0.01"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="0.02"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="0.04"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="0.08"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="0.16"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="0.5"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="1"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="2"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="5"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="10"} 0 -darkrift_client_manager_client_connected_event_time_bucket{le="+Inf"} 0 -darkrift_client_manager_client_connected_event_time_sum 0 -darkrift_client_manager_client_connected_event_time_count 0 - -# HELP client_disconnected_event_time The time taken to execute the ClientDisconnected event. -# TYPE client_disconnected_event_time histogram -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.005"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.01"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.02"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.04"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.08"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.16"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="0.5"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="1"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="2"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="5"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="10"} 0 -darkrift_client_manager_client_disconnected_event_time_bucket{le="+Inf"} 0 -darkrift_client_manager_client_disconnected_event_time_sum 0 -darkrift_client_manager_client_disconnected_event_time_count 0 - - diff --git a/DarkRift.SystemTesting/HealthCheckSteps.cs b/DarkRift.SystemTesting/HealthCheckSteps.cs deleted file mode 100644 index 46774b4..0000000 --- a/DarkRift.SystemTesting/HealthCheckSteps.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using System.Net; -using System.Net.Http; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using TechTalk.SpecFlow; -using static DarkRift.Server.DarkRiftInfo; - -namespace DarkRift.SystemTesting -{ - /// - /// Steps for testing the server's health check - /// - [Binding] - internal class HealthCheckSteps - { - /// - /// The world to store state in. - /// - private readonly World world; - - /// - /// The downloaded health check data. - /// - private string jsonString; - - public HealthCheckSteps(World world) - { - this.world = world; - } - - [When("I query the health check port")] - public void WhenIQueryTheHealthCheckPort() - { - using HttpClient httpClient = new HttpClient(); - HttpResponseMessage response = httpClient.GetAsync("http://localhost:10666/health").Result; - Assert.IsTrue(response.IsSuccessStatusCode); - jsonString = response.Content.ReadAsStringAsync().Result; - } - - [Then("the server returns the expected fields")] - public void ThenTheServerReturnsTheExpectedFields() - { - HealthCheckObject healthcheckObject = JsonConvert.DeserializeObject(jsonString); - - Assert.IsTrue(healthcheckObject.Listening, "Expected the health check to report the server is listening."); - Assert.AreEqual(0, (world.GetServer(0).ServerInfo.StartTime - healthcheckObject.StartTime).TotalSeconds, 1, "Expected the health check start time to be within a second of the actual."); - -#pragma warning disable CS0618 // Testing obsolete functionality - Assert.AreEqual(world.GetServer(0).ServerInfo.Type, healthcheckObject.Type, "Expected the health check to report the correct DarkRift tier."); -#pragma warning restore CS0618 - Assert.AreEqual(world.GetServer(0).ServerInfo.Version, healthcheckObject.Version, "Expected the health check to report the correct DarkRift version."); - } - - private class HealthCheckObject - { - public bool Listening { get; set; } - public DateTime StartTime { get; set; } - public ServerType Type { get; set; } - public Version Version { get; set; } - } - } -} diff --git a/DarkRift.SystemTesting/MessageAssertions.cs b/DarkRift.SystemTesting/MessageAssertions.cs deleted file mode 100644 index 24a15b7..0000000 --- a/DarkRift.SystemTesting/MessageAssertions.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TechTalk.SpecFlow; - -namespace DarkRift.SystemTesting -{ - [Binding] - public class MessageAssertions - { - /// - /// The messages received by the server so far. - /// - private ConcurrentQueue messagesToServer; - - /// - /// The messages received by the clients so far. - /// - private ConcurrentQueue messagesToClients; - - /// - /// The messages expected to be received by the server. - /// - private ConcurrentBag expectedToServer; - - /// - /// The messages expected to be received by the clients. - /// - private ConcurrentBag expectedToClients; - - /// - /// Sets up the assertions. - /// - [BeforeScenario] - public void BeforeScenario() - { - messagesToServer = new ConcurrentQueue(); - messagesToClients = new ConcurrentQueue(); - - expectedToServer = new ConcurrentBag(); - expectedToClients = new ConcurrentBag(); - } - - /// - /// Adds a message expected to be received on the client. - /// - /// The message expected to be recieved. - public void ExpectMessageOnClient(ReceivedMessage message) - { - expectedToClients.Add(message); - } - - /// - /// Adds a message expected to be received on the server. - /// - /// The message expected to be recieved. - public void ExpectMessageOnServer(ReceivedMessage message) - { - expectedToServer.Add(message); - } - - /// - /// Adds a message received on the client. - /// - /// The message recieved. - public void AddMessageOnClient(ReceivedMessage message) - { - messagesToClients.Enqueue(message); - } - - /// - /// Adds a message received on the server. - /// - /// The message recieved. - public void AddMessageOnServer(ReceivedMessage message) - { - messagesToServer.Enqueue(message); - } - - /// - /// Asserts that all messages exected to be received from other steps have been received, and no more. - /// - [Then(@"all messages are accounted for")] - public void ThenAllMessagesAreAccountedFor() - { - WaitUtility.WaitUntil("Not all messages received by the server in the given time.", - () => Assert.AreEqual(0, expectedToServer.Except(messagesToServer).Count()), - TimeSpan.FromMinutes(1)); - WaitUtility.WaitUntil("Not all messages received by the clients in the given time.", - () => Assert.AreEqual(0, expectedToClients.Except(messagesToClients).Count()), - TimeSpan.FromMinutes(1)); - - Assert.AreEqual(0, messagesToServer.Except(expectedToServer).Count(), "Additional, unexpected messages received by the server."); - Assert.AreEqual(0, messagesToClients.Except(expectedToClients).Count(), "Additional, unexpected messages received by the clients."); - } - - /// - /// Waits for the specified client to have recieved the specified number of messages. - /// - /// The client to wait on. - /// The number of messages to wait for. - [When(@"client (\d+) has received (\d+) messages?")] - public void WhenTheClientHasReceivedMessages(ushort client, int numberOfMessages) - { - WaitUtility.WaitUntil($"Not enough messages were received on the client within the time limit. Expected at least <{numberOfMessages}> Actual <{messagesToClients.Where(m => m.Source == client).Count()}>", - () => messagesToClients.Where(m => m.Destination == client).Count() >= numberOfMessages); - } - - /// - /// Waits for the server to receive the given number of messages. - /// - /// The sever to wait on. - /// The number of messages to wait for. - [When(@"^server (\d+) has received (\d+) messages?$")] - public void WhenTheServerHasReceivedMessage(ushort server, int numberOfMessages) - { - WaitUtility.WaitUntil($"Not enough messages were received on the server within the time limit. Expected as least <{numberOfMessages}> Actual <{messagesToServer.Where(m => m.Destination == server).Count()}>", - () => messagesToServer.Where(m => m.Destination == server).Count() >= numberOfMessages); - } - } -} diff --git a/DarkRift.SystemTesting/Messaging.feature b/DarkRift.SystemTesting/Messaging.feature deleted file mode 100644 index 8af7b55..0000000 --- a/DarkRift.SystemTesting/Messaging.feature +++ /dev/null @@ -1,189 +0,0 @@ -Feature: Messaging - AS A game developer - I WANT to be able to send messages between server and client - SO THAT I can exchange game data - -Scenario Outline: I can send a message from client to server - Given I have a running server from Server.config - And 1 client connected - When client 0 sends 'Hello World' with tag 5 - And server 0 has received 1 message - Then all messages are accounted for - And there are no recycling issues - - Examples: - | mode | - | reliably | - | unreliably | - -Scenario Outline: I can send a message from server to client - Given I have a running server from Server.config - And 1 client connected - When server 0 sends 'Hello World' to client 0 with tag 6 - And client 0 has received 1 message - Then all messages are accounted for - And there are no recycling issues - - Examples: - | mode | - | reliably | - | unreliably | - -Scenario Outline: I can get ping the from the client - Given I have a running server from Server.config - And the server acknowledges ping messages after 55ms - And 1 client connected - When client 0 sends 'Hello World' with tag 5 as a ping - And server 0 has received 1 message - And client 0 has received 1 message - Then all messages are accounted for - And client 0 has a ping of around 50ms to the server - - Examples: - | mode | - | reliably | - | unreliably | - -Scenario Outline: I can get the ping from the server - Given I have a running server from Server.config - And 1 client connected - And client 0 acknowledges ping messages after 55ms - When server 0 sends 'Hello World' to client 0 with tag 6 as a ping - And client 0 has received 1 message - And server 0 has received 1 message - Then all messages are accounted for - And server 0 has a ping of around 50ms to client 0 - - Examples: - | mode | - | reliably | - | unreliably | - -Scenario Outline: I can stress test client to server - Given I have a running server from Server.config - And clients connected - When I stress test client to server with per client - Then all messages are accounted for - And there are no recycling issues - - Examples: - | clients | messages | - | 5 | 100 | - | 5 | 1000 | - | 5 | 10000 | - | 50 | 100 | - | 50 | 1000 | - | 50 | 10000 | - -Scenario Outline: I can stress test client to server with dispatcher enabled on server - Given I have a running server from Server.config - And server 0 is using the dispatcher - And clients connected - When I stress test client to server with per client - Then all messages are accounted for - And there are no recycling issues - - Examples: - | clients | messages | - | 5 | 100 | - | 5 | 1000 | - | 5 | 10000 | - | 50 | 100 | - | 50 | 1000 | - | 50 | 10000 | - -Scenario Outline: I can stress test server to client - Given I have a running server from Server.config - And clients connected - When I stress test server to client with per client - Then all messages are accounted for - And there are no recycling issues - - Examples: - | clients | messages | - | 5 | 100 | - | 5 | 1000 | - | 5 | 10000 | - | 50 | 100 | - | 50 | 1000 | - | 50 | 10000 | - -Scenario Outline: I can stress test server to client with dispatcher enabled on server - Given I have a running server from Server.config - And server 0 is using the dispatcher - And clients connected - When I stress test server to client with per client - Then all messages are accounted for - And there are no recycling issues - - Examples: - | clients | messages | - | 5 | 100 | - | 5 | 1000 | - | 5 | 10000 | - | 50 | 100 | - | 50 | 1000 | - | 50 | 10000 | - -Scenario Outline: I can stress test both - Given I have a running server from Server.config - And clients connected - When I stress test both with per client - Then all messages are accounted for - And there are no recycling issues - - Examples: - | clients | messages | - | 5 | 100 | - | 5 | 1000 | - | 5 | 10000 | - | 50 | 100 | - | 50 | 1000 | - | 50 | 10000 | - -Scenario Outline: I can stress test both with dispatcher enabled on server - Given I have a running server from Server.config - And server 0 is using the dispatcher - And clients connected - When I stress test both with per client - Then all messages are accounted for - And there are no recycling issues - - Examples: - | clients | messages | - | 5 | 100 | - | 5 | 1000 | - | 5 | 10000 | - | 50 | 100 | - | 50 | 1000 | - | 50 | 10000 | - -# TODO add stress test with client dispatchers enabled - -Scenario: Issue #75 messages being corrupted - Given I have a running server from Server.config - And server 0 is using the dispatcher - And 1 client connected - When I send 5000 messages reliably - Then all messages are accounted for - -Scenario: Partial TCP headers do not disconnect client - Given I have a running server from Server.config - And TCP and UDP sockets connected - And no delay is enabled - And the handshake has completed - When bytes are sent via TCP 0, 0 - Then the TCP socket is connected - When bytes are sent via TCP 0, 11 - Then the TCP socket is connected - # TODO DR3 sort the fact that strings are little endian while DR is big endian - When bytes are sent via TCP 0, 0, 0, 0, 0, 0, 4, 72, 0, 105, 0 - Then the TCP socket is connected - And I receive string on the server from TCP 'Hi' - And the TCP socket is connected - -Scenario: Clients can send messages as soon as they are connected - Given I have a running server from Server.config - And a delay of 100ms when a client connects before assigning message handlers - When a client connects and immediately sends a message - Then all messages are accounted for diff --git a/DarkRift.SystemTesting/MessagingSteps.cs b/DarkRift.SystemTesting/MessagingSteps.cs deleted file mode 100644 index 6f2a59a..0000000 --- a/DarkRift.SystemTesting/MessagingSteps.cs +++ /dev/null @@ -1,378 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Text.RegularExpressions; -using System.Threading; -using DarkRift.Client; -using DarkRift.Server; -using DarkRift.Server.Plugins.Listeners.Bichannel; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TechTalk.SpecFlow; - -namespace DarkRift.SystemTesting -{ - /// - /// Steps for basic message sending/receiveing. - /// - [Binding] - public class MessagingSteps - { - /// - /// The world to store state in. - /// - private readonly World world; - - /// - /// The delay the server should acknowledge ping messages after, or -1 if not. - /// - private int serverAcknowledgesPingsAfter = -1; - - /// - /// Class for asserting messages received. - /// - private readonly MessageAssertions messageAssertions; - - - /// - /// The performance related test steps. - /// - private readonly PerformanceSteps performanceSteps; - - public MessagingSteps(World world, MessageAssertions messageAssertions, PerformanceSteps performanceSteps) - { - this.world = world; - this.messageAssertions = messageAssertions; - this.performanceSteps = performanceSteps; - - world.ServerMessageReceived += ServerMessageReceived; - } - - private void ServerMessageReceived(object sender, Server.MessageReceivedEventArgs args) - { - // Make sure any ping messages get acknowledged - using Message message = args.GetMessage(); - if (serverAcknowledgesPingsAfter != -1 && message.IsPingMessage) - { - using Message acknowledgment = Message.CreateEmpty(message.Tag); - acknowledgment.MakePingAcknowledgementMessage(message); - - Thread.Sleep(serverAcknowledgesPingsAfter); - - bool success = args.Client.SendMessage(acknowledgment, args.SendMode); - Assert.IsTrue(success); - messageAssertions.ExpectMessageOnClient(new ReceivedMessage(null, ushort.MaxValue, args.Client.ID, message.Tag, args.SendMode)); - } - } - - /// - /// Sends a message from a client. - /// - /// The client to send from. - /// The message to send as a string. - /// The tag to send the message with. - [When(@"client (\d+) sends '([\w\s]+)' with tag (\d+) (reliably|unreliably)( as a ping)?")] - public void WhenClientSendsWithTag(ushort client, string str, ushort tag, string mode, string isPing) - { - SendMode sendMode = mode == "reliably" ? SendMode.Reliable : SendMode.Unreliable; - - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(str); - using Message message = Message.Create(tag, writer); - if (!string.IsNullOrEmpty(isPing)) - message.MakePingMessage(); - - bool success = this.world.GetClient(client).SendMessage(message, sendMode); - Assert.IsTrue(success); - } - - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(str, client, 0, tag, sendMode)); - } - - /// - /// Sends a message from a client with a specific length. - /// - /// The client to send from. - /// The number of characters to send. - /// The tag to send the message with. - [When(@"^client (\d+) sends (\d+) characters with tag (\d+) (reliably|unreliably)( as a ping)?$")] - public void WhenClientSendsBytesWithTag(ushort client, int length, ushort tag, string mode, string isPing) - { - SendMode sendMode = mode == "reliably" ? SendMode.Reliable : SendMode.Unreliable; - string str = new string('*', length); - - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(str); - using Message message = Message.Create(tag, writer); - if (!string.IsNullOrEmpty(isPing)) - message.MakePingMessage(); - - this.world.GetClient(client).SendMessage(message, sendMode); - } - - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(str, client, 0, tag, sendMode)); - } - - /// - /// Sends a message from the server to a client. - /// - /// The ID of the server to send from. - /// The string to send the client. - /// The client to send to. - /// The tag to send the message with. - /// The send mode to send the message via. - [When(@"server (\d+) sends '([\w\s]+)' to client (\d+) with tag (\d+) (reliably|unreliably)( as a ping)?")] - public void WhenTheServerSendsToClientWithTag(ushort serverID, string str, ushort client, ushort tag, string mode, string isPing) - { - SendMode sendMode = mode == "reliably" ? SendMode.Reliable : SendMode.Unreliable; - - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(str); - using Message message = Message.Create(tag, writer); - if (!string.IsNullOrEmpty(isPing)) - message.MakePingMessage(); - - bool success = this.world.GetServer(serverID).ClientManager[client].SendMessage(message, sendMode); - Assert.IsTrue(success); - } - - messageAssertions.ExpectMessageOnClient(new ReceivedMessage(str, ushort.MaxValue, client, tag, sendMode)); - } - - /// - /// Sends a message from a server to another server. - /// - /// The server to send from. - /// The message to send as a string. - /// The server to send to. - /// The group of the server to send to. //TODO We should be able to send without this? - /// The tag to send the message with. - [When(@"server (\d+) sends '([\w\s]+)' to server (\d+) in (.+) with tag (\d+) (reliably|unreliably)")] - public void WhenServerSendsToServerInWithTag(ushort server, string str, ushort remoteServer, string group, ushort tag, string mode) - { - SendMode sendMode = mode == "reliably" ? SendMode.Reliable : SendMode.Unreliable; - - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(str); - using Message message = Message.Create(tag, writer); - bool success = this.world.GetServer(server).RemoteServerManager.GetGroup(group).GetRemoteServer(remoteServer).SendMessage(message, sendMode); - Assert.IsTrue(success); - - } - - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(str, server, remoteServer, tag, sendMode)); - } - - /// - /// Instructs the server to send a ping acknowledgment for any ping messages received. - /// - [Given(@"the server acknowledges ping messages after ([0-9]+)ms")] - public void GivenTheServerAcknowledgesPingMessages(int delay) - { - serverAcknowledgesPingsAfter = delay; - } - - /// - /// Instructs the specified client to send a ping acknowledgment for any ping messages received. - /// - /// The client to setup for. - [Given(@"client ([0-9]+) acknowledges ping messages after ([0-9]+)ms")] - public void GivenClientAcknowledgesPingMessages(ushort client, int delay) - { - world.GetClient(client).MessageReceived += (sender, args) => - { - using Message message = args.GetMessage(); - if (message.IsPingMessage) - { - using Message acknowledgment = message.Clone(); - acknowledgment.MakePingAcknowledgementMessage(message); - - Thread.Sleep(delay); - - string str; - using (DarkRiftReader reader = message.GetReader()) - str = reader.ReadString(); - - bool success = ((DarkRiftClient)sender).SendMessage(acknowledgment, args.SendMode); - Assert.IsTrue(success); - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(str, 0, client, message.Tag, args.SendMode)); - } - }; - } - - /// - /// Checks that the server has a correct ping to the specified client. - /// - /// The server to query. - /// The expected ping. - /// The client to check against. - [Then(@"server (\d+) has a ping of around ([0-9]+)ms to client ([0-9]+)")] - public void ThenServerHasAPingOfAroundToClient(ushort serverID, float expectedPing, ushort client) - { - float actualPing = world.GetServer(serverID).ClientManager.GetClient(client).RoundTripTime.LatestRtt * 1000; - float delta = expectedPing / 2; - - Assert.AreEqual(expectedPing, actualPing, delta, $"Expected a ping of {expectedPing}ms +/- {delta}ms but was actually {Math.Round(actualPing)}ms."); - } - - /// - /// Checks that the given client has a correct ping to the server. - /// - /// The expected ping. - /// The client to query. - [Then(@"client ([0-9]+) has a ping of around ([0-9]+)ms to the server")] - public void ThenClientHasAPingOfAroundToTheServer(ushort client, float expectedPing) - { - float actualPing = world.GetClient(client).RoundTripTime.LatestRtt * 1000; - float delta = expectedPing / 2; - - Assert.AreEqual(expectedPing, actualPing, delta, $"Expected a ping of {expectedPing}ms +/- {delta}ms but was actually {Math.Round(actualPing)}ms."); - } - - /// - /// Sends a number of random messages from both server and client all simultaniously. - /// - /// The number of messages to send. - [When(@"I stress test (server to client|client to server|both) with (\d+) per client")] - public void WhenIStressTestWithPerClient(string direction, int count) - { - List threads = new List(); - - // Send from clients - if (direction == "client to server" || direction == "both") - { - foreach (DarkRiftClient client in world.GetClients()) - { - threads.Add(new Thread(() => - { - Random random = new Random(); - - for (int i = 0; i < count; i++) - { - string value = random.NextDouble().ToString(); - ushort tag = (ushort)random.Next(65536); - //SendMode sendMode = random.Next(2) == 0 ? SendMode.Reliable : SendMode.Unreliable; - SendMode sendMode = SendMode.Reliable; //TODO test unreliable but with less data - - using DarkRiftWriter writer = DarkRiftWriter.Create(); - writer.Write(value); - - using Message message = Message.Create(tag, writer); - bool success = client.SendMessage(message, sendMode); - Assert.IsTrue(success); - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(value, client.ID, 0, tag, sendMode)); - } - })); - } - } - - // Send from server - if (direction == "server to client" || direction == "both") - { - foreach (IClient client in world.GetServer(0).ClientManager.GetAllClients()) - { - threads.Add(new Thread(() => - { - Random random = new Random(); - - for (int i = 0; i < count; i++) - { - string value = random.NextDouble().ToString(); - ushort tag = (ushort)random.Next(65536); - //SendMode sendMode = random.Next(2) == 0 ? SendMode.Reliable : SendMode.Unreliable; - SendMode sendMode = SendMode.Reliable; //TODO test unreliable but with less data - - using DarkRiftWriter writer = DarkRiftWriter.Create(); - writer.Write(value); - - using Message message = Message.Create(tag, writer); - bool success = client.SendMessage(message, sendMode); - Assert.IsTrue(success); - messageAssertions.ExpectMessageOnClient(new ReceivedMessage(value, ushort.MaxValue, client.ID, tag, sendMode)); - } - })); - } - } - - // Start all the threads - foreach (Thread thread in threads) - thread.Start(); - - // Join all the threads - foreach (Thread thread in threads) - thread.Join(); - } - - /// - /// Sends lots of reliable data in reproduction of issue #75. - /// - [When(@"I send (\d+) messages reliably")] - public void WhenISendMessagesReliably(int noMessages) - { - for (int i = 0; i < noMessages; i++) - { - using DarkRiftWriter writer = DarkRiftWriter.Create(); - ushort tag = (ushort)i; - string value = i.ToString(); - for (int j = 0; j < 30; j++) - writer.Write(value); - - using Message message = Message.Create(tag, writer); - bool success = world.GetClient(0).SendMessage(message, SendMode.Reliable); - Assert.IsTrue(success); - - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(value, 0, 0, tag, SendMode.Reliable)); - } - } - - /// - /// Connects client to the server and instantly sends a message. - /// - /// The number of clients to connect. - [When(@"a client connects and immediately sends a message")] - public void WhenAClientConnectsAndImmedtiatelySendsAMessages() - { - DarkRiftClient client = new DarkRiftClient(); - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write("Hello"); - using Message message = Message.Create(0, writer); - - client.Connect( - new BichannelClientConnection( - IPAddress.Loopback, - world.GetServer(0).ClientManager.Port, - world.GetServer(0).NetworkListenerManager.GetNetworkListenersByType()[0].UdpPort, - true - ) - ); - - bool success = client.SendMessage(message, SendMode.Reliable); - Assert.IsTrue(success); - } - - - world.AddClient(client); - -#if DEBUG - // We've just requested a load of objects that wont be returned until we close - // UDP receive TCP receive in client; TCP receive in server - performanceSteps.ExpectedUnaccountedForSocketAsyncEventArgs += 3; -#endif - - messageAssertions.ExpectMessageOnServer(new ReceivedMessage("Hello", client.ID, 0, 0, SendMode.Reliable)); - } - } -} diff --git a/DarkRift.SystemTesting/Metrics.feature b/DarkRift.SystemTesting/Metrics.feature deleted file mode 100644 index f8bbe82..0000000 --- a/DarkRift.SystemTesting/Metrics.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: Metric - AS AN OPS team - I WANT to monitor DarkRift and our game through industry standard tools - SO THAT I have visibility into our servers alongside our existing infrastructure - -Scenario: I can query the server's Prometheus endpoint - Given I have a running server from ServerWithPrometheusEndpoint.config - # TODO connect a client here to get additional metrics - When I query the Prometheus endpoint - Then the server returns the metrics in ExpectedPrometheusMetrics.txt - -Scenario: I can start and stop multiple servers with Prometheus endpoints - Given I have a running server from ServerWithPrometheusEndpoint.config - When I close and forget server 0 - Then I can start a new server from ServerWithPrometheusEndpoint.config - -# TODO Add a test that Prometheus exports are Culture independent #106 - -Scenario: I can query the server's Prometheus endpoint for the correct client count - Given I have a running server from ServerWithPrometheusEndpoint.config - - When I query the Prometheus endpoint - Then the metric 'darkrift_client_manager_clients_connected' has value 0 - - Given 1 client connected - Then server 0 should have 1 client - - When I query the Prometheus endpoint - Then the metric 'darkrift_client_manager_clients_connected' has value 1 - - When I disconnect client 0 - Then server 0 should have 0 clients - When I query the Prometheus endpoint - Then the metric 'darkrift_client_manager_clients_connected' has value 0 diff --git a/DarkRift.SystemTesting/PartialMessagingSteps.cs b/DarkRift.SystemTesting/PartialMessagingSteps.cs deleted file mode 100644 index e7a6251..0000000 --- a/DarkRift.SystemTesting/PartialMessagingSteps.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using DarkRift.Server.Plugins.Listeners.Bichannel; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using TechTalk.SpecFlow; - -namespace DarkRift.SystemTesting -{ - /// - /// Steps for sending partial messages and gettting finer control. - /// - [Binding] - public class PartialMessagingSteps - { - /// - /// The TCP socket. - /// - private Socket tcpSocket; - - /// - /// The UDP socket. - /// - private Socket udpSocket; - - /// - /// The world to store state in. - /// - private readonly World world; - - /// - /// Way of asserting messages. - /// - private readonly MessageAssertions messageAssertions; - - public PartialMessagingSteps(World world, MessageAssertions messageAssertions) - { - this.world = world; - this.messageAssertions = messageAssertions; - } - - /// - /// Connects raw socket to the server. - /// - [Given(@"TCP and UDP sockets connected")] - public void GivenTCPSocketConnected() - { - tcpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - tcpSocket.Connect(new IPEndPoint(IPAddress.Loopback, world.GetServer(0).ClientManager.Port)); - - udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - udpSocket.Bind(new IPEndPoint(((IPEndPoint)tcpSocket.LocalEndPoint).Address, 0)); - udpSocket.Connect(new IPEndPoint(IPAddress.Loopback, world.GetServer(0).NetworkListenerManager.GetNetworkListenersByType()[0].UdpPort)); - } - - /// - /// Completes the DR bichannel handshake down this socket. - /// - [Given(@"the handshake has completed")] - public void GivenTheHandshakeHasCompeleted() - { - // Receive token - byte[] tcpBuffer = new byte[9]; - int receivedTcp = tcpSocket.Receive(tcpBuffer); - - Assert.AreEqual(9, receivedTcp); - Assert.AreEqual(0, tcpBuffer[0]); - - // Return token - udpSocket.Send(tcpBuffer); - - // Receive punchthrough - byte[] udpBuffer = new byte[8]; - int receivedUdp = udpSocket.Receive(udpBuffer); - - Assert.AreEqual(8, receivedUdp); - for (int i = 0; i < 8; ++i) - Assert.AreEqual(tcpBuffer[i + 1], udpBuffer[i], $"Token byte {i} mismatch"); - - // Stupid race condition to attach the MessageReceived handler - System.Threading.Thread.Sleep(100); - } - - /// - /// Enables NoDelay on the TCP socket. - /// - [Given(@"no delay is enabled")] - public void GivenNoDelayIsEnabled() - { - tcpSocket.NoDelay = true; - } - - /// - /// Sends bytes down the TCP socket. - /// - [When(@"bytes are sent via TCP (.+)")] - public void WhenBytesAreSentViaTcp(string byteLine) - { - tcpSocket.Send(byteLine.Split(", ").Select(b => byte.Parse(b)).ToArray()); - } - - /// - /// Checks the TCP socket is connected. - /// - [Then(@"the TCP socket is connected")] - public void ThenTheTcpSocketIsConnected() - { - Assert.IsTrue(tcpSocket.Connected); - } - - /// - /// Checks string received in a message on the server. - /// - [Then(@"I receive string on the server from TCP '(.+)'")] - public void ThenIReceiveStringOnTheServerFromTCP(string text) - { - messageAssertions.ExpectMessageOnServer(new ReceivedMessage(text, 0, 0, 0, SendMode.Reliable)); - messageAssertions.ThenAllMessagesAreAccountedFor(); - } - } -} diff --git a/DarkRift.SystemTesting/PerformanceSteps.cs b/DarkRift.SystemTesting/PerformanceSteps.cs deleted file mode 100644 index 08156be..0000000 --- a/DarkRift.SystemTesting/PerformanceSteps.cs +++ /dev/null @@ -1,203 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using System.Threading; -using DarkRift.Client; -using DarkRift.Server; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TechTalk.SpecFlow; - -namespace DarkRift.SystemTesting -{ - [Binding] - public class PerformanceSteps - { - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForAutoRecyclingArrays { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForDarkRiftReaders { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForDarkRiftWriters { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForMessages { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForMessageBuffers { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForSocketAsyncEventArgs { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForActionDispatcherTasks { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForServerMessageReceviedEventArgs { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForServerServerMessageReceviedEventArgs { get; set; } = 0; - - /// - /// The number of objects that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForClientMessageReceviedEventArgs { get; set; } = 0; - - /// - /// The number of memory segments that are allowed to be unaccounted for. - /// - public int ExpectedUnaccountedForMemory { get; set; } = 0; - - [BeforeScenario] - public void BeforeScenario() - { -#if DEBUG - // Ensure recycling issues are not carried over - ObjectCacheTestHelper.ResetCounters(); - ServerObjectCacheTestHelper.ResetCounters(); - ClientObjectCacheTestHelper.ResetCounters(); - - ObjectCacheHelper.ResetCounters(); - ServerObjectCacheHelper.ResetCounters(); - ClientObjectCacheHelper.ResetCounters(); - - ExpectedUnaccountedForAutoRecyclingArrays = 0; - ExpectedUnaccountedForDarkRiftReaders = 0; - ExpectedUnaccountedForDarkRiftWriters = 0; - ExpectedUnaccountedForMessages = 0; - ExpectedUnaccountedForMessageBuffers = 0; - ExpectedUnaccountedForSocketAsyncEventArgs = 0; - ExpectedUnaccountedForActionDispatcherTasks = 0; - ExpectedUnaccountedForServerMessageReceviedEventArgs = 0; - ExpectedUnaccountedForServerServerMessageReceviedEventArgs = 0; - ExpectedUnaccountedForClientMessageReceviedEventArgs = 0; - ExpectedUnaccountedForMemory = 0; -#endif - } - - /// - /// Make sure there are no recycling issues. - /// - [Then(@"there are no recycling issues")] - public void ThenThereAreNoRecyclingWarnings() - { - AssertNoRecyclingIssues(); - AssertNoFinalizations(); - } - - /// - /// Asserts that all objects that were allowedUnaccountedFor from the were returned. - /// - private void AssertNoRecyclingIssues() - { -#if DEBUG - WaitUtility.WaitUntil("Objects unacounted for.", () => { - //Check each metric - int readers = ObjectCacheTestHelper.RetrievedDarkRiftReaders - ObjectCacheTestHelper.ReturnedDarkRiftReaders; - if (readers != ExpectedUnaccountedForDarkRiftReaders) - Assert.Fail(readers + " DarkRiftReader objects are unaccounted for. Expected only " + ExpectedUnaccountedForDarkRiftReaders + "."); - - int writers = ObjectCacheTestHelper.ReturnedDarkRiftWriters - ObjectCacheTestHelper.ReturnedDarkRiftWriters; - if (writers != ExpectedUnaccountedForDarkRiftWriters) - Assert.Fail(writers + " DarkRiftWriter objects are unaccounted for. Expected only " + ExpectedUnaccountedForDarkRiftWriters + "."); - - int messages = ObjectCacheTestHelper.ReturnedMessages - ObjectCacheTestHelper.ReturnedMessages; - if (messages != ExpectedUnaccountedForMessages) - Assert.Fail(messages + " Message objects are unaccounted for. Expected only " + ExpectedUnaccountedForMessages + "."); - - int messageBuffers = ObjectCacheTestHelper.ReturnedMessageBuffers - ObjectCacheTestHelper.ReturnedMessageBuffers; - if (messageBuffers != ExpectedUnaccountedForMessageBuffers) - Assert.Fail(messageBuffers + " MessageBuffer objects are unaccounted for. Expected only " + ExpectedUnaccountedForMessageBuffers + "."); - - int actionDispatcherTasks = ObjectCacheTestHelper.ReturnedActionDispatcherTasks - ObjectCacheTestHelper.ReturnedActionDispatcherTasks; - if (actionDispatcherTasks != ExpectedUnaccountedForActionDispatcherTasks) - Assert.Fail(actionDispatcherTasks + " ActionDispatcherTask objects are unaccounted for. Expected only " + ExpectedUnaccountedForActionDispatcherTasks + "."); - - int autoRecyclingArrays = ObjectCacheTestHelper.ReturnedAutoRecyclingArrays - ObjectCacheTestHelper.ReturnedAutoRecyclingArrays; - if (autoRecyclingArrays != ExpectedUnaccountedForAutoRecyclingArrays) - Assert.Fail(autoRecyclingArrays + " AutoRecyclingArray objects are unaccounted for. Expected only " + ExpectedUnaccountedForAutoRecyclingArrays + "."); - - int socketAsyncEventArgs = ObjectCacheTestHelper.RetrievedSocketAsyncEventArgs - ObjectCacheTestHelper.ReturnedSocketAsyncEventArgs; - if (socketAsyncEventArgs != ExpectedUnaccountedForSocketAsyncEventArgs) - Assert.Fail(socketAsyncEventArgs + " SocketAsyncEventArgs objects are unaccounted for. Expected only " + ExpectedUnaccountedForSocketAsyncEventArgs + "."); - - int serverMessageReceivedEventArgs = ServerObjectCacheTestHelper.RetrievedMessageReceivedEventArgs - ServerObjectCacheTestHelper.ReturnedMessageReceivedEventArgs; - if (serverMessageReceivedEventArgs != ExpectedUnaccountedForServerMessageReceviedEventArgs) - Assert.Fail(serverMessageReceivedEventArgs + " MessageReceivedEventArgs (server) objects are unaccounted for. Expected only " + ExpectedUnaccountedForServerMessageReceviedEventArgs + "."); - - int serverServerMessageReceivedEventArgs = ServerObjectCacheTestHelper.RetrievedServerMessageReceivedEventArgs - ServerObjectCacheTestHelper.ReturnedServerMessageReceivedEventArgs; - if (serverServerMessageReceivedEventArgs != ExpectedUnaccountedForServerMessageReceviedEventArgs) - Assert.Fail(serverServerMessageReceivedEventArgs + " ServerMessageReceivedEventArgs (server) objects are unaccounted for. Expected only " + ExpectedUnaccountedForServerServerMessageReceviedEventArgs + "."); - - int clientMessageReceivedEventArgs = ClientObjectCacheTestHelper.RetrievedMessageReceivedEventArgs - ClientObjectCacheTestHelper.ReturnedMessageReceivedEventArgs; - if (clientMessageReceivedEventArgs != ExpectedUnaccountedForClientMessageReceviedEventArgs) - Assert.Fail(clientMessageReceivedEventArgs + " MessageReceivedEventArgs (client) objects are unaccounted for. Expected only " + ExpectedUnaccountedForClientMessageReceviedEventArgs + "."); - - int memory = ObjectCacheTestHelper.ReturnedMemory - ObjectCacheTestHelper.ReturnedMemory; - if (memory != ExpectedUnaccountedForMemory) - Assert.Fail(memory + " memory segments are unaccounted for. Expected only " + ExpectedUnaccountedForMemory + "."); - }); -#endif - } - - /// - /// Asserts that no finalizations on recyclable objects occurred. - /// - private void AssertNoFinalizations() - { - // Now everything's disposed we can assert that all objects are accounted for - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); - GC.WaitForPendingFinalizers(); - - if (ObjectCacheHelper.FinalizedDarkRiftReaders > 0) - Assert.Fail(ObjectCacheHelper.FinalizedDarkRiftReaders + " DarkRiftReader objects were finalized last period."); - - if (ObjectCacheHelper.FinalizedDarkRiftWriters > 0) - Assert.Fail(ObjectCacheHelper.FinalizedDarkRiftWriters + " DarkRiftWriter objects were finalized last period."); - - if (ObjectCacheHelper.FinalizedMessages > 0) - Assert.Fail(ObjectCacheHelper.FinalizedMessages + " Message objects were finalized last period."); - - if (ObjectCacheHelper.FinalizedMessageBuffers > 0) - Assert.Fail(ObjectCacheHelper.FinalizedMessageBuffers + " MessageBuffer objects were finalized last period."); - - if (ObjectCacheHelper.FinalizedAutoRecyclingArrays > 0) - Assert.Fail(ObjectCacheHelper.FinalizedAutoRecyclingArrays + " AutoRecyclingArray objects were finalized last period."); - - if (ServerObjectCacheHelper.FinalizedMessageReceivedEventArgs > 0) - Assert.Fail(ServerObjectCacheHelper.FinalizedMessageReceivedEventArgs + " MessageReceivedEventArgs (server) objects were finalized last period."); - - if (ServerObjectCacheHelper.FinalizedServerMessageReceivedEventArgs > 0) - Assert.Fail(ServerObjectCacheHelper.FinalizedServerMessageReceivedEventArgs + " ServeMessageReceivedEventArgs (server) objects were finalized last period."); - - if (ClientObjectCacheHelper.FinalizedMessageReceivedEventArgs > 0) - Assert.Fail(ClientObjectCacheHelper.FinalizedMessageReceivedEventArgs + " MessageReceivedEventArgs (client) objects were finalized last period."); - } - } -} diff --git a/DarkRift.SystemTesting/Plugins/InMemoryServerRegistryConnector.cs b/DarkRift.SystemTesting/Plugins/InMemoryServerRegistryConnector.cs deleted file mode 100644 index 3a093f2..0000000 --- a/DarkRift.SystemTesting/Plugins/InMemoryServerRegistryConnector.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using DarkRift.Server; -using Timer = DarkRift.Server.Timer; - -namespace DarkRift.SystemTesting.Plugins -{ - /// - /// Simple server registry that operates in static memory. - /// - internal class InMemoryServerRegistryConnector : ServerRegistryConnector - { - public override bool ThreadSafe => true; - - public override Version Version => new Version(1, 0, 0); - - /// - /// The lookup of servers in the registry. - /// - private static readonly ConcurrentDictionary registry = new ConcurrentDictionary(); - - /// - /// The last ID allocated. - /// - private static int lastId = -1; - - /// - /// The timer this plugin is polling with. - /// - private readonly Timer timer; - - public InMemoryServerRegistryConnector(ServerRegistryConnectorLoadData serverRegistryConnectorLoadData) : base(serverRegistryConnectorLoadData) - { - timer = CreateTimer(1000, 1000, FetchServices); - } - - private void FetchServices(Timer obj) - { - var knownServices = RemoteServerManager.GetAllGroups().SelectMany(g => g.GetAllRemoteServers()).Select(s => s.ID); - var joined = registry.Keys.Except(knownServices); - var left = knownServices.Except(registry.Keys); - - foreach (ushort joinedID in joined) - { - if (joinedID != RemoteServerManager.ServerID) - { - RegistryEntry service = registry[joinedID]; - string group = service.Group; - - Logger.Trace($"Discovered server {joinedID} from group '{group}'."); - - HandleServerJoin(joinedID, group, service.Host, service.Port, new Dictionary(service.Properties)); - } - } - - //TODO consider just a set method instead of/as well as join/leave - foreach (ushort leftID in left) - { - if (leftID != RemoteServerManager.ServerID) - { - Logger.Trace($"Server {leftID} has left the cluster."); - - HandleServerLeave(leftID); - } - } - } - - protected override void DeregisterServer() - { - bool success = registry.TryRemove(RemoteServerManager.ServerID, out _); - if (!success) - throw new InvalidOperationException("Failed to add an entry into the server registry as the ID already existed."); - } - - protected override ushort RegisterServer(string group, string host, ushort port, IDictionary properties) - { - ushort id = (ushort)Interlocked.Increment(ref lastId); - - bool success = registry.TryAdd(id, new RegistryEntry(group, host, port, properties)); - if (!success) - throw new InvalidOperationException("Failed to remove entry in the server registry as the ID does not exist."); - - return id; - } - - /// - /// Resets the registry back to its original state ready for the next test. - /// - public static void Reset() - { - registry.Clear(); - Interlocked.Exchange(ref lastId, -1); - } - - /// - /// An entry in the server registry. - /// - private class RegistryEntry - { - public string Group { get; } - public string Host { get; } - public ushort Port { get; } - public IReadOnlyDictionary Properties { get; } - - public RegistryEntry(string group, string address, ushort port, IDictionary properties) - { - this.Group = group; - this.Host = address; - this.Port = port; - this.Properties = new Dictionary(properties); - } - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - timer.Dispose(); - } - } -} diff --git a/DarkRift.SystemTesting/PrometheusSteps.cs b/DarkRift.SystemTesting/PrometheusSteps.cs deleted file mode 100644 index 3e073d2..0000000 --- a/DarkRift.SystemTesting/PrometheusSteps.cs +++ /dev/null @@ -1,88 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using System; -using System.IO; -using System.Net; -using System.Net.Http; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using TechTalk.SpecFlow; -using static DarkRift.Server.DarkRiftInfo; - -namespace DarkRift.SystemTesting -{ - /// - /// Steps for testing the server's health check - /// - [Binding] - internal class PrometheusSteps - { - /// - /// The world to store state in. - /// - private readonly World world; - - /// - /// The downloaded Prometheus metric data. - /// - private string prometheusString; - - public PrometheusSteps(World world) - { - this.world = world; - } - - [When("I query the Prometheus endpoint")] - public void WhenIQueryThePrometheusEndpoint() - { - using HttpClient httpClient = new HttpClient(); - HttpResponseMessage response = httpClient.GetAsync("http://localhost:9796/metrics").Result; - Assert.IsTrue(response.IsSuccessStatusCode); - prometheusString = response.Content.ReadAsStringAsync().Result; - } - - [Then("the server returns the metrics in (.*)")] - public void ThenTheServerReturnsTheExpectedMetrics(string expectedMetricsFile) - { - // Assert line by line for better debugging - string[] expectedLines = File.ReadAllLines(expectedMetricsFile); - string[] actualLines = prometheusString.Split('\n'); - - Assert.AreEqual(expectedLines.Length, actualLines.Length); - for (int i = 0; i < expectedLines.Length; i++) - Assert.AreEqual(expectedLines[i], actualLines[i], $"Expected line {i + 1} to match."); - } - - [Then("the metric '(.*)' has value (.*)")] - public void ThenTheMetricHasValue(string metricName, string value) - { - // Assert line by line for better debugging - string[] lines = prometheusString.Split('\n'); - bool found = false; - foreach (string line in lines) - { - if (line.StartsWith("#") || string.IsNullOrWhiteSpace(line)) - continue; - - string[] parts = line.Split(' '); - Assert.AreEqual(2, parts.Length, $"Metric line '{line}' is invalid."); - if (parts[0] == metricName) - { - if (!found) - Assert.AreEqual(value, parts[1], $"Value for metric '{metricName}' was unexpected."); - else - Assert.Fail($"Duplicate metric '{metricName}' found."); - - found = true; - } - } - - if (!found) - Assert.Fail($"Metric '{metricName}' was not found."); - } - } -} diff --git a/DarkRift.SystemTesting/ReceivedMessage.cs b/DarkRift.SystemTesting/ReceivedMessage.cs deleted file mode 100644 index 0d9a866..0000000 --- a/DarkRift.SystemTesting/ReceivedMessage.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -namespace DarkRift.SystemTesting -{ - /// - /// Holder for messages. - /// - public struct ReceivedMessage - { - public string Message { get; set; } - public ushort Source { get; set; } - public ushort Destination { get; set; } - public ushort Tag { get; set; } - public SendMode SendMode { get; set; } - - public ReceivedMessage(string message, ushort source, ushort destination, ushort tag, SendMode sendMode) - { - this.Message = message; - this.Source = source; - this.Destination = destination; - this.Tag = tag; - this.SendMode = sendMode; - } - } -} diff --git a/DarkRift.SystemTesting/ReliableOrderTest.cs b/DarkRift.SystemTesting/ReliableOrderTest.cs deleted file mode 100644 index d424344..0000000 --- a/DarkRift.SystemTesting/ReliableOrderTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Linq; -using System.Net; -using System.Threading; -using System.Xml.Schema; -using DarkRift.Client; -using DarkRift.Server; -using DarkRift.Server.Plugins.Listeners.Bichannel; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DarkRift.SystemTesting -{ - [TestClass] - public class ReliableOrderTest - { - [TestMethod] - public void SendBunchOfMessagesAndExpectOrderedArrivalAtClient() - { - void SetupReceiver(DarkRiftClient client, DarkRiftServer server, Action handler) - { - void MessageReceived(object sender, Client.MessageReceivedEventArgs e) - { - using var message = e.GetMessage(); - handler(message); - } - - client.MessageReceived += MessageReceived; - } - - void Send(DarkRiftClient client, DarkRiftServer server, Message message) - { - server.ClientManager.GetAllClients()[0].SendMessage(message, SendMode.Reliable); - } - - SendBunchOfMessagesAndExpectOrderedArrival(SetupReceiver, Send); - } - - [TestMethod] - public void SendBunchOfMessagesAndExpectOrderedArrivalAtServer() - { - void SetupReceiver(DarkRiftClient client, DarkRiftServer server, Action handler) - { - void ClientConnected(object sender, ClientConnectedEventArgs e) - { - void MessageReceived(object sender, Server.MessageReceivedEventArgs e) - { - using var message = e.GetMessage(); - handler(message); - } - - e.Client.MessageReceived += MessageReceived; - } - - server.ClientManager.ClientConnected += ClientConnected; - } - - void Send(DarkRiftClient client, DarkRiftServer server, Message message) - { - client.SendMessage(message, SendMode.Reliable); - } - - SendBunchOfMessagesAndExpectOrderedArrival(SetupReceiver, Send); - } - - private void SendBunchOfMessagesAndExpectOrderedArrival(Action> setupReceiver, Action send) - { - var spawnData = ServerSpawnData.CreateFromXml("Configurations/Server/Server.config", new NameValueCollection()); - spawnData.EventsFromDispatcher = false; - - using var client = new DarkRiftClient(); - using var server = new DarkRiftServer(spawnData); - - const int NoDiff = -1; - - int receiveCount = 0; - int sendCount = 0; - int diffAt = NoDiff; - - void MessageReceived(Message message) - { - using var reader = message.GetReader(); - - int receivedNumber = reader.ReadInt32(); - int expectedReceive = receiveCount; - - if (expectedReceive != receivedNumber && diffAt == NoDiff) - { - //can't do asserts on other thread so defer to main thread - diffAt = expectedReceive; - } - - Interlocked.Increment(ref receiveCount); - } - - setupReceiver(client, server, MessageReceived); - - server.StartServer(); - var listener = (AbstractBichannelListener)server.NetworkListenerManager.GetAllNetworkListeners().First(); - int port = listener.Port; - int udpPort = listener.UdpPort; - client.Connect(IPAddress.Parse("127.0.0.1"), port, udpPort, true); - - Assert.AreEqual(ConnectionState.Connected, client.ConnectionState); - Assert.AreEqual(1, server.ClientManager.Count); - - for (int i = 0; i < 100000; ++i) - { - using var writer = DarkRiftWriter.Create(40); - - writer.Write(sendCount); - Interlocked.Increment(ref sendCount); - - using var message = Message.Create(0, writer); - - send(client, server, message); - } - - Thread.Sleep(2000); //give receiver time to catch up - - Assert.AreEqual(sendCount, receiveCount, "Not all messages sent!"); - Assert.AreEqual(NoDiff, diffAt, "Received in different order"); - } - } -} diff --git a/DarkRift.SystemTesting/Security.feature b/DarkRift.SystemTesting/Security.feature deleted file mode 100644 index 88c88e1..0000000 --- a/DarkRift.SystemTesting/Security.feature +++ /dev/null @@ -1,11 +0,0 @@ -Feature: Security - AS A game developer - I WANT no exploitable vulnerablities in my server - SO THAT users cannot cuase danage to my server - -Scenario: large TCP body buffer allocations cause clients to be kicked - Given I have a running server from Server.config - And 1 client connected - When client 0 sends 70000 characters with tag 6 reliably - Then server 0 should have 0 clients - # TODO verify strike event was called diff --git a/DarkRift.SystemTesting/WaitUtility.cs b/DarkRift.SystemTesting/WaitUtility.cs deleted file mode 100644 index d770c85..0000000 --- a/DarkRift.SystemTesting/WaitUtility.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace DarkRift.SystemTesting -{ - internal static class WaitUtility - { - /// - /// Waits until the given predicate returns true, failing if it does not return true within 10 seconds. - /// - /// The failure message to assert. - /// The predicate to wait for. - internal static void WaitUntil(string message, Func predicate) - { - WaitUntil(message, predicate, TimeSpan.FromSeconds(10)); - } - - /// - /// Waits until the given predicate returns true, failing if it does not return true within the timeout. - /// - /// The failure message to assert. - /// The predicate to wait for. - /// The maximum time to wait. - internal static void WaitUntil(string message, Func predicate, TimeSpan timeout) - { - DateTime failAt = DateTime.Now.Add(timeout); - do - { - if (predicate.Invoke()) - return; - - Thread.Sleep(100); - } - while (DateTime.Now < failAt); - - Assert.Fail(message); - } - - /// - /// Waits until the given assertion passes, failing if it does not pass within 10 seconds. - /// - /// The failure message to assert. - /// The assertion function to wait for. - internal static void WaitUntil(string message, Action assertion) - { - WaitUntil(message, assertion, TimeSpan.FromSeconds(10)); - } - - /// - /// Waits until the given assertion passes, failing if it does not pass within the timeout. - /// - /// The failure message to assert. - /// The assertion function to wait for. - /// The maximum time to wait. - internal static void WaitUntil(string message, Action assertion, TimeSpan timeout) - { - DateTime failAt = DateTime.Now.Add(timeout); - Exception lastException = null; - do - { - try - { - assertion.Invoke(); - return; - } - catch (AssertFailedException e) - { - lastException = e; - } - - Thread.Sleep(100); - } - while (DateTime.Now < failAt); - - Assert.Fail(message + "\nLast failure was:\n" + lastException); - } - - /// - /// Waits until an element is dequeued from a queue, failing if it does not return a value within 10 seconds. - /// - /// The type of element to dequeue. - /// The queue to dequeue from. - /// The failure message to assert. - /// The element dequeued. - internal static T DequeueFrom(ConcurrentQueue queue, string message) - { - return DequeueFrom(queue, message, TimeSpan.FromSeconds(10)); - } - - /// - /// Waits until an element is dequeued from a queue, failing if it does not return a value within the timeout. - /// - /// The type of element to dequeue. - /// The queue to dequeue from. - /// The failure message to assert. - /// The maximum time to wait. - /// The element dequeued. - internal static T DequeueFrom(ConcurrentQueue queue, string message, TimeSpan timeout) - { - T result = default; - - WaitUntil(message, () => queue.TryDequeue(out result), timeout); - - return result; - } - } -} diff --git a/DarkRift.SystemTesting/World.cs b/DarkRift.SystemTesting/World.cs deleted file mode 100644 index d4a3418..0000000 --- a/DarkRift.SystemTesting/World.cs +++ /dev/null @@ -1,320 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -using DarkRift.Client; -using DarkRift.Server; -using DarkRift.SystemTesting.Plugins; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using TechTalk.SpecFlow; - -namespace DarkRift.SystemTesting -{ - /// - /// General place to hold test data. - /// - [Binding] - public class World - { - /// - /// Event fired whenever the server receives a message. - /// - public event EventHandler ServerMessageReceived; - - /// - /// Event fired whenever a server connects to another. - /// - public event EventHandler ServerJoined; - - /// - /// Event fired whenever a server disconnects from another. - /// - public event EventHandler ServerLeft; - - /// - /// The number of times the ServerConnected event has been fired. - /// - public int ServerConnectedEvents => Volatile.Read(ref serverConnectedEvents); - private int serverConnectedEvents; - - /// - /// The number of times the ServerDisconnected event has been fired. - /// - public int ServerDisconnectedEvents => Volatile.Read(ref serverDisconnectedEvents); - private int serverDisconnectedEvents; - - /// - /// The delay between a client connecting and message handlers being assigned on the server. - /// - public int ClientConnectionDelay { get; internal set; } - - /// - /// The servers in use. - /// - private readonly Dictionary servers = new Dictionary(); - - /// - /// The clients in use. - /// - private readonly Dictionary clients = new Dictionary(); - - /// - /// Class for asserting messages received. - /// - private readonly MessageAssertions messageAssertions; - - public World(MessageAssertions messageAssertions) - { - this.messageAssertions = messageAssertions; - } - - /// - /// Clears up the world data. - /// - [AfterScenario] - public void AfterScenario() - { - foreach (DarkRiftServer server in servers.Values) - { - try - { - server.Dispose(); - } - catch (Exception e) - { - Console.WriteLine("An Exception was thrown while disposing the server.\n" + e); - } - } - - foreach (DarkRiftClient client in clients.Values) - client.Dispose(); - - clients.Clear(); - servers.Clear(); - - Interlocked.Exchange(ref serverConnectedEvents, 0); - Interlocked.Exchange(ref serverDisconnectedEvents, 0); - - // Reset server registry - InMemoryServerRegistryConnector.Reset(); - - ClientConnectionDelay = 0; - } - - /// - /// Adds a new client to the world. - /// - /// The client to add. - public void AddClient(DarkRiftClient client) - { - clients.Add(client.ID, client); - - client.MessageReceived += ClientMessageReceived; - } - - /// - /// Adds a new server to the world. - /// - /// The serverto add. - public void AddServer(DarkRiftServer server) - { - servers.Add(server.RemoteServerManager.ServerID, server); - - server.ClientManager.ClientConnected += (s, a) => ClientConnected(s, a, server.RemoteServerManager.ServerID); - - foreach (IServerGroup group in server.RemoteServerManager.GetAllGroups()) - { - group.ServerJoined += (s, a) => ServerJoinedGroup(s, a, server.RemoteServerManager.ServerID); - group.ServerLeft += (s, a) => ServerLeftGroup(s, a, server.RemoteServerManager.ServerID); - } - } - - /// - /// Gets a client by ID. - /// - /// The ID to get. - public DarkRiftClient GetClient(ushort id) - { - return clients[id]; - } - - /// - /// Gets an enumerable of all clienst. - /// - /// All clients. - public IEnumerable GetClients() - { - return clients.Values; - } - - /// - /// Gets a server by ID. - /// - /// The ID to get. - public DarkRiftServer GetServer(ushort id) - { - return servers[id]; - } - - /// - /// Gets an enumerable of all servers. - /// - /// All servers. - public IEnumerable GetServers() - { - return servers.Values; - } - - /// - /// Removes the specified server. - /// - /// The server to remove. - public void RemoveServer(ushort id) - { - servers.Remove(id); - } - - /// - /// Event handler for new clients connecting. - /// - /// The client manager. - /// The event args. - /// The ID of the server the client connected to. - private void ClientConnected(object _, ClientConnectedEventArgs args, ushort serverID) - { - if (ClientConnectionDelay > 0) - Thread.Sleep(ClientConnectionDelay); - - args.Client.MessageReceived += (s, a) => ServerMessageReceivedFromClient(s, a, serverID); - } - - /// - /// Event handler for messages arriving at a client. - /// - /// The client. - /// The event args. - private void ClientMessageReceived(object sender, Client.MessageReceivedEventArgs args) - { - using Message message = args.GetMessage(); - string str; - using (DarkRiftReader reader = message.GetReader()) - { - if (reader.Length > 0) - str = reader.ReadString(); - else - str = null; - } - - messageAssertions.AddMessageOnClient(new ReceivedMessage(str, ushort.MaxValue, ((DarkRiftClient)sender).ID, message.Tag, args.SendMode)); - - } - - /// - /// Event handler for messages arriving at the server from a client. - /// - /// The client that sent. - /// The event args. - /// The ID of the server that received this message. - private void ServerMessageReceivedFromClient(object sender, Server.MessageReceivedEventArgs args, ushort serverID) - { - // Record message - using (Message message = args.GetMessage()) - { - string str; - using (DarkRiftReader reader = message.GetReader()) - { - if (reader.Length > 0) - str = reader.ReadString(); - else - str = null; - } - - messageAssertions.AddMessageOnServer(new ReceivedMessage(str, args.Client.ID, serverID, message.Tag, args.SendMode)); - } - - // Call to other event handlers - ServerMessageReceived.Invoke(sender, args); - } - - /// - /// Handles a server joining a group. - /// - /// The - /// The event args. - /// The ID of the server the server connected to. - private void ServerJoinedGroup(object sender, ServerJoinedEventArgs e, ushort serverID) - { - e.RemoteServer.MessageReceived += (s, a) => ServerMessageReceivedFromServer(s, a, serverID); - e.RemoteServer.ServerConnected += (s, a) => ServerConnected(s, a, serverID); - e.RemoteServer.ServerDisconnected += ServerDisconnected; - - ServerJoined.Invoke(sender, e); - } - - /// - /// Handles a server leaving a group. - /// - /// The - /// The event args. - /// The ID of the server the server connected to. - private void ServerLeftGroup(object sender, ServerLeftEventArgs e, ushort _) - { - // Can't unsubscribe MessageReceived as we're using a lambda, would need to assign it to a reference - //e.RemoteServer.ServerConnected -= ServerConnected; - e.RemoteServer.ServerDisconnected -= ServerDisconnected; - - ServerLeft.Invoke(sender, e); - } - - /// - /// Handles a server connecting. - /// - /// The - /// The event args. - private void ServerConnected(object sender, ServerConnectedEventArgs e, int serverID) - { - Interlocked.Increment(ref serverConnectedEvents); - } - - /// - /// Handles a server disconnecting. - /// - /// The - /// The event args. - private void ServerDisconnected(object sender, ServerDisconnectedEventArgs e) - { - Interlocked.Increment(ref serverDisconnectedEvents); - } - - /// - /// Event handler for messages arriving at the server from another server. - /// - /// The remote server that sent. - /// The event args. - /// The ID of the server that received this message. - private void ServerMessageReceivedFromServer(object _, Server.ServerMessageReceivedEventArgs args, ushort serverID) - { - // Record message - using Message message = args.GetMessage(); - - string str; - using (DarkRiftReader reader = message.GetReader()) { - if (reader.Length > 0) - str = reader.ReadString(); - else - str = null; - } - - messageAssertions.AddMessageOnServer(new ReceivedMessage(str, args.RemoteServer.ID, serverID, message.Tag, args.SendMode)); - } - } -} diff --git a/DarkRift.Testing/DarkRift.Testing.csproj b/DarkRift.Testing/DarkRift.Testing.csproj deleted file mode 100644 index d1a6792..0000000 --- a/DarkRift.Testing/DarkRift.Testing.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - net4.5;net6.0 - net6.0 - Debug;Release - true - - NU1701 - false - - - - - - - - - - - TRACE;DEBUG - - - - - - diff --git a/DarkRift.Testing/packages.config b/DarkRift.Testing/packages.config deleted file mode 100644 index de82217..0000000 --- a/DarkRift.Testing/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/DarkRift.Testing/AssertExtensions.cs b/DarkRift.Tests/AssertExtensions.cs similarity index 58% rename from DarkRift.Testing/AssertExtensions.cs rename to DarkRift.Tests/AssertExtensions.cs index 5894dd0..80bd290 100644 --- a/DarkRift.Testing/AssertExtensions.cs +++ b/DarkRift.Tests/AssertExtensions.cs @@ -5,40 +5,46 @@ */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; -namespace DarkRift.Testing +namespace DarkRift.Tests { internal static class AssertExtensions { public static void AreEqualAndNotShorter(T[] expected, T[] actual) where T : IEquatable { if (actual.Length < expected.Length) - throw new AssertFailedException("Actual array was too short."); + { + Assert.Fail("Actual array was too short."); + } for (int i = 0; i < expected.Length; i++) { if (!actual[i].Equals(expected[i])) - throw new AssertFailedException($"Element {i} was incorrect. Exepected: '{expected[i]}', actual: '{actual[i]}'"); + { + Assert.Fail($"Element {i} was incorrect. Exepected: '{expected[i]}', actual: '{actual[i]}'"); + } } } public static void AreEqualAndSameLength(T[] expected, T[] actual) where T : IEquatable { if (actual.Length < expected.Length) - throw new AssertFailedException("Actual array was too short."); + { + Assert.Fail("Actual array was too short."); + } if (actual.Length > expected.Length) - throw new AssertFailedException("Actual array was too long."); + { + Assert.Fail("Actual array was too long."); + } for (int i = 0; i < expected.Length; i++) { if (!actual[i].Equals(expected[i])) - throw new AssertFailedException($"Element {i} was incorrect. Exepected: '{expected[i]}', actual: '{actual[i]}'"); + { + Assert.Fail($"Element {i} was incorrect. Exepected: '{expected[i]}', actual: '{actual[i]}'"); + } } } } diff --git a/DarkRift.Tests/DarkRift.Tests.asmdef b/DarkRift.Tests/DarkRift.Tests.asmdef new file mode 100644 index 0000000..a0324f2 --- /dev/null +++ b/DarkRift.Tests/DarkRift.Tests.asmdef @@ -0,0 +1,24 @@ +{ + "name": "DarkRift.Tests", + "rootNamespace": "", + "references": [ + "GUID:27619889b8ba8c24980f49ee34dbb44a", + "GUID:0acc523941302664db1f4e527237feb3", + "GUID:74b22b8f1e899468c828514608b766c6" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Testing/DarkRiftReaderTests.cs b/DarkRift.Tests/DarkRiftReaderTests.cs similarity index 50% rename from DarkRift.Testing/DarkRiftReaderTests.cs rename to DarkRift.Tests/DarkRiftReaderTests.cs index 1d4fe3b..2d547b1 100644 --- a/DarkRift.Testing/DarkRiftReaderTests.cs +++ b/DarkRift.Tests/DarkRiftReaderTests.cs @@ -4,89 +4,83 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Moq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DarkRift.Testing +using NUnit.Framework; + +namespace DarkRift.Tests { // TODO test exceptions and exception messages - [TestClass] public class DarkRiftReaderTests { - private Mock mockMessageBuffer = new Mock(); - + private MockMessageBuffer messageBuffer; private DarkRiftReader reader; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { + messageBuffer = new MockMessageBuffer(); + // GIVEN the object cache is disabled #pragma warning disable CS0618 // We don't care about using Server/Client specific cache settings ObjectCache.Initialize(ObjectCacheSettings.DontUseCache); #pragma warning restore CS0618 // AND a DarkRiftReader under test - reader = DarkRiftReader.Create(mockMessageBuffer.Object); + reader = DarkRiftReader.Create(messageBuffer); } - [TestMethod] - public void ReadByteTest() + [Test] + public void ReadByte() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 5 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(1); + messageBuffer.Buffer = new byte[] { 5 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 1; // WHEN I read a byte from the reader byte result = reader.ReadByte(); - + // THEN the value is as expected Assert.AreEqual((byte)5, result); } - [TestMethod] - public void ReadCharTest() + [Test] + public void ReadChar() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0, 0, 0, 2, 65, 0 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(6); + messageBuffer.Buffer = new byte[] { 0, 0, 0, 2, 65, 0 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 6; // WHEN I read a char from the reader char result = reader.ReadChar(); - + // THEN the value is as expected Assert.AreEqual('A', result); } - [TestMethod] - public void ReadBooleanTest() + [Test] + public void ReadBoolean() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 1 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(1); + messageBuffer.Buffer = new byte[] { 1 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 1; // WHEN I read a boolean from the reader bool result = reader.ReadBoolean(); - + // THEN the value is as expected Assert.AreEqual(true, result); } - [TestMethod] - public void ReadDoubleTest() + [Test] + public void ReadDouble() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0x3f, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(10); + messageBuffer.Buffer = new byte[] { 0x3f, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 10; // WHEN I read a double from the reader double result = reader.ReadDouble(); @@ -94,14 +88,14 @@ public void ReadDoubleTest() // THEN the value is as expected Assert.AreEqual(0.75d, result); } - - [TestMethod] - public void ReadInt16Test() + + [Test] + public void ReadInt16() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0xE8, 0xA2 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(2); + messageBuffer.Buffer = new byte[] { 0xE8, 0xA2 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 2; // WHEN I read a short from the reader short result = reader.ReadInt16(); @@ -110,13 +104,13 @@ public void ReadInt16Test() Assert.AreEqual((short)-5982, result); } - [TestMethod] - public void ReadInt32Test() + [Test] + public void ReadInt32() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0x23, 0x24, 0x30, 0x5C }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(4); + messageBuffer.Buffer = new byte[] { 0x23, 0x24, 0x30, 0x5C }; + messageBuffer.Offset = 0; + messageBuffer.Count = 4; // WHEN I read an int from the reader int result = reader.ReadInt32(); @@ -125,13 +119,13 @@ public void ReadInt32Test() Assert.AreEqual(589574236, result); } - [TestMethod] - public void ReadInt64Test() + [Test] + public void ReadInt64() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0x51, 0xD1, 0xE2, 0x71, 0xCA, 0x29, 0x58, 0x08 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(8); + messageBuffer.Buffer = new byte[] { 0x51, 0xD1, 0xE2, 0x71, 0xCA, 0x29, 0x58, 0x08 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 8; // WHEN I read a long from the reader long result = reader.ReadInt64(); @@ -140,13 +134,13 @@ public void ReadInt64Test() Assert.AreEqual(5895742365555578888L, result); } - [TestMethod] - public void ReadSByteTest() + [Test] + public void ReadSByte() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0xD3 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(1); + messageBuffer.Buffer = new byte[] { 0xD3 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 1; // WHEN I read an sbyte from the reader sbyte result = reader.ReadSByte(); @@ -155,13 +149,13 @@ public void ReadSByteTest() Assert.AreEqual((sbyte)-45, result); } - [TestMethod] - public void ReadSingleTest() + [Test] + public void ReadSingle() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0x3f, 0x40, 0x00, 0x00 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(4); + messageBuffer.Buffer = new byte[] { 0x3f, 0x40, 0x00, 0x00 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 4; // WHEN I read a float from the reader float result = reader.ReadSingle(); @@ -170,13 +164,13 @@ public void ReadSingleTest() Assert.AreEqual(0.75f, result); } - [TestMethod] - public void ReadUInt16Test() + [Test] + public void ReadUInt16() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0xE8, 0xA2 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(2); + messageBuffer.Buffer = new byte[] { 0xE8, 0xA2 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 2; // WHEN I read a ushort from the reader ushort result = reader.ReadUInt16(); @@ -185,13 +179,13 @@ public void ReadUInt16Test() Assert.AreEqual((ushort)59554, result); } - [TestMethod] - public void ReadUInt32Test() + [Test] + public void ReadUInt32() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0x23, 0x24, 0x30, 0x5C }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(4); + messageBuffer.Buffer = new byte[] { 0x23, 0x24, 0x30, 0x5C }; + messageBuffer.Offset = 0; + messageBuffer.Count = 4; // WHEN I read a uint from the reader uint result = reader.ReadUInt32(); @@ -200,13 +194,13 @@ public void ReadUInt32Test() Assert.AreEqual((uint)589574236, result); } - [TestMethod] - public void ReadUInt64Test() + [Test] + public void ReadUInt64() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0x51, 0xD1, 0xE2, 0x71, 0xCA, 0x29, 0x58, 0x08 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(8); + messageBuffer.Buffer = new byte[] { 0x51, 0xD1, 0xE2, 0x71, 0xCA, 0x29, 0x58, 0x08 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 8; // WHEN I read a ulong from the reader ulong result = reader.ReadUInt64(); @@ -215,13 +209,13 @@ public void ReadUInt64Test() Assert.AreEqual((ulong)5895742365555578888, result); } - [TestMethod] - public void ReadStringTest() + [Test] + public void ReadString() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0, 0, 0, 6, 65, 0, 66, 0, 67, 0 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(10); + messageBuffer.Buffer = new byte[] { 0, 0, 0, 6, 65, 0, 66, 0, 67, 0 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 10; // WHEN I read a string from the reader string result = reader.ReadString(); @@ -230,13 +224,13 @@ public void ReadStringTest() Assert.AreEqual("ABC", result); } - [TestMethod] - public void ReadBooleansTest() + [Test] + public void ReadBooleans() { // GIVEN a buffer of serialized data - mockMessageBuffer.Setup(m => m.Buffer).Returns(new byte[] { 0, 0, 0, 9, 0b11001010, 0b10000000 }); - mockMessageBuffer.Setup(m => m.Offset).Returns(0); - mockMessageBuffer.Setup(m => m.Count).Returns(6); + messageBuffer.Buffer = new byte[] { 0, 0, 0, 9, 0b11001010, 0b10000000 }; + messageBuffer.Offset = 0; + messageBuffer.Count = 6; // WHEN I read a boolean array from the reader bool[] result = reader.ReadBooleans(); diff --git a/DarkRift.Testing/DarkRiftWriterTests.cs b/DarkRift.Tests/DarkRiftWriterTests.cs similarity index 90% rename from DarkRift.Testing/DarkRiftWriterTests.cs rename to DarkRift.Tests/DarkRiftWriterTests.cs index b399653..a3b8bf2 100644 --- a/DarkRift.Testing/DarkRiftWriterTests.cs +++ b/DarkRift.Tests/DarkRiftWriterTests.cs @@ -4,22 +4,16 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading; -using DarkRift.Dispatching; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DarkRift.Testing +using NUnit.Framework; + +namespace DarkRift.Tests { - [TestClass] public class DarkRiftWriterTests { private DarkRiftWriter writer; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { // GIVEN the object cache is disabled #pragma warning disable CS0618 // We don't care about using Server/Client specific cache settings @@ -30,8 +24,8 @@ public void Initialize() writer = DarkRiftWriter.Create(); } - [TestMethod] - public void WriteByteTest() + [Test] + public void WriteByte() { // WHEN I write a byte to the writer writer.Write((byte)5); @@ -49,8 +43,8 @@ public void WriteByteTest() Assert.AreEqual(1, writer.Length); } - [TestMethod] - public void WriteCharTest() + [Test] + public void WriteChar() { // WHEN I write a char to the writer writer.Write('A'); @@ -68,8 +62,8 @@ public void WriteCharTest() Assert.AreEqual(6, writer.Length); } - [TestMethod] - public void WriteBooleanTest() + [Test] + public void WriteBoolean() { // WHEN I write a boolean to the writer writer.Write(true); @@ -87,8 +81,8 @@ public void WriteBooleanTest() Assert.AreEqual(1, writer.Length); } - [TestMethod] - public void WriteDoubleTest() + [Test] + public void WriteDouble() { // WHEN I write a double to the writer writer.Write(0.75d); @@ -106,8 +100,8 @@ public void WriteDoubleTest() Assert.AreEqual(8, writer.Length); } - [TestMethod] - public void WriteInt16Test() + [Test] + public void WriteInt16() { // WHEN I write a short to the writer writer.Write((short)-5982); @@ -125,8 +119,8 @@ public void WriteInt16Test() Assert.AreEqual(2, writer.Length); } - [TestMethod] - public void WriteInt32Test() + [Test] + public void WriteInt32() { // WHEN I write an int to the writer writer.Write(589574236); @@ -144,8 +138,8 @@ public void WriteInt32Test() Assert.AreEqual(4, writer.Length); } - [TestMethod] - public void WriteInt64Test() + [Test] + public void WriteInt64() { // WHEN I write a long to the writer writer.Write(5895742365555578888); @@ -163,8 +157,8 @@ public void WriteInt64Test() Assert.AreEqual(8, writer.Length); } - [TestMethod] - public void WriteSByteTest() + [Test] + public void WriteSByte() { // WHEN I write an sbyte to the writer writer.Write((sbyte)-45); @@ -182,8 +176,8 @@ public void WriteSByteTest() Assert.AreEqual(1, writer.Length); } - [TestMethod] - public void WriteFloatTest() + [Test] + public void WriteFloat() { // WHEN I write a float to the writer writer.Write(0.75f); @@ -201,8 +195,8 @@ public void WriteFloatTest() Assert.AreEqual(4, writer.Length); } - [TestMethod] - public void WriteUInt16Test() + [Test] + public void WriteUInt16() { // WHEN I write a ushort to the writer writer.Write((ushort)59554); @@ -220,8 +214,8 @@ public void WriteUInt16Test() Assert.AreEqual(2, writer.Length); } - [TestMethod] - public void WriteUInt32Test() + [Test] + public void WriteUInt32() { // WHEN I write a uint to the writer writer.Write((uint)589574236); @@ -239,8 +233,8 @@ public void WriteUInt32Test() Assert.AreEqual(4, writer.Length); } - [TestMethod] - public void WriteUInt64Test() + [Test] + public void WriteUInt64() { // WHEN I write a ulong to the writer writer.Write((ulong)5895742365555578888); @@ -258,8 +252,8 @@ public void WriteUInt64Test() Assert.AreEqual(8, writer.Length); } - [TestMethod] - public void WriteStringTest() + [Test] + public void WriteString() { // WHEN I write a string to the writer writer.Write("ABC"); @@ -277,8 +271,8 @@ public void WriteStringTest() Assert.AreEqual(10, writer.Length); } - [TestMethod] - public void WriteBooleansTest() + [Test] + public void WriteBooleans() { // WHEN I write a boolean array to the writer writer.Write(new bool[] { true, true, false, false, true, false, true, false, true }); @@ -296,8 +290,8 @@ public void WriteBooleansTest() Assert.AreEqual(6, writer.Length); } - [TestMethod] - public void ToArrayTest() + [Test] + public void ToArray() { // WHEN I write a string to the writer writer.Write("ABC"); @@ -309,7 +303,7 @@ public void ToArrayTest() AssertExtensions.AreEqualAndSameLength(new byte[] { 0, 0, 0, 6, 65, 0, 66, 0, 67, 0 }, array); } - [TestMethod] + [Test] public void ToArrayWithCountAndOffsetTest() { // WHEN I write a string to the writer @@ -322,7 +316,7 @@ public void ToArrayWithCountAndOffsetTest() AssertExtensions.AreEqualAndSameLength(new byte[] { 65, 0, 66, 0 }, array); } - [TestMethod] + [Test] public void CopyToWithOffsetTest() { // WHEN I write a string to the writer @@ -337,7 +331,7 @@ public void CopyToWithOffsetTest() AssertExtensions.AreEqualAndSameLength(new byte[] { 9, 0, 0, 0, 6, 65, 0, 66, 0, 67, 0 }, array); } - [TestMethod] + [Test] public void CopyToWithCountTest() { // WHEN I write a string to the writer @@ -352,7 +346,7 @@ public void CopyToWithCountTest() AssertExtensions.AreEqualAndSameLength(new byte[] { 9, 0, 0, 0, 6, 65, 0, 66, 0, 67 }, array); } - [TestMethod] + [Test] public void CopyToWithCountAndOffsetsTest() { // WHEN I write a string to the writer diff --git a/DarkRift.Testing/DataStructures/CircularDictionaryTests.cs b/DarkRift.Tests/DataStructures/CircularDictionaryTests.cs similarity index 66% rename from DarkRift.Testing/DataStructures/CircularDictionaryTests.cs rename to DarkRift.Tests/DataStructures/CircularDictionaryTests.cs index fd285f4..45dee7d 100644 --- a/DarkRift.Testing/DataStructures/CircularDictionaryTests.cs +++ b/DarkRift.Tests/DataStructures/CircularDictionaryTests.cs @@ -4,31 +4,25 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using DarkRift.DataStructures; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; +using NUnit.Framework; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace DarkRift.DataStructures.Testing +namespace DarkRift.DataStructures.Tests { - [TestClass] public class CircularDictionaryTests { private CircularDictionary dictionary; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { dictionary = new CircularDictionary(4); } - [TestMethod] - public void LookupTest() + [Test] + public void Lookup() { - Assert.ThrowsException(() => dictionary[9]); + Assert.Throws(() => _ = dictionary[9]); //Initial population dictionary.Add(10, 5); @@ -44,7 +38,7 @@ public void LookupTest() //Should push off first 10 dictionary.Add(18, 9); - Assert.ThrowsException(() => dictionary[10]); + Assert.Throws(() => _ = dictionary[10]); Assert.AreEqual(9, dictionary[18]); } diff --git a/DarkRift.Testing/DataStructures/MovingAverageFilterTests.cs b/DarkRift.Tests/DataStructures/MovingAverageFilterTests.cs similarity index 77% rename from DarkRift.Testing/DataStructures/MovingAverageFilterTests.cs rename to DarkRift.Tests/DataStructures/MovingAverageFilterTests.cs index f13aeb6..34938eb 100644 --- a/DarkRift.Testing/DataStructures/MovingAverageFilterTests.cs +++ b/DarkRift.Tests/DataStructures/MovingAverageFilterTests.cs @@ -4,27 +4,22 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using DarkRift.DataStructures; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Text; +using NUnit.Framework; -namespace DarkRift.DataStructures.Testing +namespace DarkRift.DataStructures.Tests { - [TestClass] public class MovingAverageFilterTests { private MovingAverageFilter filter; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { filter = new MovingAverageFilter(4); } - [TestMethod] - public void AverageTest() + [Test] + public void Average() { Assert.AreEqual(0, filter.Average); @@ -42,8 +37,8 @@ public void AverageTest() Assert.AreEqual(8, filter.Average); } - [TestMethod] - public void ResetTest() + [Test] + public void Reset() { Assert.AreEqual(0, filter.Average); diff --git a/DarkRift.Testing/Dispatching/ActionDispatcherTaskTests.cs b/DarkRift.Tests/Dispatching/ActionDispatcherTaskTests.cs similarity index 75% rename from DarkRift.Testing/Dispatching/ActionDispatcherTaskTests.cs rename to DarkRift.Tests/Dispatching/ActionDispatcherTaskTests.cs index 3cbf543..6d6dcf6 100644 --- a/DarkRift.Testing/Dispatching/ActionDispatcherTaskTests.cs +++ b/DarkRift.Tests/Dispatching/ActionDispatcherTaskTests.cs @@ -5,17 +5,14 @@ */ using System; -using DarkRift.Dispatching; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Moq; +using NUnit.Framework; -namespace DarkRift.Testing.Dispatching +namespace DarkRift.Dispatching.Tests { - [TestClass] public class ActionDispatcherTaskTests { - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { //Object cache needs to be initialized for create #pragma warning disable CS0618 // We don't care about using Server/Client specific cache settings @@ -23,8 +20,8 @@ public void Initialize() #pragma warning restore CS0618 } - [TestMethod] - public void TestExecuteSynchronous() + [Test] + public void ExecuteSynchronous() { bool set = false; ActionDispatcherTask task = ActionDispatcherTask.Create(() => set = true); @@ -37,8 +34,8 @@ public void TestExecuteSynchronous() Assert.AreEqual(DispatcherTaskState.CompletedImmediate, task.TaskState); } - [TestMethod] - public void TestExecuteAsynchronous() + [Test] + public void ExecuteAsynchronous() { bool set = false; ActionDispatcherTask task = ActionDispatcherTask.Create(() => set = true); @@ -51,18 +48,15 @@ public void TestExecuteAsynchronous() Assert.AreEqual(DispatcherTaskState.CompletedQueued, task.TaskState); } - [TestMethod] - public void TestExecuteException() + [Test] + public void ExecuteException() { Exception exception = new Exception(); ActionDispatcherTask task = ActionDispatcherTask.Create(() => throw exception); Assert.AreEqual(DispatcherTaskState.Queued, task.TaskState); - Assert.ThrowsException(() => - { - task.Execute(true); - }); + Assert.Throws(() => task.Execute(true)); Assert.AreEqual(DispatcherTaskState.Failed, task.TaskState); Assert.AreEqual(exception, task.Exception); diff --git a/DarkRift.Testing/Dispatching/DispatcherTests.cs b/DarkRift.Tests/Dispatching/DispatcherTests.cs similarity index 78% rename from DarkRift.Testing/Dispatching/DispatcherTests.cs rename to DarkRift.Tests/Dispatching/DispatcherTests.cs index 2a0e029..6f3d0e0 100644 --- a/DarkRift.Testing/Dispatching/DispatcherTests.cs +++ b/DarkRift.Tests/Dispatching/DispatcherTests.cs @@ -6,24 +6,25 @@ using System; using System.Threading; -using DarkRift.Dispatching; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; -namespace DarkRift.Testing.Dispatching +namespace DarkRift.Dispatching.Tests { - [TestClass] public class DispatcherTests { private Dispatcher dispatcher; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { - + //Object cache needs to be initialized for create +#pragma warning disable CS0618 // We don't care about using Server/Client specific cache settings + ObjectCache.Initialize(ObjectCacheSettings.DontUseCache); +#pragma warning restore CS0618 } - [TestMethod] - public void InvokeAsyncTests() + [Test] + public void InvokeAsync() { dispatcher = new Dispatcher(true); int executed = 0; @@ -38,17 +39,14 @@ public void InvokeAsyncTests() Assert.AreEqual(DispatcherTaskState.CompletedImmediate, task.TaskState); //Should invoke asynchronously - Thread t = new Thread(() => - { - task = dispatcher.InvokeAsync(() => { executed++; return; }); - }); + Thread t = new Thread(() => task = dispatcher.InvokeAsync(() => { executed++; return; })); t.Start(); t.Join(); Assert.AreEqual(1, dispatcher.Count); Assert.AreEqual(1, executed); Assert.AreEqual(DispatcherTaskState.Queued, task.TaskState); - + dispatcher.ExecuteDispatcherTasks(); Assert.AreEqual(0, dispatcher.Count); @@ -56,8 +54,8 @@ public void InvokeAsyncTests() Assert.AreEqual(DispatcherTaskState.CompletedQueued, task.TaskState); } - [TestMethod] - public void InvokeAsyncFuncTests() + [Test] + public void InvokeAsyncFunc() { dispatcher = new Dispatcher(true); int executed = 0; @@ -73,10 +71,7 @@ public void InvokeAsyncFuncTests() Assert.AreEqual(DispatcherTaskState.CompletedImmediate, task.TaskState); //Should invoke asynchronously - Thread t = new Thread(() => - { - task = dispatcher.InvokeAsync(() => ++executed); - }); + Thread t = new Thread(() => task = dispatcher.InvokeAsync(() => ++executed)); t.Start(); t.Join(); @@ -92,11 +87,11 @@ public void InvokeAsyncFuncTests() Assert.AreEqual(DispatcherTaskState.CompletedQueued, task.TaskState); } - [TestMethod] - public void ExecuteDispatcherTasksTests() + [Test] + public void ExecuteDispatcherTasks() { dispatcher = new Dispatcher(false); - + //Should execute all current tasks, exception suppressed int executed = 0; Thread t = new Thread(() => @@ -114,11 +109,11 @@ public void ExecuteDispatcherTasksTests() Assert.AreEqual(3, executed); } - [TestMethod] - public void ExecuteDispatcherTasksExceptionsTests() + [Test] + public void ExecuteDispatcherTasksExceptions() { dispatcher = new Dispatcher(true); - + //Should execute 1st task then raise second task exception int executed = 0; Thread t = new Thread(() => @@ -130,10 +125,7 @@ public void ExecuteDispatcherTasksExceptionsTests() t.Start(); t.Join(); - Assert.ThrowsException(() => - { - dispatcher.ExecuteDispatcherTasks(); - }); + Assert.Throws(() => dispatcher.ExecuteDispatcherTasks()); Assert.AreEqual(1, executed); } diff --git a/DarkRift.Testing/MemoryPoolTests.cs b/DarkRift.Tests/MemoryPoolTests.cs similarity index 83% rename from DarkRift.Testing/MemoryPoolTests.cs rename to DarkRift.Tests/MemoryPoolTests.cs index 2219136..dd30014 100644 --- a/DarkRift.Testing/MemoryPoolTests.cs +++ b/DarkRift.Tests/MemoryPoolTests.cs @@ -4,16 +4,10 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DarkRift.Testing +using NUnit.Framework; + +namespace DarkRift.Tests { - [TestClass] public class MemoryPoolTests { // TODO This test should DI mock ObjectPool instances and assert on them @@ -23,14 +17,14 @@ public class MemoryPoolTests /// private MemoryPool memoryPool; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { memoryPool = new MemoryPool(16, 4, 64, 4, 256, 4, 1024, 4, 4096, 4); } - [TestMethod] - public void GetExtraSmallMemoryTest() + [Test] + public void GetExtraSmallMemory() { // GIVEN a memory pool with no previously pooled memory @@ -42,8 +36,8 @@ public void GetExtraSmallMemoryTest() Assert.AreEqual(16, result.Length); } - [TestMethod] - public void GetSmallMemoryTest() + [Test] + public void GetSmallMemory() { // GIVEN a memory pool with no previously pooled memory @@ -55,8 +49,8 @@ public void GetSmallMemoryTest() Assert.AreEqual(64, result.Length); } - [TestMethod] - public void GetMediumMemoryTest() + [Test] + public void GetMediumMemory() { // GIVEN a memory pool with no previously pooled memory @@ -68,8 +62,8 @@ public void GetMediumMemoryTest() Assert.AreEqual(256, result.Length); } - [TestMethod] - public void GetLargeMemoryTest() + [Test] + public void GetLargeMemory() { // GIVEN a memory pool with no previously pooled memory @@ -81,8 +75,8 @@ public void GetLargeMemoryTest() Assert.AreEqual(1024, result.Length); } - [TestMethod] - public void GetExtraLargeMemoryTest() + [Test] + public void GetExtraLargeMemory() { // GIVEN a memory pool with no previously pooled memory @@ -94,8 +88,8 @@ public void GetExtraLargeMemoryTest() Assert.AreEqual(4096, result.Length); } - [TestMethod] - public void GetLargerThanExtraLargeMemoryTest() + [Test] + public void GetLargerThanExtraLargeMemory() { // GIVEN a memory pool with no previously pooled memory @@ -107,8 +101,8 @@ public void GetLargerThanExtraLargeMemoryTest() Assert.AreEqual(10000, result.Length); } - [TestMethod] - public void ReturnSmallerThanExtraSmallMemoryTest() + [Test] + public void ReturnSmallerThanExtraSmallMemory() { // GIVEN a memory pool with no previously pooled memory @@ -124,8 +118,8 @@ public void ReturnSmallerThanExtraSmallMemoryTest() Assert.AreEqual(16, newBlock.Length); } - [TestMethod] - public void ReturnExtraSmallMemoryTest() + [Test] + public void ReturnExtraSmallMemory() { // GIVEN a memory pool with no previously pooled memory @@ -140,8 +134,8 @@ public void ReturnExtraSmallMemoryTest() Assert.AreSame(oldBlock, newBlock); } - [TestMethod] - public void ReturnSmallMemoryTest() + [Test] + public void ReturnSmallMemory() { // GIVEN a memory pool with no previously pooled memory @@ -156,8 +150,8 @@ public void ReturnSmallMemoryTest() Assert.AreSame(oldBlock, newBlock); } - [TestMethod] - public void ReturnMediumMemoryTest() + [Test] + public void ReturnMediumMemory() { // GIVEN a memory pool with no previously pooled memory @@ -172,8 +166,8 @@ public void ReturnMediumMemoryTest() Assert.AreSame(oldBlock, newBlock); } - [TestMethod] - public void ReturnLargeMemoryTest() + [Test] + public void ReturnLargeMemory() { // GIVEN a memory pool with no previously pooled memory @@ -188,8 +182,8 @@ public void ReturnLargeMemoryTest() Assert.AreSame(oldBlock, newBlock); } - [TestMethod] - public void ReturnExtraLargeMemoryTest() + [Test] + public void ReturnExtraLargeMemory() { // GIVEN a memory pool with no previously pooled memory diff --git a/DarkRift.Tests/MockMessageBuffer.cs b/DarkRift.Tests/MockMessageBuffer.cs new file mode 100644 index 0000000..0681a86 --- /dev/null +++ b/DarkRift.Tests/MockMessageBuffer.cs @@ -0,0 +1,21 @@ +using System; + +namespace DarkRift.Tests +{ + public class MockMessageBuffer : IMessageBuffer + { + public byte[] Buffer { get; set; } + public int Count { get; set; } + public int Offset { get; set; } + + public IMessageBuffer Clone() + { + throw new NotImplementedException(); + } + + public void Dispose() + { + throw new NotImplementedException(); + } + } +} diff --git a/DarkRift.Testing/ObjectPoolTests.cs b/DarkRift.Tests/ObjectPoolTests.cs similarity index 78% rename from DarkRift.Testing/ObjectPoolTests.cs rename to DarkRift.Tests/ObjectPoolTests.cs index 44da41a..00f947c 100644 --- a/DarkRift.Testing/ObjectPoolTests.cs +++ b/DarkRift.Tests/ObjectPoolTests.cs @@ -4,16 +4,10 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DarkRift.Testing +using NUnit.Framework; + +namespace DarkRift.Tests { - [TestClass] public class ObjectPoolTests { /// @@ -26,19 +20,16 @@ public class ObjectPoolTests /// private object newInstance; - [TestInitialize] - public void Initialize() + [SetUp] + public void SetUp() { newInstance = null; - objectPool = new ObjectPool(2, () => - { - return newInstance = new object(); - }); + objectPool = new ObjectPool(2, () => newInstance = new object()); } - [TestMethod] - public void GetInstanceGeneratesWhenEmptyTest() + [Test] + public void GetInstanceGeneratesWhenEmpty() { // GIVEN an empty pool @@ -51,8 +42,8 @@ public void GetInstanceGeneratesWhenEmptyTest() Assert.AreSame(newInstance, result); } - [TestMethod] - public void GetInstanceUsesPoolWhenHasInstancesTest() + [Test] + public void GetInstanceUsesPoolWhenHasInstances() { // GIVEN a pool with a single element object pooledObject = new object(); @@ -69,8 +60,8 @@ public void GetInstanceUsesPoolWhenHasInstancesTest() Assert.AreSame(pooledObject, result); } - [TestMethod] - public void ReturnInstanceWhenPoolIsFullTest() + [Test] + public void ReturnInstanceWhenPoolIsFull() { // GIVEN a full pool objectPool.ReturnInstance(new object()); @@ -88,8 +79,8 @@ public void ReturnInstanceWhenPoolIsFullTest() Assert.AreNotSame(returnedObject, objectPool.GetInstance()); } - [TestMethod] - public void ReturnInstanceWhenPoolIsEmptyTest() + [Test] + public void ReturnInstanceWhenPoolIsEmpty() { // GIVEN an empty pool diff --git a/DarkRift.Testing/RoundTripTimeHelperTests.cs b/DarkRift.Tests/RoundTripTimeHelperTests.cs similarity index 69% rename from DarkRift.Testing/RoundTripTimeHelperTests.cs rename to DarkRift.Tests/RoundTripTimeHelperTests.cs index 9e1b469..ccd7a2d 100644 --- a/DarkRift.Testing/RoundTripTimeHelperTests.cs +++ b/DarkRift.Tests/RoundTripTimeHelperTests.cs @@ -4,34 +4,29 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; +using NUnit.Framework; -namespace DarkRift.Testing +namespace DarkRift.Tests { - [TestClass] public class RoundTripTimeHelperTests { - private RoundTripTimeHelper roundTripTime; + private readonly RoundTripTimeHelper roundTripTime; public RoundTripTimeHelperTests() { roundTripTime = new RoundTripTimeHelper(2, 3); } - [TestMethod] - public void RecordTest() + [Test] + public void Record() { roundTripTime.RecordOutboundPing(89); roundTripTime.RecordOutboundPing(90); Thread.Sleep(10); - + roundTripTime.RecordInboundPing(90); Assert.IsTrue(roundTripTime.LatestRtt > 0.01); @@ -43,7 +38,7 @@ public void RecordTest() Assert.IsTrue(roundTripTime.LatestRtt > 0.02); Assert.IsTrue(roundTripTime.SmoothedRtt > 0.01); - Assert.ThrowsException(() => roundTripTime.RecordInboundPing(91)); + Assert.Throws(() => roundTripTime.RecordInboundPing(91)); } } } diff --git a/DarkRift.Unity.Client.Editor/DarkRift.Unity.Client.Editor.asmdef b/DarkRift.Unity.Client.Editor/DarkRift.Unity.Client.Editor.asmdef new file mode 100644 index 0000000..c5eea76 --- /dev/null +++ b/DarkRift.Unity.Client.Editor/DarkRift.Unity.Client.Editor.asmdef @@ -0,0 +1,20 @@ +{ + "name": "DarkRift.Unity.Client.Editor", + "rootNamespace": "", + "references": [ + "GUID:50d844b2e00404ba9a9294e5e51f956c" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "!DARKRIFT_NO_CLIENT" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor/UnityClientEditor.cs b/DarkRift.Unity.Client.Editor/UnityClientEditor.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor/UnityClientEditor.cs rename to DarkRift.Unity.Client.Editor/UnityClientEditor.cs diff --git a/DarkRift.Unity.Client/DarkRift.Unity.Client.asmdef b/DarkRift.Unity.Client/DarkRift.Unity.Client.asmdef new file mode 100644 index 0000000..ef32d7f --- /dev/null +++ b/DarkRift.Unity.Client/DarkRift.Unity.Client.asmdef @@ -0,0 +1,19 @@ +{ + "name": "DarkRift.Unity.Client", + "rootNamespace": "", + "references": [ + "GUID:74b22b8f1e899468c828514608b766c6", + "GUID:76832b94ba439479ca17ebb829c50a03" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "!DARKRIFT_NO_CLIENT" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/SerializableObjectCacheSettings.cs b/DarkRift.Unity.Client/SerializableObjectCacheSettings.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/SerializableObjectCacheSettings.cs rename to DarkRift.Unity.Client/SerializableObjectCacheSettings.cs diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/UnityClient.cs b/DarkRift.Unity.Client/UnityClient.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/UnityClient.cs rename to DarkRift.Unity.Client/UnityClient.cs diff --git a/DarkRift.Unity.Editor/DarkRift.Unity.Editor.asmdef b/DarkRift.Unity.Editor/DarkRift.Unity.Editor.asmdef new file mode 100644 index 0000000..cb1a27b --- /dev/null +++ b/DarkRift.Unity.Editor/DarkRift.Unity.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "DarkRift.Unity.Editor", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Unity.Editor/PackageUpdater.cs b/DarkRift.Unity.Editor/PackageUpdater.cs new file mode 100644 index 0000000..6329ae1 --- /dev/null +++ b/DarkRift.Unity.Editor/PackageUpdater.cs @@ -0,0 +1,70 @@ +#if UNITY_2017_3_OR_NEWER // PackageInfo +using UnityEngine; +using UnityEditor; +using UnityEditor.PackageManager; +using PackageInfo = UnityEditor.PackageManager.PackageInfo; +using System.IO; + +namespace DarkRift.Unity.Editor +{ + [InitializeOnLoad] + internal static class PackageUpdater + { +#if UNITY_2020_2_OR_NEWER // Events + private static PackageInfo CurrentPackageInfo => PackageInfo.FindForAssembly(typeof(PackageUpdater).Assembly); + + static PackageUpdater() + { + PackageInfo currentPackageInfo = CurrentPackageInfo; + if (currentPackageInfo.source == PackageSource.Embedded || currentPackageInfo.source == PackageSource.Local) + { + Events.registeringPackages += OnRegisteringPackages; + } + } + +#if UNITY_2020_2_OR_NEWER // Events + InitializeOnEnterPlayMode (2019.3+) + [InitializeOnEnterPlayMode] + private static void OnEnterPlaymodeInEditor(EnterPlayModeOptions options) + { + if (options.HasFlag(EnterPlayModeOptions.DisableDomainReload)) + { + Events.registeredPackages -= OnRegisteringPackages; + } + } +#endif + + private static void OnRegisteringPackages(PackageRegistrationEventArgs args) + { + PackageInfo currentPackageInfo = CurrentPackageInfo; + + foreach (PackageInfo packageInfo in args.changedTo) + { + if (packageInfo.packageId == currentPackageInfo.packageId) + { + if (packageInfo.version != currentPackageInfo.version) + { + UpdateAssemblyInfos(currentPackageInfo, packageInfo); + } + break; + } + } + } +#endif + + private static void UpdateAssemblyInfos(PackageInfo packageInfoFrom, PackageInfo packageInfoTo) + { + string[] dirs = Directory.GetFiles(packageInfoTo.assetPath, "AssemblyInfo.gen.cs", SearchOption.AllDirectories); + foreach (string dir in dirs) + { + string text = File.ReadAllText(dir); + if (text.Contains(packageInfoFrom.version)) + { + File.WriteAllText(dir, text.Replace(packageInfoFrom.version, packageInfoTo.version)); + Debug.Log($"Modified {dir} ({packageInfoFrom.version} -> {packageInfoTo.version})"); + AssetDatabase.ImportAsset(dir); + } + } + } + } +} +#endif diff --git a/DarkRift.Unity.Server.Editor/DarkRift.Unity.Server.Editor.asmdef b/DarkRift.Unity.Server.Editor/DarkRift.Unity.Server.Editor.asmdef new file mode 100644 index 0000000..4150319 --- /dev/null +++ b/DarkRift.Unity.Server.Editor/DarkRift.Unity.Server.Editor.asmdef @@ -0,0 +1,21 @@ +{ + "name": "DarkRift.Unity.Server.Editor", + "rootNamespace": "", + "references": [ + "GUID:946957ecf1ca94f148ed5fbadd24e3de", + "GUID:c50fea142a1f744838196804f5838d9b" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "!DARKRIFT_NO_SERVER" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/UnityServerEditor.cs b/DarkRift.Unity.Server.Editor/UnityServerEditor.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/UnityServerEditor.cs rename to DarkRift.Unity.Server.Editor/UnityServerEditor.cs diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/XmlUnityServerEditor.cs b/DarkRift.Unity.Server.Editor/XmlUnityServerEditor.cs similarity index 88% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/XmlUnityServerEditor.cs rename to DarkRift.Unity.Server.Editor/XmlUnityServerEditor.cs index 9044152..4006a3b 100644 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/XmlUnityServerEditor.cs +++ b/DarkRift.Unity.Server.Editor/XmlUnityServerEditor.cs @@ -39,11 +39,22 @@ public class XmlUnityClientEditor : Editor private SerializedProperty createOnEnable; private SerializedProperty eventsFromDispatcher; + private IEnumerable pluginTypes; + private string pluginList; + private void OnEnable() { configuration = serializedObject.FindProperty("configuration"); createOnEnable = serializedObject.FindProperty("createOnEnable"); eventsFromDispatcher = serializedObject.FindProperty("eventsFromDispatcher"); + + RefreshPlugins(); + } + + private void RefreshPlugins() + { + pluginTypes = UnityServerHelper.SearchForPlugins(); + pluginList = pluginTypes.Any() ? pluginTypes.Select(t => "\t\u2022 " + t.Name).Aggregate((a, b) => a + "\n" + b) : null; } public override void OnInspectorGUI() @@ -53,7 +64,9 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(configuration); if (configuration.objectReferenceValue == null) + { EditorGUILayout.HelpBox("There is currently no configuration file assigned for the XmlUnityServer. The server will not be able to start!\n\nConsider adding the ExampleConfiguration.xml file here to get started.", MessageType.Warning); + } EditorGUILayout.PropertyField(createOnEnable); @@ -75,10 +88,8 @@ public override void OnInspectorGUI() IEnumerable pluginTypes = UnityServerHelper.SearchForPlugins(); - if (pluginTypes.Count() > 0) + if (pluginList != null) { - string pluginList = pluginTypes.Select(t => "\t\u2022 " + t.Name).Aggregate((a, b) => a + "\n" + b); - EditorGUILayout.HelpBox("The following plugin types were found and will be loaded into the server:\n" + pluginList, MessageType.Info); } else @@ -91,9 +102,13 @@ public override void OnInspectorGUI() if (GUILayout.Button("Open Configuration")) { if (configuration != null) + { AssetDatabase.OpenAsset(configuration.objectReferenceValue); + } else + { Debug.LogError("No configuration file specified!"); + } } serializedObject.ApplyModifiedProperties(); } diff --git a/DarkRift.Unity.Server/DarkRift.Unity.Server.asmdef b/DarkRift.Unity.Server/DarkRift.Unity.Server.asmdef new file mode 100644 index 0000000..a127917 --- /dev/null +++ b/DarkRift.Unity.Server/DarkRift.Unity.Server.asmdef @@ -0,0 +1,19 @@ +{ + "name": "DarkRift.Unity.Server", + "rootNamespace": "", + "references": [ + "GUID:74b22b8f1e899468c828514608b766c6", + "GUID:946957ecf1ca94f148ed5fbadd24e3de" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "!DARKRIFT_NO_SERVER" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityConsoleWriter.cs b/DarkRift.Unity.Server/UnityConsoleWriter.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityConsoleWriter.cs rename to DarkRift.Unity.Server/UnityConsoleWriter.cs diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServer.cs b/DarkRift.Unity.Server/UnityServer.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServer.cs rename to DarkRift.Unity.Server/UnityServer.cs diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServerHelper.cs b/DarkRift.Unity.Server/UnityServerHelper.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServerHelper.cs rename to DarkRift.Unity.Server/UnityServerHelper.cs diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/XmlUnityServer.cs b/DarkRift.Unity.Server/XmlUnityServer.cs similarity index 100% rename from DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/XmlUnityServer.cs rename to DarkRift.Unity.Server/XmlUnityServer.cs diff --git a/DarkRift.Unity/.gitattributes b/DarkRift.Unity/.gitattributes deleted file mode 100644 index 1ff0c42..0000000 --- a/DarkRift.Unity/.gitattributes +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/DarkRift.Unity/.gitignore b/DarkRift.Unity/.gitignore deleted file mode 100644 index bcb6037..0000000 --- a/DarkRift.Unity/.gitignore +++ /dev/null @@ -1,64 +0,0 @@ -[Ll]ibrary/ -[Tt]emp/ -[Oo]bj/ -[Bb]uild/ -[Bb]uilds/ - -# Never ignore Asset meta data -![Aa]ssets/**/*.meta - -# Asset Store tools -[Aa]ssets/AssetStoreTools* - -# DarkRift files -Assets/DarkRift/DarkRift/**/*.dll -Assets/DarkRift/DarkRift/**/*.dll.meta -Assets/DarkRift/DarkRift/**/*.xml -Assets/DarkRift/DarkRift/**/*.xml.meta -Assets/DarkRift/DarkRift/**/*.dll.pdb -Assets/DarkRift/DarkRift/**/*.dll.pdb.meta -Assets/DarkRift/DarkRift/**/*.dll.mdb -Assets/DarkRift/DarkRift/**/*.dll.mdb.meta - -!Assets/DarkRift/DarkRift/Plugins/Server/ExampleConfiguration.xml -!Assets/DarkRift/DarkRift/Plugins/link.xml -!Assets/DarkRift/DarkRift/Plugins/link.xml.meta - -*.zip -*.zip.meta - -[Ll]ogs/ -[Dd]ata/ - -# Visual Studio cache directory -.vs/ - -# Autogenerated VS/MD/Consulo solution and project files -ExportedObj/ -.consulo/ -*.csproj -*.unityproj -*.sln -*.suo -*.tmp -*.user -*.userprefs -*.pidb -*.booproj -*.svd -*.pdb -*.opendb - -# Unity3D generated meta files -*.pidb.meta -*.pdb.meta - -# Unity3D Generated File On Crash Reports -sysinfo.txt - -# Builds -*.apk -*.unitypackage - -# Crashlytics generated file -crashlytics-build.properties diff --git a/DarkRift.Unity/Assets/DarkRift.meta b/DarkRift.Unity/Assets/DarkRift.meta deleted file mode 100644 index 664d583..0000000 --- a/DarkRift.Unity/Assets/DarkRift.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 48a448d28e3805a4a840fcc24e2ab897 -folderAsset: yes -timeCreated: 1509748063 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo.meta b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo.meta deleted file mode 100644 index 939dec5..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 43e9e42939a615641b55340ce6b7199d -folderAsset: yes -timeCreated: 1509748063 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.cs b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.cs deleted file mode 100644 index c004587..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using DarkRift; -using DarkRift.Client; -using DarkRift.Client.Unity; -using UnityEngine; -using UnityEngine.UI; - -public class ChatDemo : MonoBehaviour -{ - [SerializeField] - [Tooltip("The client to communicate with the server via.")] - UnityClient client; - - [SerializeField] - [Tooltip("The InputField the user can type in.")] - InputField input; - - [SerializeField] - [Tooltip("The transform to place new messages in.")] - Transform chatWindow; - - [SerializeField] - [Tooltip("The scrollrect for the chat window (if present).")] - ScrollRect scrollRect; - - [SerializeField] - [Tooltip("The message prefab where messages will be added.")] - GameObject messagePrefab; - - void Awake() - { - //Check we have a client to send/receive from - if (client == null) - { - Debug.LogError("No client assigned to Chat component!"); - return; - } - - //Subscribe to the event for when we receive messages - client.MessageReceived += Client_MessageReceived; - client.Disconnected += Client_Disconnected; - } - - private void Client_MessageReceived(object sender, MessageReceivedEventArgs e) - { - //Get an instance of the message received - using (Message message = e.GetMessage() as Message) - { - //Get the DarkRiftReader from the message and read the text in it into the UI - using (DarkRiftReader reader = message.GetReader()) - AddMessage(reader.ReadString()); - } - } - - void Client_Disconnected(object sender, DisconnectedEventArgs e) - { - //If we've disconnected add a message to say whether it was us or the server that triggered the - //disconnection - if (e.LocalDisconnect) - AddMessage("You have disconnected from the server."); - else - AddMessage("You were disconnected from the server."); - } - - void AddMessage(string message) - { - //Now we need to create a new UI object to put the message in so instantiate our prefab and add it - //as a child to the chat window - GameObject messageObj = Instantiate(messagePrefab) as GameObject; - messageObj.transform.SetParent(chatWindow); - - //We need the Text component so search for it - Text text = messageObj.GetComponentInChildren(); - - //If the Text component is present then assign the text out message - if (text != null) - text.text = message; - else - Debug.LogError("Message object does not contain a Text component!"); - - if (scrollRect != null) - { - Canvas.ForceUpdateCanvases(); - scrollRect.verticalNormalizedPosition = 0f; - } - } - - //This will be called when the user presses enter in the input field - public void MessageEntered() - { - //Check we have a client to send from - if (client == null) - { - Debug.LogError("No client assigned to Chat component!"); - return; - } - - //First we need to build a DarkRiftWriter to put the data we want to send in, it'll default to Unicode - //encoding so we don't need to worry about that - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - //We can then write the input text into it - writer.Write(input.text); - - //Next we construct a message, in this case we can just use a default tag because there is nothing fancy - //that needs to happen before we read the data. - using (Message message = Message.Create(0, writer)) - { - //Finally we send the message to everyone connected! - client.SendMessage(message, SendMode.Reliable); - } - } - } -} diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.cs.meta b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.cs.meta deleted file mode 100644 index 6f9b601..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 2866a2b8036cc3742ae772a23a3d8a4d -timeCreated: 1509748070 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.unity b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.unity deleted file mode 100644 index 656e1e1..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.unity +++ /dev/null @@ -1,1563 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -SceneSettings: - m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_GIWorkflowMode: 0 - m_LightmapsMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_LightmapEditorSettings: - serializedVersion: 3 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AOMaxDistance: 1 - m_Padding: 2 - m_CompAOExponent: 0 - m_LightmapParameters: {fileID: 0} - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - accuratePlacement: 0 - minRegionArea: 2 - cellSize: 0.16666667 - manualCellSize: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &171673123 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 171673124} - m_Layer: 5 - m_Name: Sliding Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &171673124 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 171673123} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 778155056} - m_Father: {fileID: 1630070227} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -20, y: -20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &176776839 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 176776840} - - 114: {fileID: 176776843} - - 222: {fileID: 176776842} - - 114: {fileID: 176776841} - m_Layer: 5 - m_Name: Viewport - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &176776840 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 176776839} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 188165983} - m_Father: {fileID: 938764178} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 1} ---- !u!114 &176776841 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 176776839} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &176776842 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 176776839} ---- !u!114 &176776843 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 176776839} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 ---- !u!1 &188165982 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 188165983} - - 114: {fileID: 188165984} - - 114: {fileID: 188165985} - m_Layer: 5 - m_Name: Content - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &188165983 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 188165982} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 176776840} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 283, y: 0} - m_Pivot: {x: 0, y: 1} ---- !u!114 &188165984 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 188165982} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 0 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 0 ---- !u!114 &188165985 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 188165982} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalFit: 0 - m_VerticalFit: 2 ---- !u!1 &437931814 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 437931816} - - 108: {fileID: 437931815} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &437931815 -Light: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 437931814} - m_Enabled: 1 - serializedVersion: 6 - m_Type: 1 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_BounceIntensity: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} ---- !u!4 &437931816 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 437931814} - m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!1 &683610922 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 683610923} - - 222: {fileID: 683610925} - - 114: {fileID: 683610924} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &683610923 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 683610922} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 1319321231} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.5} - m_SizeDelta: {x: -20, y: -13} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &683610924 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 683610922} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 0 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: ---- !u!222 &683610925 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 683610922} ---- !u!1 &696232500 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 696232501} - m_Layer: 5 - m_Name: Sliding Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &696232501 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 696232500} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 2025647372} - m_Father: {fileID: 1753437438} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -20, y: -20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &778155055 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 778155056} - - 222: {fileID: 778155058} - - 114: {fileID: 778155057} - m_Layer: 5 - m_Name: Handle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &778155056 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 778155055} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 171673124} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &778155057 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 778155055} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &778155058 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 778155055} ---- !u!1 &938764177 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 938764178} - - 114: {fileID: 938764182} - - 222: {fileID: 938764181} - - 114: {fileID: 938764180} - - 114: {fileID: 938764179} - m_Layer: 5 - m_Name: Scroll View - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &938764178 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 938764177} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 176776840} - - {fileID: 1753437438} - - {fileID: 1630070227} - m_Father: {fileID: 1956900150} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &938764179 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 938764177} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreLayout: 0 - m_MinWidth: -1 - m_MinHeight: -1 - m_PreferredWidth: -1 - m_PreferredHeight: 100 - m_FlexibleWidth: -1 - m_FlexibleHeight: -1 ---- !u!114 &938764180 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 938764177} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.392} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &938764181 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 938764177} ---- !u!114 &938764182 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 938764177} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Content: {fileID: 188165983} - m_Horizontal: 1 - m_Vertical: 1 - m_MovementType: 1 - m_Elasticity: 0.1 - m_Inertia: 1 - m_DecelerationRate: 0.135 - m_ScrollSensitivity: 1 - m_Viewport: {fileID: 176776840} - m_HorizontalScrollbar: {fileID: 1753437439} - m_VerticalScrollbar: {fileID: 1630070228} - m_HorizontalScrollbarVisibility: 2 - m_VerticalScrollbarVisibility: 2 - m_HorizontalScrollbarSpacing: -3 - m_VerticalScrollbarSpacing: -3 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!1 &1319321230 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1319321231} - - 222: {fileID: 1319321234} - - 114: {fileID: 1319321233} - - 114: {fileID: 1319321232} - m_Layer: 5 - m_Name: InputField - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1319321231 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1319321230} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 1518273216} - - {fileID: 683610923} - m_Father: {fileID: 1956900150} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1319321232 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1319321230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 575553740, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1319321233} - m_TextComponent: {fileID: 683610924} - m_Placeholder: {fileID: 1518273217} - m_ContentType: 0 - m_InputType: 0 - m_AsteriskChar: 42 - m_KeyboardType: 0 - m_LineType: 0 - m_HideMobileInput: 0 - m_CharacterValidation: 0 - m_CharacterLimit: 0 - m_OnEndEdit: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 1785935270} - m_MethodName: MessageEntered - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 - m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null - m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} - m_CustomCaretColor: 0 - m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} - m_Text: - m_CaretBlinkRate: 0.85 - m_CaretWidth: 1 - m_ReadOnly: 0 ---- !u!114 &1319321233 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1319321230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1319321234 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1319321230} ---- !u!1 &1417056470 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1417056475} - - 20: {fileID: 1417056474} - - 92: {fileID: 1417056473} - - 124: {fileID: 1417056472} - - 81: {fileID: 1417056471} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1417056471 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1417056470} - m_Enabled: 1 ---- !u!124 &1417056472 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1417056470} - m_Enabled: 1 ---- !u!92 &1417056473 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1417056470} - m_Enabled: 1 ---- !u!20 &1417056474 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1417056470} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &1417056475 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1417056470} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 ---- !u!1 &1459710011 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1459710015} - - 114: {fileID: 1459710014} - - 114: {fileID: 1459710013} - - 114: {fileID: 1459710012} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1459710012 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1459710011} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ForceModuleActive: 0 ---- !u!114 &1459710013 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1459710011} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &1459710014 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1459710011} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!4 &1459710015 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1459710011} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 ---- !u!1 &1518273215 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1518273216} - - 222: {fileID: 1518273218} - - 114: {fileID: 1518273217} - m_Layer: 5 - m_Name: Placeholder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1518273216 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1518273215} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 1319321231} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.5} - m_SizeDelta: {x: -20, y: -13} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1518273217 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1518273215} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 2 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Enter your message... ---- !u!222 &1518273218 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1518273215} ---- !u!1 &1555507192 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1555507193} - - 223: {fileID: 1555507197} - - 114: {fileID: 1555507196} - - 114: {fileID: 1555507195} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1555507193 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1555507192} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 1956900150} - m_Father: {fileID: 0} - m_RootOrder: 3 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!114 &1555507195 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1555507192} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &1555507196 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1555507192} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!223 &1555507197 -Canvas: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1555507192} - m_Enabled: 1 - serializedVersion: 2 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!1 &1630070226 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1630070227} - - 222: {fileID: 1630070230} - - 114: {fileID: 1630070229} - - 114: {fileID: 1630070228} - m_Layer: 5 - m_Name: Scrollbar Vertical - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1630070227 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1630070226} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 171673124} - m_Father: {fileID: 938764178} - m_RootOrder: 2 - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 0} - m_Pivot: {x: 1, y: 1} ---- !u!114 &1630070228 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1630070226} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -2061169968, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 778155057} - m_HandleRect: {fileID: 778155056} - m_Direction: 2 - m_Value: 0 - m_Size: 1 - m_NumberOfSteps: 0 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &1630070229 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1630070226} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1630070230 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1630070226} ---- !u!1 &1753437437 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1753437438} - - 222: {fileID: 1753437441} - - 114: {fileID: 1753437440} - - 114: {fileID: 1753437439} - m_Layer: 5 - m_Name: Scrollbar Horizontal - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1753437438 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1753437437} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 696232501} - m_Father: {fileID: 938764178} - m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 20} - m_Pivot: {x: 0, y: 0} ---- !u!114 &1753437439 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1753437437} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -2061169968, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2025647370} - m_HandleRect: {fileID: 2025647372} - m_Direction: 0 - m_Value: 0 - m_Size: 1 - m_NumberOfSteps: 0 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &1753437440 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1753437437} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1753437441 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1753437437} ---- !u!1 &1785935267 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1785935269} - - 114: {fileID: 1785935268} - - 114: {fileID: 1785935270} - m_Layer: 0 - m_Name: Network - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1785935268 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785935267} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7d2b44c570cb28644b8762e0b13e7c23, type: 3} - m_Name: - m_EditorClassIdentifier: - address: 127.0.0.1 - port: 4296 - ipVersion: 0 - autoConnect: 1 - invokeFromDispatcher: 1 - sniffData: 0 - maxCachedWriters: 2 - maxCachedReaders: 2 - maxCachedMessages: 8 - maxCachedSocketAsyncEventArgs: 32 ---- !u!4 &1785935269 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785935267} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!114 &1785935270 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1785935267} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2866a2b8036cc3742ae772a23a3d8a4d, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 1785935268} - input: {fileID: 1319321232} - chatWindow: {fileID: 188165983} - scrollRect: {fileID: 938764182} - messagePrefab: {fileID: 109844, guid: 710fd1950a4bb354b86d8ca2434d71ae, type: 2} ---- !u!1 &1956900149 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 1956900150} - - 222: {fileID: 1956900153} - - 114: {fileID: 1956900152} - - 114: {fileID: 1956900151} - m_Layer: 5 - m_Name: Panel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1956900150 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1956900149} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 938764178} - - {fileID: 1319321231} - m_Father: {fileID: 1555507193} - m_RootOrder: 0 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 300, y: 200} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1956900151 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1956900149} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1297475563, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 0 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 ---- !u!114 &1956900152 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1956900149} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.392} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1956900153 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1956900149} ---- !u!1 &2025647369 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 224: {fileID: 2025647372} - - 222: {fileID: 2025647371} - - 114: {fileID: 2025647370} - m_Layer: 5 - m_Name: Handle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &2025647370 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2025647369} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &2025647371 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2025647369} ---- !u!224 &2025647372 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2025647369} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 696232501} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 20} - m_Pivot: {x: 0.5, y: 0.5} diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.unity.meta b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.unity.meta deleted file mode 100644 index 75a1680..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ChatDemo.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 31c70d0d9b36a2f42be7c30b0449c3aa -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/MessagePrefab.prefab b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/MessagePrefab.prefab deleted file mode 100644 index 671ba0c..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/MessagePrefab.prefab +++ /dev/null @@ -1,85 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &109844 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 224: {fileID: 22406154} - - 222: {fileID: 22224294} - - 114: {fileID: 11430846} - m_Layer: 5 - m_Name: MessagePrefab - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &11430846 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 109844} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: New Text ---- !u!222 &22224294 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 109844} ---- !u!224 &22406154 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 109844} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 109844} - m_IsPrefabParent: 1 diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/MessagePrefab.prefab.meta b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/MessagePrefab.prefab.meta deleted file mode 100644 index bca19cf..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/MessagePrefab.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 710fd1950a4bb354b86d8ca2434d71ae -timeCreated: 1509748074 -licenseType: Free -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ReadMe.txt b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ReadMe.txt deleted file mode 100644 index db49e72..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ReadMe.txt +++ /dev/null @@ -1,9 +0,0 @@ -The ChatDemo demonstrates a simple chat application. - -To run, start a DarkRift server on your local machine and type: - demo -to instruct the DarkRift server to act passively and simply forward on all messages to all clients. - -If you haven't already done so, set RunInBackground to true in your Unity project settings. - -You can now build the ChatDemo scene and run a few copies locally. You should see messages appear on all instances. \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ReadMe.txt.meta b/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ReadMe.txt.meta deleted file mode 100644 index 34c46de..0000000 --- a/DarkRift.Unity/Assets/DarkRift/1 ChatDemo/ReadMe.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4fa955e33999bf14dad22183142630e1 -timeCreated: 1509748077 -licenseType: Free -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo.meta b/DarkRift.Unity/Assets/DarkRift/2 DragDemo.meta deleted file mode 100644 index 7a7dbbd..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: c583046a24760bb478407505bea6f0ff -folderAsset: yes -timeCreated: 1509748063 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragDemo.unity b/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragDemo.unity deleted file mode 100644 index 7079695..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragDemo.unity +++ /dev/null @@ -1,790 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 8 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 0 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_LightmapEditorSettings: - serializedVersion: 9 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 0 - m_CompAOExponentDirect: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_MixedBakeMode: 1 - m_BakeBackend: 0 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 - m_PVRBounces: 2 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 0 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 0 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &261488902 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 261488905} - - component: {fileID: 261488904} - - component: {fileID: 261488903} - - component: {fileID: 261488906} - m_Layer: 0 - m_Name: Object 4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &261488903 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 261488902} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: da246fd0c32c2ef4bad90f8376c0b003, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 2099489286} - dragID: 3 - speed: 15 ---- !u!212 &261488904 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 261488902} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 ---- !u!4 &261488905 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 261488902} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.5, y: 0.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!61 &261488906 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 261488902} - m_Enabled: 1 - m_Density: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} - m_SpriteTilingProperty: - border: {x: 0, y: 0, z: 0, w: 0} - pivot: {x: 0.5, y: 0.5} - oldSize: {x: 0.2, y: 0.2} - newSize: {x: 1, y: 1} - adaptiveTilingThreshold: 0.5 - drawMode: 0 - adaptiveTiling: 0 - m_AutoTiling: 0 - serializedVersion: 2 - m_Size: {x: 0.2, y: 0.2} - m_EdgeRadius: 0 ---- !u!1 &694891715 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 694891718} - - component: {fileID: 694891717} - - component: {fileID: 694891716} - - component: {fileID: 694891719} - m_Layer: 0 - m_Name: Object 3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &694891716 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 694891715} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: da246fd0c32c2ef4bad90f8376c0b003, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 2099489286} - dragID: 2 - speed: 15 ---- !u!212 &694891717 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 694891715} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 ---- !u!4 &694891718 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 694891715} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.5, y: 0.5, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!61 &694891719 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 694891715} - m_Enabled: 1 - m_Density: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} - m_SpriteTilingProperty: - border: {x: 0, y: 0, z: 0, w: 0} - pivot: {x: 0.5, y: 0.5} - oldSize: {x: 0.2, y: 0.2} - newSize: {x: 1, y: 1} - adaptiveTilingThreshold: 0.5 - drawMode: 0 - adaptiveTiling: 0 - m_AutoTiling: 0 - serializedVersion: 2 - m_Size: {x: 0.2, y: 0.2} - m_EdgeRadius: 0 ---- !u!1 &1032588003 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1032588008} - - component: {fileID: 1032588007} - - component: {fileID: 1032588006} - - component: {fileID: 1032588005} - - component: {fileID: 1032588004} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1032588004 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1032588003} - m_Enabled: 1 ---- !u!124 &1032588005 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1032588003} - m_Enabled: 1 ---- !u!92 &1032588006 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1032588003} - m_Enabled: 1 ---- !u!20 &1032588007 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1032588003} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 1 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &1032588008 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1032588003} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.5, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1083905464 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1083905466} - - component: {fileID: 1083905465} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1083905465 -Light: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1083905464} - m_Enabled: 1 - serializedVersion: 8 - m_Type: 1 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1083905466 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1083905464} - m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1395738217 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1395738220} - - component: {fileID: 1395738219} - - component: {fileID: 1395738218} - - component: {fileID: 1395738221} - m_Layer: 0 - m_Name: Object 2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1395738218 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1395738217} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: da246fd0c32c2ef4bad90f8376c0b003, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 2099489286} - dragID: 1 - speed: 15 ---- !u!212 &1395738219 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1395738217} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 ---- !u!4 &1395738220 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1395738217} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!61 &1395738221 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1395738217} - m_Enabled: 1 - m_Density: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} - m_SpriteTilingProperty: - border: {x: 0, y: 0, z: 0, w: 0} - pivot: {x: 0.5, y: 0.5} - oldSize: {x: 0.2, y: 0.2} - newSize: {x: 1, y: 1} - adaptiveTilingThreshold: 0.5 - drawMode: 0 - adaptiveTiling: 0 - m_AutoTiling: 0 - serializedVersion: 2 - m_Size: {x: 0.2, y: 0.2} - m_EdgeRadius: 0 ---- !u!1 &2021903089 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 2021903092} - - component: {fileID: 2021903091} - - component: {fileID: 2021903090} - - component: {fileID: 2021903093} - m_Layer: 0 - m_Name: Object 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &2021903090 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2021903089} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: da246fd0c32c2ef4bad90f8376c0b003, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 2099489286} - dragID: 0 - speed: 15 ---- !u!212 &2021903091 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2021903089} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 ---- !u!4 &2021903092 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2021903089} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!61 &2021903093 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2021903089} - m_Enabled: 1 - m_Density: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} - m_SpriteTilingProperty: - border: {x: 0, y: 0, z: 0, w: 0} - pivot: {x: 0.5, y: 0.5} - oldSize: {x: 0.2, y: 0.2} - newSize: {x: 1, y: 1} - adaptiveTilingThreshold: 0.5 - drawMode: 0 - adaptiveTiling: 0 - m_AutoTiling: 0 - serializedVersion: 2 - m_Size: {x: 0.2, y: 0.2} - m_EdgeRadius: 0 ---- !u!1 &2099489285 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 2099489287} - - component: {fileID: 2099489286} - m_Layer: 0 - m_Name: Network - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &2099489286 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2099489285} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7d2b44c570cb28644b8762e0b13e7c23, type: 3} - m_Name: - m_EditorClassIdentifier: - host: 127.0.0.1 - port: 4296 - noDelay: 0 - connectOnStart: 1 - eventsFromDispatcher: 1 - sniffData: 0 - objectCacheSettings: - maxWriters: 2 - maxReaders: 2 - maxMessages: 4 - maxMessageBuffers: 4 - maxSocketAsyncEventArgs: 32 - maxActionDispatcherTasks: 16 - maxAutoRecyclingArrays: 4 - extraSmallMemoryBlockSize: 16 - maxExtraSmallMemoryBlocks: 2 - smallMemoryBlockSize: 64 - maxSmallMemoryBlocks: 2 - mediumMemoryBlockSize: 256 - maxMediumMemoryBlocks: 2 - largeMemoryBlockSize: 1024 - maxLargeMemoryBlocks: 2 - extraLargeMemoryBlockSize: 4096 - maxExtraLargeMemoryBlocks: 2 - maxMessageReceivedEventArgs: 4 ---- !u!4 &2099489287 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2099489285} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragDemo.unity.meta b/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragDemo.unity.meta deleted file mode 100644 index 81ba2fc..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragDemo.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 78d3a40c48875094ebcf4b2775f9ed50 -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragObject.cs b/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragObject.cs deleted file mode 100644 index 84f9b10..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragObject.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using DarkRift; -using DarkRift.Client; -using DarkRift.Client.Unity; -using UnityEngine; - -public class DragObject : MonoBehaviour -{ - /// - /// The tag indicating a movement of the object. - /// - const ushort MOVE_TAG = 0; - - [SerializeField] - [Tooltip("The client to communicate with the server via.")] - UnityClient client; - - [SerializeField] - [Tooltip("The ID to identify this object across the network using")] - byte dragID; - - [SerializeField] - [Tooltip("The speed at which the object will drag at.")] - float speed = 15; - - /// - /// This will be an object used to smoothly move between positions. - /// - Vector3 targetPosition; - - void Awake () - { - //Check we have a client to send/receive from - if (client == null) - { - Debug.LogError("No client assigned to DragObject!"); - return; - } - - //Subscribe to the event for when we receive messages - client.MessageReceived += Client_MessageReceived; - - //Set our default target position to our current position - targetPosition = transform.position; - } - - void Update() - { - //Lerp between positions to create a smoother transition - transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * speed); - } - - void Client_MessageReceived(object sender, MessageReceivedEventArgs e) - { - using (Message message = e.GetMessage() as Message) - { - //Check the message has a zero tag - if (message.Tag == MOVE_TAG) - { - //Get the reader from the message so we can read the data - using (DarkRiftReader reader = message.GetReader()) - { - //If it's for us... - if (reader.ReadByte() == dragID) - { - //... then update our position! - targetPosition = new Vector3(reader.ReadSingle(), reader.ReadSingle(), 0); - } - } - } - } - } - - //Called when the object is dragged by the mouse - void OnMouseDrag () - { - //Check we have a client to send from - if (client == null) - { - Debug.LogError("No client assigned to DragObject!"); - return; - } - - //Firstly we need to work out where the object should be, we can ignore the z-coord returned - Vector3 newPos = Camera.main.ScreenPointToRay(Input.mousePosition).GetPoint(10); - - //We want to send the new position of the object to the other clients so we write our ID and - //our position (as x, y and z components) into a DarkRiftWriter - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(dragID); - writer.Write(newPos.x); - writer.Write(newPos.y); - - //Then we'll create a new message and put the DarkRiftWriter into it. - //The tag indicates what the message is about so we'll put a tag of '0' to indicate a - //movement. - using (Message message = Message.Create(MOVE_TAG, writer)) - { - //We can then send the message - client.SendMessage(message, SendMode.Unreliable); - } - } - - //Last but not least we'll actually move the object on our screen so set the target position to - //the new position - targetPosition = new Vector3(newPos.x, newPos.y, 0); - } -} diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragObject.cs.meta b/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragObject.cs.meta deleted file mode 100644 index a53e2d1..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/DragObject.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: da246fd0c32c2ef4bad90f8376c0b003 -timeCreated: 1509748072 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/ReadMe.txt b/DarkRift.Unity/Assets/DarkRift/2 DragDemo/ReadMe.txt deleted file mode 100644 index 0b3b623..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/ReadMe.txt +++ /dev/null @@ -1,10 +0,0 @@ -The DragDemo shows basic synchronization between clients. - -To run, start a DarkRift server on your local machine and type: - demo -to instruct the DarkRift server to act passively and simply forward on all messages to all clients. - -If you haven't already done so, set RunInBackground to true in your Unity project settings. - -You can now build the DragDemo scene and run a few copies locally. You should see the icons move as you drag one -on another client. \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/ReadMe.txt.meta b/DarkRift.Unity/Assets/DarkRift/2 DragDemo/ReadMe.txt.meta deleted file mode 100644 index 5d739e9..0000000 --- a/DarkRift.Unity/Assets/DarkRift/2 DragDemo/ReadMe.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5bab2882cc1ceea4baf4180b3e88683f -timeCreated: 1509748077 -licenseType: Free -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo.meta deleted file mode 100644 index 9516bfd..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d2d8206de2a6c37419ff52c1154fb3cf -folderAsset: yes -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio.meta deleted file mode 100644 index 339482e..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 3e9c887436a1a154890cc62c203281ea -folderAsset: yes -timeCreated: 1528884556 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep01.wav b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep01.wav deleted file mode 100644 index 6e52e70..0000000 Binary files a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep01.wav and /dev/null differ diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep01.wav.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep01.wav.meta deleted file mode 100644 index 0eb2e49..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep01.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: 0250597bc237c40408317d0dfec98cda -timeCreated: 1528884564 -licenseType: Free -AudioImporter: - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep02.wav b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep02.wav deleted file mode 100644 index 6ed5b8c..0000000 Binary files a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep02.wav and /dev/null differ diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep02.wav.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep02.wav.meta deleted file mode 100644 index 0552306..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep02.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: eb6f82c8c4f340946ba75047babb374b -timeCreated: 1528884565 -licenseType: Free -AudioImporter: - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep03.wav b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep03.wav deleted file mode 100644 index f796749..0000000 Binary files a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep03.wav and /dev/null differ diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep03.wav.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep03.wav.meta deleted file mode 100644 index 7189c73..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep03.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: d2cb0372d15670a4dbf0ee30354f83a6 -timeCreated: 1528884564 -licenseType: Free -AudioImporter: - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep04.wav b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep04.wav deleted file mode 100644 index 657f67f..0000000 Binary files a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep04.wav and /dev/null differ diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep04.wav.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep04.wav.meta deleted file mode 100644 index 320d8d3..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Footstep04.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: 21928bb5ea2e5714f897f116eb2c727e -timeCreated: 1528884564 -licenseType: Free -AudioImporter: - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Jump.wav b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Jump.wav deleted file mode 100644 index 3673243..0000000 Binary files a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Jump.wav and /dev/null differ diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Jump.wav.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Jump.wav.meta deleted file mode 100644 index cce8a83..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Jump.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: eac68be8b2388f545b86f5524d973dcd -timeCreated: 1528884565 -licenseType: Free -AudioImporter: - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Land.wav b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Land.wav deleted file mode 100644 index 23d185b..0000000 Binary files a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Land.wav and /dev/null differ diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Land.wav.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Land.wav.meta deleted file mode 100644 index 8020de7..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Audio/Land.wav.meta +++ /dev/null @@ -1,22 +0,0 @@ -fileFormatVersion: 2 -guid: ba98294aa90d0274181a08f2e7d2a677 -timeCreated: 1528884564 -licenseType: Free -AudioImporter: - serializedVersion: 6 - defaultSettings: - loadType: 0 - sampleRateSetting: 0 - sampleRateOverride: 44100 - compressionFormat: 1 - quality: 1 - conversionMode: 0 - platformSettingOverrides: {} - forceToMono: 0 - normalize: 1 - preloadAudioData: 1 - loadInBackground: 0 - 3D: 1 - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Block.prefab b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Block.prefab deleted file mode 100644 index 4faf9bb..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Block.prefab +++ /dev/null @@ -1,86 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &177104 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 480074} - - 33: {fileID: 3339574} - - 65: {fileID: 6553598} - - 23: {fileID: 2355524} - m_Layer: 0 - m_Name: Block - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &480074 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 177104} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 ---- !u!23 &2355524 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 177104} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 1 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &3339574 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 177104} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &6553598 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 177104} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 177104} - m_IsPrefabParent: 1 diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Block.prefab.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Block.prefab.meta deleted file mode 100644 index 80a4591..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/Block.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9e6bf22459c792f47a2eb3df85bc3ba1 -timeCreated: 1528884563 -licenseType: Free -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacter.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacter.cs deleted file mode 100644 index d5bbd65..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacter.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using DarkRift; -using DarkRift.Client.Unity; -using UnityEngine; - -/// -/// Handles a controllable character. -/// -internal class BlockCharacter : MonoBehaviour -{ - /// - /// The DarkRift client to send data though. - /// - UnityClient client; - - /// - /// The ID of this player. - /// - public ushort PlayerID { get; set; } - - /// - /// The world this player is in. - /// - BlockWorld blockWorld; - - /// - /// The last position our character was at. - /// - Vector3 lastPosition; - - /// - /// The last rotation our character was at. - /// - Vector3 lastRotation; - - void Update () - { - if (client == null) - { - Debug.LogError("No client assigned to BlockCharacter component!"); - return; - } - - if (PlayerID == client.ID) - { - if (Vector3.SqrMagnitude(transform.position - lastPosition) > 0.1f || - Vector3.SqrMagnitude(transform.eulerAngles - lastRotation) > 5f) - SendTransform(); - - if (Input.GetMouseButtonDown(0)) - { - //Get a point 2 meters in front of the center-point of the camera - Vector3 pos = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2, Screen.height / 2, 2f)); - - //Destroy the block there! - blockWorld.DestroyBlock(pos); - } - - if (Input.GetMouseButtonDown(1)) - { - //Get a point 2 meters in front of the center-point of the camera - Vector3 pos = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width/2, Screen.height/2, 2f)); - - //Place a block there! - blockWorld.AddBlock(pos); - } - } - } - - /// - /// Sets up the character with necessary references. - /// - /// The client to send data using. - /// The block world reference. - public void Setup(UnityClient client, BlockWorld blockWorld) - { - this.client = client; - - this.blockWorld = blockWorld; - } - - /// - /// Sends the position and rotation of this character. - /// - void SendTransform() - { - //Serialize - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(transform.position.x); - writer.Write(transform.position.y); - writer.Write(transform.position.z); - writer.Write(transform.eulerAngles.x); - writer.Write(transform.eulerAngles.y); - writer.Write(transform.eulerAngles.z); - - //Send - using (Message message = Message.Create(BlockTags.Movement, writer)) - client.SendMessage(message, SendMode.Unreliable); - } - - //Store last values sent - lastPosition = transform.position; - lastRotation = transform.eulerAngles; - } -} diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacter.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacter.cs.meta deleted file mode 100644 index 11e118c..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6c72f240a1c46f54585a73d53c1c7b89 -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacterManager.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacterManager.cs deleted file mode 100644 index 92e08a8..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacterManager.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using DarkRift; -using DarkRift.Client; -using DarkRift.Client.Unity; -using System.Collections.Generic; -using UnityEngine; -using System; - -/// -/// Handles the synchronization of other player's characters. -/// -internal class BlockCharacterManager : MonoBehaviour -{ - /// - /// The unit client we communicate via. - /// - [SerializeField] - [Tooltip("The client to communicate with the server via.")] - UnityClient client; - - /// - /// The characters we are managing. - /// - Dictionary characters = new Dictionary(); - - void Awake() - { - if (client == null) - { - Debug.LogError("No client assigned to BlockPlayerSpawner component!"); - return; - } - - client.MessageReceived += Client_MessageReceived; - } - - /// - /// Called when a message is received from the server. - /// - /// - /// - void Client_MessageReceived(object sender, MessageReceivedEventArgs e) - { - using (Message message = e.GetMessage() as Message) - { - //Check the tag - if (message.Tag == BlockTags.Movement) - { - using (DarkRiftReader reader = message.GetReader()) - { - //Read message - Vector3 newPosition = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); - Vector3 newRotation = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); - ushort id = reader.ReadUInt16(); - - //Update characters to move to new positions - characters[id].NewPosition = newPosition; - characters[id].NewRotation = newRotation; - } - } - } - } - - /// - /// Adds a character to the list of those we're managing. - /// - /// The ID of the owning player. - /// The character to synchronize. - public void AddCharacter(ushort id, BlockNetworkCharacter character) - { - characters.Add(id, character); - } - - /// - /// Removes a character from the list of those we're managing. - /// - /// The ID of the owning player. - public void RemoveCharacter(ushort id) - { - Destroy(characters[id].gameObject); - characters.Remove(id); - } - - /// - /// Removes all characters that are being managded. - /// - internal void RemoveAllCharacters() - { - foreach (BlockNetworkCharacter character in characters.Values) - Destroy(character.gameObject); - - characters.Clear(); - } -} - diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacterManager.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacterManager.cs.meta deleted file mode 100644 index 58e6172..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockCharacterManager.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 24c5968ac17f0de47abbab3e25c69fec -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockDemo.unity b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockDemo.unity deleted file mode 100644 index d6acb9e..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockDemo.unity +++ /dev/null @@ -1,272 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -SceneSettings: - m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_GIWorkflowMode: 0 - m_LightmapsMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_LightmapEditorSettings: - serializedVersion: 3 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AOMaxDistance: 1 - m_Padding: 2 - m_CompAOExponent: 0 - m_LightmapParameters: {fileID: 0} - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - accuratePlacement: 0 - minRegionArea: 2 - cellSize: 0.16666667 - manualCellSize: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &85180821 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 85180823} - - 114: {fileID: 85180822} - - 114: {fileID: 85180824} - - 114: {fileID: 85180825} - m_Layer: 0 - m_Name: Network - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &85180822 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 85180821} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7d2b44c570cb28644b8762e0b13e7c23, type: 3} - m_Name: - m_EditorClassIdentifier: - address: 127.0.0.1 - port: 4296 - ipVersion: 0 - autoConnect: 1 - invokeFromDispatcher: 1 - sniffData: 0 - maxCachedWriters: 2 - maxCachedReaders: 2 - maxCachedMessages: 8 - maxCachedSocketAsyncEventArgs: 32 - maxCachedActionDispatcherTasks: 16 ---- !u!4 &85180823 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 85180821} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!114 &85180824 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 85180821} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 24c5968ac17f0de47abbab3e25c69fec, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 85180822} ---- !u!114 &85180825 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 85180821} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0047941e864139643aa2eebe0e4a8746, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 85180822} - blockWorld: {fileID: 1023421811} - playerPrefab: {fileID: 184142, guid: b63b28c40086bde4793655fb24083018, type: 2} - networkPlayerPrefab: {fileID: 197266, guid: 5e3e682b361328742adf17eacaeec598, type: 2} - characterManager: {fileID: 85180824} ---- !u!1 &1023421810 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1023421812} - - 114: {fileID: 1023421811} - m_Layer: 0 - m_Name: World - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1023421811 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1023421810} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b34cbc69e0eb1ad4d8853897cdbf94b7, type: 3} - m_Name: - m_EditorClassIdentifier: - client: {fileID: 85180822} - blockPrefab: {fileID: 177104, guid: 9e6bf22459c792f47a2eb3df85bc3ba1, type: 2} ---- !u!4 &1023421812 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1023421810} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!1 &1258217236 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1258217238} - - 108: {fileID: 1258217237} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1258217237 -Light: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1258217236} - m_Enabled: 1 - serializedVersion: 6 - m_Type: 1 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_BounceIntensity: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} ---- !u!4 &1258217238 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1258217236} - m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockDemo.unity.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockDemo.unity.meta deleted file mode 100644 index e8e8b58..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockDemo.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 03a1c5ab7b1408e4a9b3b7905b184093 -timeCreated: 1528884556 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockNetworkCharacter.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockNetworkCharacter.cs deleted file mode 100644 index 1d5e923..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockNetworkCharacter.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using UnityEngine; - -/// -/// Manages the movement of another player's character. -/// -internal class BlockNetworkCharacter : MonoBehaviour -{ - /// - /// The speed to lerp the player's position. - /// - [SerializeField] - [Tooltip("The speed to lerp the player's position")] - public float moveLerpSpeed = 10f; - - /// - /// The speed to lerp the player's rotation. - /// - [SerializeField] - [Tooltip("The speed to lerp the player's rotation")] - public float rotateLerpSpeed = 50f; - - /// - /// The position to lerp to. - /// - public Vector3 NewPosition { get; set; } - - /// - /// The rotation to lerp to. - /// - public Vector3 NewRotation { get; set; } - - void Awake() - { - //Set initial values - NewPosition = transform.position; - NewRotation = transform.eulerAngles; - } - - void Update() - { - //Move and rotate to new values - transform.position = Vector3.Lerp(transform.position, NewPosition, Time.deltaTime * moveLerpSpeed); - transform.eulerAngles = new Vector3( - Mathf.LerpAngle(transform.eulerAngles.x, NewRotation.x, Time.deltaTime * rotateLerpSpeed), - Mathf.LerpAngle(transform.eulerAngles.y, NewRotation.y, Time.deltaTime * rotateLerpSpeed), - Mathf.LerpAngle(transform.eulerAngles.z, NewRotation.z, Time.deltaTime * rotateLerpSpeed) - ); - } -} - diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockNetworkCharacter.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockNetworkCharacter.cs.meta deleted file mode 100644 index 31779b5..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockNetworkCharacter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: baa759ff624cc8a4b9b5f15f4f6c6faa -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockPlayerSpawner.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockPlayerSpawner.cs deleted file mode 100644 index 1de6368..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockPlayerSpawner.cs +++ /dev/null @@ -1,164 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using DarkRift; -using DarkRift.Client; -using DarkRift.Client.Unity; -using UnityEngine; - -/// -/// Spawns players in the game. -/// -internal class BlockPlayerSpawner : MonoBehaviour -{ - /// - /// The client to communicate with the server via. - /// - [SerializeField] - [Tooltip("The client to communicate with the server via.")] - UnityClient client; - - /// - /// The block world in the scene. - /// - [SerializeField] - [Tooltip("The block world in the scene.")] - BlockWorld blockWorld; - - /// - /// The player object to spawn for our player. - /// - [SerializeField] - [Tooltip("The player object to spawn.")] - GameObject playerPrefab; - - /// - /// The player object to spawn for others' players. - /// - [SerializeField] - [Tooltip("The network player object to spawn.")] - GameObject networkPlayerPrefab; - - /// - /// The character manager for network players. - /// - [SerializeField] - [Tooltip("The network player manager.")] - BlockCharacterManager characterManager; - - void Awake() - { - if (client == null) - { - Debug.LogError("No client assigned to BlockPlayerSpawner component!"); - return; - } - - client.MessageReceived += Client_MessageReceived; - client.Disconnected += Client_Disconnected; - } - - /// - /// Invoked when a message is received from the server. - /// - /// - /// - void Client_MessageReceived(object sender, MessageReceivedEventArgs e) - { - using (Message message = e.GetMessage() as Message) - { - //Spawn or despawn the player as necessary. - if (message.Tag == BlockTags.SpawnPlayer) - { - using (DarkRiftReader reader = message.GetReader()) - SpawnPlayer(reader); - } - else if (message.Tag == BlockTags.DespawnSplayer) - { - using (DarkRiftReader reader = message.GetReader()) - DespawnPlayer(reader); - } - } - } - - /// - /// Called when we disconnect from the server. - /// - /// - /// - void Client_Disconnected(object sender, DisconnectedEventArgs e) - { - //If we disconnect then we need to destroy everything! - characterManager.RemoveAllCharacters(); - blockWorld.RemoveAllBlocks(); - } - - /// - /// Spawns a new player from the data received from the server. - /// - /// The reader from the server. - void SpawnPlayer(DarkRiftReader reader) - { - //Extract the positions - Vector3 position = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); - Vector3 rotation = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); - - //Extract their ID - ushort id = reader.ReadUInt16(); - - //If it's a player for us then spawn us our prefab and set it up - if (id == client.ID) - { - GameObject o = Instantiate( - playerPrefab, - position, - Quaternion.Euler(rotation) - ) as GameObject; - - BlockCharacter character = o.GetComponent(); - character.PlayerID = id; - character.Setup(client, blockWorld); - } - //If it's for another player then spawn a network player and and to the manager. - else - { - GameObject o = Instantiate( - networkPlayerPrefab, - position, - Quaternion.Euler(rotation) - ) as GameObject; - - BlockNetworkCharacter character = o.GetComponent(); - characterManager.AddCharacter(id, character); - } - } - - /// - /// Despawns and destroys a player from the data received from the server. - /// - /// The reader from the server. - void DespawnPlayer(DarkRiftReader reader) - { - characterManager.RemoveCharacter(reader.ReadUInt16()); - } -} - diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockPlayerSpawner.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockPlayerSpawner.cs.meta deleted file mode 100644 index 301c97a..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockPlayerSpawner.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0047941e864139643aa2eebe0e4a8746 -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockTags.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockTags.cs deleted file mode 100644 index a1f99c5..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockTags.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -/// -/// The tags used for messages between the server and client. -/// -static class BlockTags -{ - public static readonly ushort SpawnPlayer = 0; - public static readonly ushort DespawnSplayer = 1; - public static readonly ushort Movement = 2; - public static readonly ushort PlaceBlock = 3; - public static readonly ushort DestroyBlock = 4; -} diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockTags.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockTags.cs.meta deleted file mode 100644 index bc288b5..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockTags.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 68b208d28f9be26428063422a561692e -timeCreated: 1527595989 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockWorld.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockWorld.cs deleted file mode 100644 index e66a290..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockWorld.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using DarkRift; -using DarkRift.Client; -using DarkRift.Client.Unity; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -using System; - -/// -/// Manages the world of blocks. -/// -internal class BlockWorld : MonoBehaviour -{ - /// - /// The client to communicate with the server via. - /// - [SerializeField] - [Tooltip("The client to communicate with the server via.")] - UnityClient client; - - /// - /// The block prefab to spawn in the world. - /// - [SerializeField] - [Tooltip("The block object to spawn.")] - GameObject blockPrefab; - - /// - /// The list of blocks spawned. - /// - List blocks = new List(); - - void Awake() - { - if (client == null) - { - Debug.LogError("No client assigned to BlockWorld component!"); - return; - } - - client.MessageReceived += Client_MessageReceived; - } - - /// - /// INvoked when the server receives a message. - /// - /// - /// - void Client_MessageReceived(object sender, MessageReceivedEventArgs e) - { - using (Message message = e.GetMessage() as Message) - { - //If we're placing a block we need to instantiate our prefab - if (message.Tag == BlockTags.PlaceBlock) - { - using (DarkRiftReader reader = message.GetReader()) - { - Vector3 position = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); - - GameObject o = Instantiate( - blockPrefab, - position, - Quaternion.identity - ) as GameObject; - - o.transform.SetParent(transform); - - blocks.Add(o); - - } - } - //If we're destroying we need to find the block and destroy it - else if (message.Tag == BlockTags.DestroyBlock) - { - using (DarkRiftReader reader = message.GetReader()) - { - Vector3 position = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); - - GameObject block = blocks.SingleOrDefault(b => b != null && b.transform.position == position); - - if (block == null) - return; - - Destroy(block); - - blocks.Remove(block); - } - - } - } - } - - internal void AddBlock(Vector3 position) - { - if (client == null) - { - Debug.LogError("No client assigned to BlockWorld component!"); - return; - } - - //Don't worry about snapping, we'll do that on the server - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(position.x); - writer.Write(position.y); - writer.Write(position.z); - - using (Message message = Message.Create(BlockTags.PlaceBlock, writer)) - client.SendMessage(message, SendMode.Reliable); - } - } - - internal void DestroyBlock(Vector3 position) - { - if (client == null) - { - Debug.LogError("No client assigned to BlockWorld component!"); - return; - } - - //Don't worry about snapping, we'll do that on the server - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - writer.Write(position.x); - writer.Write(position.y); - writer.Write(position.z); - - using (Message message = Message.Create(BlockTags.DestroyBlock, writer)) - client.SendMessage(message, SendMode.Reliable); - } - } - - internal void RemoveAllBlocks() - { - foreach (GameObject block in blocks) - Destroy(block); - - blocks.Clear(); - } -} diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockWorld.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockWorld.cs.meta deleted file mode 100644 index 7ca2434..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/BlockWorld.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b34cbc69e0eb1ad4d8853897cdbf94b7 -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/FirstPersonController.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/FirstPersonController.cs deleted file mode 100644 index 11a71ba..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/FirstPersonController.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using UnityEngine; -using Random = UnityEngine.Random; - -namespace UnityStandardAssets.Characters.FirstPerson -{ - [RequireComponent(typeof (CharacterController))] - [RequireComponent(typeof (AudioSource))] - public class FirstPersonController : MonoBehaviour - { - [SerializeField] private bool m_IsWalking; - [SerializeField] private float m_WalkSpeed; - [SerializeField] private float m_RunSpeed; - [SerializeField] [Range(0f, 1f)] private float m_RunstepLenghten; - [SerializeField] private float m_JumpSpeed; - [SerializeField] private float m_StickToGroundForce; - [SerializeField] private float m_GravityMultiplier; - [SerializeField] private MouseLook m_MouseLook; - [SerializeField] private float m_StepInterval; - [SerializeField] private AudioClip[] m_FootstepSounds; // an array of footstep sounds that will be randomly selected from. - [SerializeField] private AudioClip m_JumpSound; // the sound played when character leaves the ground. - [SerializeField] private AudioClip m_LandSound; // the sound played when character touches back on ground. - - private Camera m_Camera; - private bool m_Jump; - private float m_YRotation; - private Vector2 m_Input; - private Vector3 m_MoveDir = Vector3.zero; - private CharacterController m_CharacterController; - private CollisionFlags m_CollisionFlags; - private bool m_PreviouslyGrounded; - private float m_StepCycle; - private float m_NextStep; - private bool m_Jumping; - private AudioSource m_AudioSource; - - // Use this for initialization - private void Start() - { - m_CharacterController = GetComponent(); - m_Camera = Camera.main; - m_StepCycle = 0f; - m_NextStep = m_StepCycle/2f; - m_Jumping = false; - m_AudioSource = GetComponent(); - m_MouseLook.Init(transform , m_Camera.transform); - } - - - // Update is called once per frame - private void Update() - { - RotateView(); - // the jump state needs to read here to make sure it is not missed - if (!m_Jump) - { - m_Jump = Input.GetButtonDown("Jump"); - } - - if (!m_PreviouslyGrounded && m_CharacterController.isGrounded) - { - PlayLandingSound(); - m_MoveDir.y = 0f; - m_Jumping = false; - } - if (!m_CharacterController.isGrounded && !m_Jumping && m_PreviouslyGrounded) - { - m_MoveDir.y = 0f; - } - - m_PreviouslyGrounded = m_CharacterController.isGrounded; - } - - - private void PlayLandingSound() - { - m_AudioSource.clip = m_LandSound; - m_AudioSource.Play(); - m_NextStep = m_StepCycle + .5f; - } - - - private void FixedUpdate() - { - float speed; - GetInput(out speed); - // always move along the camera forward as it is the direction that it being aimed at - Vector3 desiredMove = transform.forward*m_Input.y + transform.right*m_Input.x; - - // get a normal for the surface that is being touched to move along it - RaycastHit hitInfo; - Physics.SphereCast(transform.position, m_CharacterController.radius, Vector3.down, out hitInfo, - m_CharacterController.height/2f, Physics.AllLayers, QueryTriggerInteraction.Ignore); - desiredMove = Vector3.ProjectOnPlane(desiredMove, hitInfo.normal).normalized; - - m_MoveDir.x = desiredMove.x*speed; - m_MoveDir.z = desiredMove.z*speed; - - - if (m_CharacterController.isGrounded) - { - m_MoveDir.y = -m_StickToGroundForce; - - if (m_Jump) - { - m_MoveDir.y = m_JumpSpeed; - PlayJumpSound(); - m_Jump = false; - m_Jumping = true; - } - } - else - { - m_MoveDir += Physics.gravity*m_GravityMultiplier*Time.fixedDeltaTime; - } - m_CollisionFlags = m_CharacterController.Move(m_MoveDir*Time.fixedDeltaTime); - - ProgressStepCycle(speed); - - m_MouseLook.UpdateCursorLock(); - } - - - private void PlayJumpSound() - { - m_AudioSource.clip = m_JumpSound; - m_AudioSource.Play(); - } - - - private void ProgressStepCycle(float speed) - { - if (m_CharacterController.velocity.sqrMagnitude > 0 && (m_Input.x != 0 || m_Input.y != 0)) - { - m_StepCycle += (m_CharacterController.velocity.magnitude + (speed*(m_IsWalking ? 1f : m_RunstepLenghten)))* - Time.fixedDeltaTime; - } - - if (!(m_StepCycle > m_NextStep)) - { - return; - } - - m_NextStep = m_StepCycle + m_StepInterval; - - PlayFootStepAudio(); - } - - - private void PlayFootStepAudio() - { - if (!m_CharacterController.isGrounded) - { - return; - } - // pick & play a random footstep sound from the array, - // excluding sound at index 0 - int n = Random.Range(1, m_FootstepSounds.Length); - m_AudioSource.clip = m_FootstepSounds[n]; - m_AudioSource.PlayOneShot(m_AudioSource.clip); - // move picked sound to index 0 so it's not picked next time - m_FootstepSounds[n] = m_FootstepSounds[0]; - m_FootstepSounds[0] = m_AudioSource.clip; - } - - private void GetInput(out float speed) - { - // Read input - float horizontal = Input.GetAxis("Horizontal"); - float vertical = Input.GetAxis("Vertical"); - -#if !MOBILE_INPUT - // On standalone builds, walk/run speed is modified by a key press. - // keep track of whether or not the character is walking or running - m_IsWalking = !Input.GetKey(KeyCode.LeftShift); -#endif - // set the desired speed to be walking or running - speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed; - m_Input = new Vector2(horizontal, vertical); - - // normalize input if it exceeds 1 in combined length: - if (m_Input.sqrMagnitude > 1) - { - m_Input.Normalize(); - } - } - - - private void RotateView() - { - m_MouseLook.LookRotation (transform, m_Camera.transform); - } - - - private void OnControllerColliderHit(ControllerColliderHit hit) - { - Rigidbody body = hit.collider.attachedRigidbody; - //dont move the rigidbody if the character is on top of it - if (m_CollisionFlags == CollisionFlags.Below) - { - return; - } - - if (body == null || body.isKinematic) - { - return; - } - body.AddForceAtPosition(m_CharacterController.velocity*0.1f, hit.point, ForceMode.Impulse); - } - } -} diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/FirstPersonController.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/FirstPersonController.cs.meta deleted file mode 100644 index b0402b0..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/FirstPersonController.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1dbf6ca63f69116479b093f67e61fddf -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/MouseLook.cs b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/MouseLook.cs deleted file mode 100644 index b099fdb..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/MouseLook.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using UnityEngine; - -namespace UnityStandardAssets.Characters.FirstPerson -{ - [Serializable] - public class MouseLook - { - public float XSensitivity = 2f; - public float YSensitivity = 2f; - public bool clampVerticalRotation = true; - public float MinimumX = -90F; - public float MaximumX = 90F; - public bool smooth; - public float smoothTime = 5f; - public bool lockCursor = true; - - - private Quaternion m_CharacterTargetRot; - private Quaternion m_CameraTargetRot; - private bool m_cursorIsLocked = true; - - public void Init(Transform character, Transform camera) - { - m_CharacterTargetRot = character.localRotation; - m_CameraTargetRot = camera.localRotation; - } - - - public void LookRotation(Transform character, Transform camera) - { - float yRot = Input.GetAxis("Mouse X") * XSensitivity; - float xRot = Input.GetAxis("Mouse Y") * YSensitivity; - - m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f); - m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); - - if(clampVerticalRotation) - m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot); - - if(smooth) - { - character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot, - smoothTime * Time.deltaTime); - camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot, - smoothTime * Time.deltaTime); - } - else - { - character.localRotation = m_CharacterTargetRot; - camera.localRotation = m_CameraTargetRot; - } - - UpdateCursorLock(); - } - - public void SetCursorLock(bool value) - { - lockCursor = value; - if(!lockCursor) - {//we force unlock the cursor if the user disable the cursor locking helper - Cursor.lockState = CursorLockMode.None; - Cursor.visible = true; - } - } - - public void UpdateCursorLock() - { - //if the user set "lockCursor" we check & properly lock the cursos - if (lockCursor) - InternalLockUpdate(); - } - - private void InternalLockUpdate() - { - if(Input.GetKeyUp(KeyCode.Escape)) - { - m_cursorIsLocked = false; - } - else if(Input.GetMouseButtonUp(0)) - { - m_cursorIsLocked = true; - } - - if (m_cursorIsLocked) - { - Cursor.lockState = CursorLockMode.Locked; - Cursor.visible = false; - } - else if (!m_cursorIsLocked) - { - Cursor.lockState = CursorLockMode.None; - Cursor.visible = true; - } - } - - Quaternion ClampRotationAroundXAxis(Quaternion q) - { - q.x /= q.w; - q.y /= q.w; - q.z /= q.w; - q.w = 1.0f; - - float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x); - - angleX = Mathf.Clamp (angleX, MinimumX, MaximumX); - - q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX); - - return q; - } - - } -} diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/MouseLook.cs.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/MouseLook.cs.meta deleted file mode 100644 index 69f3f94..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/MouseLook.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 02f4f13e1070e01449f5090cbd8abed7 -timeCreated: 1528884556 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/NetworkPlayerPrefab.prefab b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/NetworkPlayerPrefab.prefab deleted file mode 100644 index e993602..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/NetworkPlayerPrefab.prefab +++ /dev/null @@ -1,183 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &197266 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 424750} - - 23: {fileID: 2384694} - - 33: {fileID: 3383740} - - 114: {fileID: 11496708} - - 143: {fileID: 14396172} - - 82: {fileID: 8251580} - m_Layer: 0 - m_Name: NetworkPlayerPrefab - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &424750 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 197266} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 ---- !u!23 &2384694 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 197266} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_Materials: - - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 1 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &3383740 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 197266} - m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!82 &8251580 -AudioSource: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 197266} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 0} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 0 - Mute: 0 - Spatialize: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 ---- !u!114 &11496708 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 197266} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: baa759ff624cc8a4b9b5f15f4f6c6faa, type: 3} - m_Name: - m_EditorClassIdentifier: - moveLerpSpeed: 10 - rotateLerpSpeed: 50 ---- !u!143 &14396172 -CharacterController: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 197266} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Height: 2 - m_Radius: 0.5 - m_SlopeLimit: 45 - m_StepOffset: 0.3 - m_SkinWidth: 0.08 - m_MinMoveDistance: 0.001 - m_Center: {x: 0, y: 0, z: 0} ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 197266} - m_IsPrefabParent: 1 diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/NetworkPlayerPrefab.prefab.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/NetworkPlayerPrefab.prefab.meta deleted file mode 100644 index 78ea1b9..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/NetworkPlayerPrefab.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5e3e682b361328742adf17eacaeec598 -timeCreated: 1528884563 -licenseType: Free -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/PlayerPrefab.prefab b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/PlayerPrefab.prefab deleted file mode 100644 index faefebf..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/PlayerPrefab.prefab +++ /dev/null @@ -1,305 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &109060 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 428166} - - 20: {fileID: 2039118} - - 81: {fileID: 8141024} - m_Layer: 0 - m_Name: FirstPersonCharacter - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &184142 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 446298} - - 143: {fileID: 14394178} - - 114: {fileID: 11491028} - - 54: {fileID: 5408958} - - 82: {fileID: 8244462} - - 23: {fileID: 2309966} - - 33: {fileID: 3385844} - - 114: {fileID: 11491942} - m_Layer: 0 - m_Name: PlayerPrefab - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &428166 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 109060} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.8, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 446298} - m_RootOrder: 0 ---- !u!4 &446298 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 428166} - m_Father: {fileID: 0} - m_RootOrder: 0 ---- !u!20 &2039118 -Camera: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 109060} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!23 &2309966 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_Materials: - - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_UseLightProbes: 1 - m_ReflectionProbeUsage: 1 - m_ProbeAnchor: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &3385844 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!54 &5408958 -Rigidbody: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 1 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!81 &8141024 -AudioListener: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 109060} - m_Enabled: 1 ---- !u!82 &8244462 -AudioSource: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 0} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 0 - Mute: 0 - Spatialize: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 ---- !u!114 &11491028 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6c72f240a1c46f54585a73d53c1c7b89, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &11491942 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1dbf6ca63f69116479b093f67e61fddf, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IsWalking: 0 - m_WalkSpeed: 5 - m_RunSpeed: 10 - m_RunstepLenghten: 0.7 - m_JumpSpeed: 10 - m_StickToGroundForce: 10 - m_GravityMultiplier: 2 - m_MouseLook: - XSensitivity: 2 - YSensitivity: 2 - clampVerticalRotation: 1 - MinimumX: -90 - MaximumX: 90 - smooth: 0 - smoothTime: 5 - lockCursor: 1 - m_StepInterval: 5 - m_FootstepSounds: - - {fileID: 8300000, guid: 0250597bc237c40408317d0dfec98cda, type: 3} - - {fileID: 8300000, guid: eb6f82c8c4f340946ba75047babb374b, type: 3} - - {fileID: 8300000, guid: d2cb0372d15670a4dbf0ee30354f83a6, type: 3} - - {fileID: 8300000, guid: 21928bb5ea2e5714f897f116eb2c727e, type: 3} - m_JumpSound: {fileID: 8300000, guid: eac68be8b2388f545b86f5524d973dcd, type: 3} - m_LandSound: {fileID: 8300000, guid: ba98294aa90d0274181a08f2e7d2a677, type: 3} ---- !u!143 &14394178 -CharacterController: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 184142} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Height: 1.8 - m_Radius: 0.5 - m_SlopeLimit: 45 - m_StepOffset: 0.3 - m_SkinWidth: 0.08 - m_MinMoveDistance: 0 - m_Center: {x: 0, y: 0, z: 0} ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 184142} - m_IsPrefabParent: 1 diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/PlayerPrefab.prefab.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/PlayerPrefab.prefab.meta deleted file mode 100644 index 017d0e9..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/PlayerPrefab.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b63b28c40086bde4793655fb24083018 -timeCreated: 1528884564 -licenseType: Free -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/ReadMe.txt b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/ReadMe.txt deleted file mode 100644 index cd28330..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/ReadMe.txt +++ /dev/null @@ -1,16 +0,0 @@ -The BlockDemo is a more complex Minecraft clone and uses a plugin in DarkRift to authoritatively control the game. - -To run, download the BlockDemoDarkRiftPlugin project from GitHub (linked below), open in Visual Studio and update -the references to your DarkRift files. Build the project and copy the BlockDemoDarkRiftPlugin.dll file into the Plugins -folder of your DarkRift server. - -Run the server. You should it load the plugins on the console: - Loaded plugin BlockDemoPlayerManager version ____ - Loaded plugin BlockDemoWorldManager version ____ - -If you haven't already done so, set RunInBackground to true in your Unity project settings. - -You can now build the BlockDemo scene and run a few copies locally. You should see be able to move and use the mouse buttons -to create/destroy blocks in the world! - -Block Demo Plugin: https://github.com/DarkRiftNetworking/BlockDemoDarkRiftPlugin \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/ReadMe.txt.meta b/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/ReadMe.txt.meta deleted file mode 100644 index cf27505..0000000 --- a/DarkRift.Unity/Assets/DarkRift/3 BlockDemo/ReadMe.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 214bcac45a7f70c4aa1b393e8883a967 -timeCreated: 1509748076 -licenseType: Free -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift.meta deleted file mode 100644 index feb5ed7..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1468b95623d55df41a870eeda6c04c86 -folderAsset: yes -timeCreated: 1509748063 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins.meta deleted file mode 100644 index edb84d2..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a3a2b9a1dade56749a7af23e000af399 -folderAsset: yes -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client.meta deleted file mode 100644 index fced1d7..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 78fc6eb65ed474a418edda0434a9e424 -folderAsset: yes -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor.meta deleted file mode 100644 index c49d678..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 053ae1f25a02600498f06c93d5e10714 -folderAsset: yes -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor/UnityClientEditor.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor/UnityClientEditor.cs.meta deleted file mode 100644 index 7df7489..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/Editor/UnityClientEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f364f49244adcab49b729ccc6a355e97 -timeCreated: 1509748072 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/SerializableObjectCacheSettings.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/SerializableObjectCacheSettings.cs.meta deleted file mode 100644 index 4c1aeff..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/SerializableObjectCacheSettings.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 83a481aa44e1d7b49b07bd3d48ce463f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/UnityClient.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/UnityClient.cs.meta deleted file mode 100644 index a8afc2f..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Client/UnityClient.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7d2b44c570cb28644b8762e0b13e7c23 -timeCreated: 1520171439 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server.meta deleted file mode 100644 index 3f1e614..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: f6b55ed1ff298fc489abe873ff923a56 -folderAsset: yes -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor.meta deleted file mode 100644 index 33c2c97..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 583b67a643dbe2d41a15ea85da64434d -folderAsset: yes -timeCreated: 1509748064 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/UnityServerEditor.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/UnityServerEditor.cs.meta deleted file mode 100644 index cf67f7f..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/UnityServerEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a58a6ca729b036845a504856d5dda5fd -timeCreated: 1509748071 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/XmlUnityServerEditor.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/XmlUnityServerEditor.cs.meta deleted file mode 100644 index 8fb7226..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/Editor/XmlUnityServerEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 83b5c670d56e72041801825b90cfd25c -timeCreated: 1534775384 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/ExampleConfiguration.xml b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/ExampleConfiguration.xml deleted file mode 100644 index 674042b..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/ExampleConfiguration.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityConsoleWriter.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityConsoleWriter.cs.meta deleted file mode 100644 index 56600c0..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityConsoleWriter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6e0176c12130a7844b2e90cc52314f30 -timeCreated: 1534781102 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServer.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServer.cs.meta deleted file mode 100644 index d6af310..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4944af53a9b03f7438a84e3f49001377 -timeCreated: 1509748070 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServerHelper.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServerHelper.cs.meta deleted file mode 100644 index a61d404..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/UnityServerHelper.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 66fe90440d894474a8b0625e0e733b99 -timeCreated: 1509748071 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/XmlUnityServer.cs.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/XmlUnityServer.cs.meta deleted file mode 100644 index aaed98e..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/Server/XmlUnityServer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4adc319de44073349ab168522e64c4fb -timeCreated: 1534774627 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/link.xml b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/link.xml deleted file mode 100644 index 964bec3..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/link.xml.meta b/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/link.xml.meta deleted file mode 100644 index 602b77f..0000000 --- a/DarkRift.Unity/Assets/DarkRift/DarkRift/Plugins/link.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2a1464d044e106144aa38ad41980ea3d -timeCreated: 1547304119 -licenseType: Free -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/DarkRift/ReadMe.txt b/DarkRift.Unity/Assets/DarkRift/ReadMe.txt deleted file mode 100644 index 5453f0a..0000000 --- a/DarkRift.Unity/Assets/DarkRift/ReadMe.txt +++ /dev/null @@ -1,30 +0,0 @@ -Hello! - -Thanks for choosing DarkRift Networking! - -In this package you should find 3 examples, the DarkRift libraries for Unity and the DarkRift server (zipped) -for .NET Framework 4.0. If you have the pro version then you'll also have a DarkRift source archive and builds for .NET Core! - -If you're new to DarkRift you should head straight to the Agar tutorial in the documentation (see below!) and -you might want to have a browse of the included examples. Each example has a ReadMe telling you how to set it -and the server up so make sure you follow them closely or you it might not work! - -Here's some useful links - -You can find documentation on the website here: -http://darkriftnetworking.com/DarkRift2/Docs/ - -There's also a community run discord open to everyone here: -https://discordapp.com/invite/cz2FQ6k - -And of course a Unity Forum thread where you can get help: -https://forum.unity.com/threads/darkrift-networking-2.516271/ - -You can also find plenty extra links, guides and more on the community wiki: -https://github.com/DarkRiftNetworking/DarkRift-Networking/wiki/ - - -Have fun, and good luck with your game! - - -P.S. If you're really really stuck, then send an email to jamie@darkriftnetworking.com! diff --git a/DarkRift.Unity/Assets/DarkRift/ReadMe.txt.meta b/DarkRift.Unity/Assets/DarkRift/ReadMe.txt.meta deleted file mode 100644 index a608753..0000000 --- a/DarkRift.Unity/Assets/DarkRift/ReadMe.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7a9f2abf96f39b94eb6825e20db60b30 -timeCreated: 1509748077 -licenseType: Free -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/Editor.meta b/DarkRift.Unity/Assets/Editor.meta deleted file mode 100644 index 74822c8..0000000 --- a/DarkRift.Unity/Assets/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e4bf805d1e875b94f8a071714aae313d -folderAsset: yes -timeCreated: 1509748063 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/Editor/.DarkRiftBuildImporter.cs.swp b/DarkRift.Unity/Assets/Editor/.DarkRiftBuildImporter.cs.swp deleted file mode 100644 index c629899..0000000 Binary files a/DarkRift.Unity/Assets/Editor/.DarkRiftBuildImporter.cs.swp and /dev/null differ diff --git a/DarkRift.Unity/Assets/Editor/DarkRiftBuildImporter.cs b/DarkRift.Unity/Assets/Editor/DarkRiftBuildImporter.cs deleted file mode 100644 index 264baa9..0000000 --- a/DarkRift.Unity/Assets/Editor/DarkRiftBuildImporter.cs +++ /dev/null @@ -1,282 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using UnityEngine; -using UnityEditor; -using NUnit.Framework; -using System.IO; -using System.Linq; -using System.Reflection; -using System; -using System.Xml.Linq; - -/// -/// Importer for importing DarkRift builds into the Unity project. -/// -public class DarkRiftBuildImporter -{ - /// - /// The location of the DarkRift root folder. - /// - private const string ROOT_DIR = "../"; - - /// - /// Imports the debug files into the project. - /// - [MenuItem("DarkRift/Import Debug")] - private static void ImportDebug() - { - Import("Debug", true); - } - - /// - /// Imports the Release files into the project. - /// - [MenuItem("DarkRift/Import Release")] - private static void ImportRelease() - { - Import("Release", false); - } - - /// - /// Imports the given configuration into the project. - /// - private static void Import(string configuration, bool importDebugFiles) - { - Clean(); - - bool[] success = new bool[14]; - - if (!ConfigurationExists(configuration)) - { - EditorUtility.DisplayDialog("DarkRift Import Failed", "Configuration " + configuration + " has not been built yet.", "OK"); - return; - } - - success[0] = CopyAndVerifyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.dll"), @"DarkRift\Plugins\DarkRift.dll"); - success[1] = CopyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.xml"), @"DarkRift\Plugins\DarkRift.xml"); - - success[2] = CopyAndVerifyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.Server.dll"), @"DarkRift\Plugins\Server\DarkRift.Server.dll"); - success[3] = CopyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.Server.xml"), @"DarkRift\Plugins\Server\DarkRift.Server.xml"); - - success[4] = CopyAndVerifyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.Client.dll"), @"DarkRift\Plugins\Client\DarkRift.Client.dll"); - success[5] = CopyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.Client.xml"), @"DarkRift\Plugins\Client\DarkRift.Client.xml"); - - success[6] = CopyFile(CompilePath(configuration, "net4.0", "DarkRift Server.zip"), @"DarkRift Server (.NET Framework 4.0).zip"); - - success[7] = CopyFile(CompilePath(configuration, "netcoreapp2.0", "DarkRift Server.zip"), @"DarkRift Server (.NET Core 2.0).zip"); - success[8] = CopyFile(CompilePath(configuration, "netcoreapp3.1", "DarkRift Server.zip"), @"DarkRift Server (.NET Core 3.1).zip"); - success[9] = CopyFile(CompilePath(configuration, "net5.0", "DarkRift Server.zip"), @"DarkRift Server (.NET 5.0).zip"); - success[10] = CopyFile(CompilePath("DarkRift Source.zip"), @"DarkRift Source.zip"); - - if (importDebugFiles) - { - success[11] = CopyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.pdb"), @"DarkRift\Plugins\DarkRift.pdb"); - success[12] = CopyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.Server.pdb"), @"DarkRift\Plugins\Server\DarkRift.Server.pdb"); - success[13] = CopyFile(CompilePath(configuration, "net4.0", @"Lib\DarkRift.Client.pdb"), @"DarkRift\Plugins\Client\DarkRift.Client.pdb"); - } - else - { - success[11] = true; - success[12] = true; - success[13] = true; - } - - AssetDatabase.Refresh(); - - if (success.All(x => x)) - { - Debug.Log("All files for version " + GetExpectedAssemblyVersion() + " " + configuration + " were sucessfully imported."); - } - else - { - string message = success.Count(x => !x) + " failures:\n"; - message += success[0] ? "" : "DarkRift.dll\n"; - message += success[1] ? "" : "DarkRift.xml\n"; - message += success[2] ? "" : "DarkRift.Server.dll\n"; - message += success[3] ? "" : "DarkRift.Server.xml\n"; - message += success[4] ? "" : "DarkRift.Client.dll\n"; - message += success[5] ? "" : "DarkRift.Client.xml\n"; - message += success[6] ? "" : "DarkRift Server (.NET Framework 4.0).zip\n"; - message += success[7] ? "" : "DarkRift Server (.NET Core 2.0).zip\n"; - message += success[8] ? "" : "DarkRift Server (.NET Core 3.1).zip\n"; - message += success[9] ? "" : "DarkRift Server (.NET 5.0).zip\n"; - message += success[10] ? "" : "DarkRift Source.zip\n"; - message += success[11] ? "" : "DarkRift.pdb\n"; - message += success[12] ? "" : "DarkRift.Server.pdb\n"; - message += success[13] ? "" : "DarkRift.Client.pdb\n"; - - EditorUtility.DisplayDialog("DarkRift Import Failed", message, "OK"); - } - } - - /// - /// Removes all imported files. - /// - private static void Clean() - { - RemoveFile(@"DarkRift\Plugins\DarkRift.dll"); - RemoveFile(@"DarkRift\Plugins\DarkRift.xml"); - RemoveFile(@"DarkRift\Plugins\DarkRift.pdb"); - RemoveFile(@"DarkRift\Plugins\DarkRift.dll.mdb"); - - RemoveFile(@"DarkRift\Plugins\Server\DarkRift.Server.dll"); - RemoveFile(@"DarkRift\Plugins\Server\DarkRift.Server.xml"); - RemoveFile(@"DarkRift\Plugins\Server\DarkRift.Server.pdb"); - RemoveFile(@"DarkRift\Plugins\Server\DarkRift.Server.dll.mdb"); - - RemoveFile(@"DarkRift\Plugins\Client\DarkRift.Client.dll"); - RemoveFile(@"DarkRift\Plugins\Client\DarkRift.Client.xml"); - RemoveFile(@"DarkRift\Plugins\Client\DarkRift.Client.pdb"); - RemoveFile(@"DarkRift\Plugins\Client\DarkRift.Client.dll.mdb"); - - RemoveFile(@"DarkRift Server (.NET Framework 4.0).zip"); - RemoveFile(@"DarkRift Server (.NET Core 2.0).zip"); - RemoveFile(@"DarkRift Server (.NET Core 3.1).zip"); - RemoveFile(@"DarkRift Server (.NET 5.0).zip"); - RemoveFile(@"DarkRift Source.zip"); - } - - /// - /// Copies a file into Unity. - /// - /// The source assembly to take the file from. - /// The configuration being loaded. - /// The destination location from Assets\DarkRift\Plugins\ - /// The file name to copy. - /// Whether the copy operation succeeded. - private static bool CopyFile(string source, string destination) - { - string destinationLocation = Path.Combine(@"Assets\DarkRift", destination); - - try - { - File.Copy(source, destinationLocation, true); - } - catch (FileNotFoundException e) - { - Debug.LogError(e.ToString()); - return false; - } - - return true; - } - - /// - /// Copies a file into Unity and verifies the assembly version. - /// - /// The source assembly to take the file from. - /// The configuration being loaded. - /// The destination location from Assets\DarkRift\Plugins\ - /// The file name to copy. - /// Whether the copy and verify operation succeeded. - private static bool CopyAndVerifyFile(string source, string destination) - { - if (!CopyFile(source, destination)) - return false; - - string destinationLocation = Path.Combine(@"Assets\DarkRift", destination); - - Version expectedAssemblyVersion = GetExpectedAssemblyVersion(); - Version actualAssemblyVersionWithRevision = AssemblyName.GetAssemblyName(destinationLocation).Version; - Version actualAssemblyVersion = new Version(actualAssemblyVersionWithRevision.Major, actualAssemblyVersionWithRevision.Minor, actualAssemblyVersionWithRevision.Build); - - if (actualAssemblyVersion != expectedAssemblyVersion) - { - Debug.LogError("Expected assembly version " + expectedAssemblyVersion + " but assembly " + destination + " has version " + actualAssemblyVersion + "."); - return false; - } - - return true; - } - - /// - /// Removes a file from the project. - /// - /// The file to remove. - /// Whether the remove was successfull. - private static bool RemoveFile(string file) - { - string fileLocation = Path.Combine(@"Assets\DarkRift", file); - - try - { - File.Delete(fileLocation); - } - catch (FileNotFoundException e) - { - Debug.LogError(e.ToString()); - return false; - } - - return true; - } - - /// - /// Compiles a path to the build of a specified folder. - /// - /// The file to get. - /// The path compiled. - private static string CompilePath(string file) - { - string sourceLocation = Path.Combine(ROOT_DIR, "Build"); - sourceLocation = Path.Combine(sourceLocation, file); - return sourceLocation; - } - - /// - /// Compiles a path to the build of a specified folder. - /// - /// The configuration to use. - /// The framework to use. - /// The file to get. - /// The path compiled. - private static string CompilePath(string configuration, string framework, string file) - { - string sourceLocation = Path.Combine(ROOT_DIR, "Build"); - sourceLocation = Path.Combine(sourceLocation, configuration); - sourceLocation = Path.Combine(sourceLocation, framework); - sourceLocation = Path.Combine(sourceLocation, file); - return sourceLocation; - } - - /// - /// Checks if a configuration has been built yet. - /// - /// The configuration to check. - /// If the configuratuion exists. - private static bool ConfigurationExists(string configuration) - { - string sourceLocation = Path.Combine(ROOT_DIR, "Build"); - sourceLocation = Path.Combine(sourceLocation, configuration); - return Directory.Exists(sourceLocation); - } - - /// - /// Returns the assembly version in the .props file. - /// - /// - private static Version GetExpectedAssemblyVersion() - { - return new Version(XDocument.Load(Path.Combine(ROOT_DIR, ".props").ToString()).Root.Element("PropertyGroup").Element("Version").Value); - } -} diff --git a/DarkRift.Unity/Assets/Editor/DarkRiftBuildImporter.cs.meta b/DarkRift.Unity/Assets/Editor/DarkRiftBuildImporter.cs.meta deleted file mode 100644 index 8ce46e3..0000000 --- a/DarkRift.Unity/Assets/Editor/DarkRiftBuildImporter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b83b7362127e26d4f8686112397bc820 -timeCreated: 1509748071 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/Editor/DarkRiftLinks.cs b/DarkRift.Unity/Assets/Editor/DarkRiftLinks.cs deleted file mode 100644 index 66e130d..0000000 --- a/DarkRift.Unity/Assets/Editor/DarkRiftLinks.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using System.Collections; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; - -public static class DarkRiftLinks -{ - [MenuItem("DarkRift/Asset Store/DarkRift Free")] - private static void OpenDarkRiftFree() - { - UnityEditorInternal.AssetStore.Open("com.unity3d.kharma:content/95309"); - } - - [MenuItem("DarkRift/Asset Store/DarkRift Pro")] - private static void OpenDarkRiftPro() - { - UnityEditorInternal.AssetStore.Open("com.unity3d.kharma:content/95399"); - } -} diff --git a/DarkRift.Unity/Assets/Editor/DarkRiftLinks.cs.meta b/DarkRift.Unity/Assets/Editor/DarkRiftLinks.cs.meta deleted file mode 100644 index 32fdf45..0000000 --- a/DarkRift.Unity/Assets/Editor/DarkRiftLinks.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ae16c328b64cfbf4190c85f0d4b0f35b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/PluginTest.cs b/DarkRift.Unity/Assets/PluginTest.cs deleted file mode 100644 index 4d876f8..0000000 --- a/DarkRift.Unity/Assets/PluginTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using UnityEngine; -using System.Collections; -using DarkRift.Server; -using System; - -public class PluginTest : Plugin -{ - public override bool ThreadSafe { get { return true; } } - - public override Version Version { get { return new Version(1, 0, 0); } } - - public PluginTest(PluginLoadData pluginLoadData) : base(pluginLoadData) - { - Logger.Info("Hello, world!"); - } -} diff --git a/DarkRift.Unity/Assets/PluginTest.cs.meta b/DarkRift.Unity/Assets/PluginTest.cs.meta deleted file mode 100644 index 846ab85..0000000 --- a/DarkRift.Unity/Assets/PluginTest.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: be76cb605d4f17147979ee4f6794e340 -timeCreated: 1534781262 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/TestMultiConnect.cs b/DarkRift.Unity/Assets/TestMultiConnect.cs deleted file mode 100644 index 3a9de93..0000000 --- a/DarkRift.Unity/Assets/TestMultiConnect.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using UnityEngine; -using System.Collections; -using DarkRift.Client.Unity; -using System.Net; -using DarkRift; - -[RequireComponent(typeof(UnityClient))] -public class TestMultiConnect : MonoBehaviour -{ - UnityClient client; - - void Awake() - { - client = GetComponent(); - } - - void Update() - { - Debug.Log(client.ConnectionState); - - if (Input.GetKeyDown("space")) - client.Connect(IPAddress.Loopback, 4296, true); - else if (Input.GetKeyDown("z")) - client.Disconnect(); - } -} diff --git a/DarkRift.Unity/Assets/TestMultiConnect.cs.meta b/DarkRift.Unity/Assets/TestMultiConnect.cs.meta deleted file mode 100644 index 2cdb6aa..0000000 --- a/DarkRift.Unity/Assets/TestMultiConnect.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9fd6aea3b6dcc2447b0deb70126b2bad -timeCreated: 1521238959 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/Tests.meta b/DarkRift.Unity/Assets/Tests.meta deleted file mode 100644 index 170a358..0000000 --- a/DarkRift.Unity/Assets/Tests.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ff91b596aa556e7419f0f46262346bf1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/Tests/Issue75.cs b/DarkRift.Unity/Assets/Tests/Issue75.cs deleted file mode 100644 index ec60caf..0000000 --- a/DarkRift.Unity/Assets/Tests/Issue75.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright (c) 2022 Unordinal AB - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using System.Net; -using DarkRift; -using DarkRift.Server; -using DarkRift.Client.Unity; -using DarkRift.Server.Unity; -using UnityEngine; -using ServerMessageReceivedEventArgs = DarkRift.Server.MessageReceivedEventArgs; - -public class Issue75 : MonoBehaviour -{ - public UnityClient Client; - public XmlUnityServer Server; - - void Start() - { - Server.Server.ClientManager.ClientConnected += OnClientConnected; - Client.Connect(IPAddress.Parse("127.0.0.1"), 4296, true); - } - - private void OnClientConnected(object sender, ClientConnectedEventArgs e) - { - e.Client.MessageReceived += ServerOnMessageReceived; - } - - private void ServerOnMessageReceived(object sender, ServerMessageReceivedEventArgs e) - { - using (Message message = e.GetMessage()) - { - using (DarkRiftReader reader = message.GetReader()) - { - for (int i = 0; i < 30; i++) - { - ushort test = reader.ReadUInt16(); - if (test != 1) - { - Debug.Log("Received malformatted message!"); - } - } - } - } - } - - private ushort counter; - private ushort counter2; - void FixedUpdate() - { - for (int i = 0; i < 25; i++) - { - send(); - } - } - - - void send() - { - if (counter2 >= 5000) - { - return; - } - counter++; - counter %= 10; - if (counter == 0) - { - counter2++; - } - using (DarkRiftWriter writer = DarkRiftWriter.Create()) - { - for (int i = 0; i < 30; i++) - { - writer.Write((ushort)1); - } - using (Message message = Message.Create(counter, writer)) - { - Client.SendMessage(message, SendMode.Reliable); - } - } - } - -} diff --git a/DarkRift.Unity/Assets/Tests/Issue75.cs.meta b/DarkRift.Unity/Assets/Tests/Issue75.cs.meta deleted file mode 100644 index edb9078..0000000 --- a/DarkRift.Unity/Assets/Tests/Issue75.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 27b9bba8f5ab0e5449555293fd2341a2 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/Assets/Tests/Issue75.unity b/DarkRift.Unity/Assets/Tests/Issue75.unity deleted file mode 100644 index db35eb4..0000000 --- a/DarkRift.Unity/Assets/Tests/Issue75.unity +++ /dev/null @@ -1,354 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 8 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 11 - m_GIWorkflowMode: 0 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 1 - m_LightmapEditorSettings: - serializedVersion: 9 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 0 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 500 - m_PVRBounces: 2 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 - m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &1233222114 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1233222118} - - component: {fileID: 1233222117} - - component: {fileID: 1233222116} - - component: {fileID: 1233222115} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1233222115 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1233222114} - m_Enabled: 1 ---- !u!124 &1233222116 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1233222114} - m_Enabled: 1 ---- !u!20 &1233222117 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1233222114} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &1233222118 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1233222114} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1484031347 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1484031349} - - component: {fileID: 1484031348} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &1484031348 -Light: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1484031347} - m_Enabled: 1 - serializedVersion: 8 - m_Type: 1 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &1484031349 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1484031347} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &1655284931 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1655284935} - - component: {fileID: 1655284934} - - component: {fileID: 1655284933} - - component: {fileID: 1655284932} - m_Layer: 0 - m_Name: GameObject - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1655284932 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1655284931} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4adc319de44073349ab168522e64c4fb, type: 3} - m_Name: - m_EditorClassIdentifier: - configuration: {fileID: 4900000, guid: cdbcf5e43d271b4448d2bcd2295d36aa, type: 3} - createOnEnable: 1 - eventsFromDispatcher: 1 ---- !u!114 &1655284933 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1655284931} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7d2b44c570cb28644b8762e0b13e7c23, type: 3} - m_Name: - m_EditorClassIdentifier: - address: 127.0.0.1 - port: 4296 - ipVersion: 0 - autoConnect: 1 - invokeFromDispatcher: 1 - sniffData: 0 - objectCacheSettings: - maxWriters: 2 - maxReaders: 2 - maxMessages: 4 - maxMessageBuffers: 4 - maxSocketAsyncEventArgs: 32 - maxActionDispatcherTasks: 16 - maxAutoRecyclingArrays: 4 - extraSmallMemoryBlockSize: 16 - maxExtraSmallMemoryBlocks: 2 - smallMemoryBlockSize: 64 - maxSmallMemoryBlocks: 2 - mediumMemoryBlockSize: 256 - maxMediumMemoryBlocks: 2 - largeMemoryBlockSize: 1024 - maxLargeMemoryBlocks: 2 - extraLargeMemoryBlockSize: 4096 - maxExtraLargeMemoryBlocks: 2 ---- !u!114 &1655284934 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1655284931} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 27b9bba8f5ab0e5449555293fd2341a2, type: 3} - m_Name: - m_EditorClassIdentifier: - Client: {fileID: 1655284933} - Server: {fileID: 1655284932} ---- !u!4 &1655284935 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1655284931} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/DarkRift.Unity/Assets/Tests/Issue75.unity.meta b/DarkRift.Unity/Assets/Tests/Issue75.unity.meta deleted file mode 100644 index 153d095..0000000 --- a/DarkRift.Unity/Assets/Tests/Issue75.unity.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 49f369448a9a8d84e9748d5c346653a7 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/DarkRift.Unity/ProjectSettings/AudioManager.asset b/DarkRift.Unity/ProjectSettings/AudioManager.asset deleted file mode 100644 index faf901c..0000000 --- a/DarkRift.Unity/ProjectSettings/AudioManager.asset +++ /dev/null @@ -1,15 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!11 &1 -AudioManager: - m_ObjectHideFlags: 0 - m_Volume: 1 - Rolloff Scale: 1 - Doppler Factor: 1 - Default Speaker Mode: 2 - m_SampleRate: 0 - m_DSPBufferSize: 0 - m_VirtualVoiceCount: 512 - m_RealVoiceCount: 32 - m_SpatializerPlugin: - m_DisableAudio: 0 diff --git a/DarkRift.Unity/ProjectSettings/ClusterInputManager.asset b/DarkRift.Unity/ProjectSettings/ClusterInputManager.asset deleted file mode 100644 index e7886b2..0000000 --- a/DarkRift.Unity/ProjectSettings/ClusterInputManager.asset +++ /dev/null @@ -1,6 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!236 &1 -ClusterInputManager: - m_ObjectHideFlags: 0 - m_Inputs: [] diff --git a/DarkRift.Unity/ProjectSettings/DynamicsManager.asset b/DarkRift.Unity/ProjectSettings/DynamicsManager.asset deleted file mode 100644 index bb9f46e..0000000 --- a/DarkRift.Unity/ProjectSettings/DynamicsManager.asset +++ /dev/null @@ -1,15 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!55 &1 -PhysicsManager: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Gravity: {x: 0, y: -9.81000042, z: 0} - m_DefaultMaterial: {fileID: 0} - m_BounceThreshold: 2 - m_SleepThreshold: .00499999989 - m_DefaultContactOffset: .00999999978 - m_SolverIterationCount: 6 - m_QueriesHitTriggers: 1 - m_EnableAdaptiveForce: 0 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/DarkRift.Unity/ProjectSettings/EditorBuildSettings.asset b/DarkRift.Unity/ProjectSettings/EditorBuildSettings.asset deleted file mode 100644 index 198011d..0000000 --- a/DarkRift.Unity/ProjectSettings/EditorBuildSettings.asset +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1045 &1 -EditorBuildSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Scenes: - - enabled: 0 - path: Assets/DarkRift/1 ChatDemo/ChatDemo.unity - guid: 31c70d0d9b36a2f42be7c30b0449c3aa - - enabled: 0 - path: Assets/DarkRift/2 DragDemo/DragDemo.unity - guid: 78d3a40c48875094ebcf4b2775f9ed50 - - enabled: 0 - path: Assets/DarkRift/3 BlockDemo/BlockDemo.unity - guid: 03a1c5ab7b1408e4a9b3b7905b184093 - - enabled: 0 - path: - guid: 00000000000000000000000000000000 - m_configObjects: {} diff --git a/DarkRift.Unity/ProjectSettings/EditorSettings.asset b/DarkRift.Unity/ProjectSettings/EditorSettings.asset deleted file mode 100644 index 529a05c..0000000 --- a/DarkRift.Unity/ProjectSettings/EditorSettings.asset +++ /dev/null @@ -1,15 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!159 &1 -EditorSettings: - m_ObjectHideFlags: 0 - serializedVersion: 3 - m_ExternalVersionControlSupport: Visible Meta Files - m_SerializationMode: 2 - m_WebSecurityEmulationEnabled: 0 - m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d - m_DefaultBehaviorMode: 0 - m_SpritePackerMode: 2 - m_SpritePackerPaddingPower: 1 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd - m_ProjectGenerationRootNamespace: diff --git a/DarkRift.Unity/ProjectSettings/GraphicsSettings.asset b/DarkRift.Unity/ProjectSettings/GraphicsSettings.asset deleted file mode 100644 index 32fbf91..0000000 --- a/DarkRift.Unity/ProjectSettings/GraphicsSettings.asset +++ /dev/null @@ -1,63 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!30 &1 -GraphicsSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_Deferred: - m_Mode: 1 - m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} - m_DeferredReflections: - m_Mode: 1 - m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} - m_ScreenSpaceShadows: - m_Mode: 1 - m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} - m_LegacyDeferred: - m_Mode: 1 - m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} - m_DepthNormals: - m_Mode: 1 - m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} - m_MotionVectors: - m_Mode: 1 - m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} - m_LightHalo: - m_Mode: 1 - m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} - m_LensFlare: - m_Mode: 1 - m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} - m_AlwaysIncludedShaders: - - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - m_PreloadedShaders: [] - m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, - type: 0} - m_CustomRenderPipeline: {fileID: 0} - m_TransparencySortMode: 0 - m_TransparencySortAxis: {x: 0, y: 0, z: 1} - m_DefaultRenderingPath: 1 - m_DefaultMobileRenderingPath: 1 - m_TierSettings: [] - m_LightmapStripping: 0 - m_FogStripping: 0 - m_InstancingStripping: 0 - m_LightmapKeepPlain: 1 - m_LightmapKeepDirCombined: 1 - m_LightmapKeepDynamicPlain: 1 - m_LightmapKeepDynamicDirCombined: 1 - m_LightmapKeepShadowMask: 1 - m_LightmapKeepSubtractive: 1 - m_FogKeepLinear: 1 - m_FogKeepExp: 1 - m_FogKeepExp2: 1 - m_AlbedoSwatchInfos: [] - m_LightsUseLinearIntensity: 0 - m_LightsUseColorTemperature: 0 diff --git a/DarkRift.Unity/ProjectSettings/InputManager.asset b/DarkRift.Unity/ProjectSettings/InputManager.asset deleted file mode 100644 index 0a69793..0000000 --- a/DarkRift.Unity/ProjectSettings/InputManager.asset +++ /dev/null @@ -1,295 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!13 &1 -InputManager: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Axes: - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: left - positiveButton: right - altNegativeButton: a - altPositiveButton: d - gravity: 3 - dead: .00100000005 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: down - positiveButton: up - altNegativeButton: s - altPositiveButton: w - gravity: 3 - dead: .00100000005 - sensitivity: 3 - snap: 1 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left ctrl - altNegativeButton: - altPositiveButton: mouse 0 - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left alt - altNegativeButton: - altPositiveButton: mouse 1 - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: left cmd - altNegativeButton: - altPositiveButton: mouse 2 - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: space - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse X - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: .100000001 - snap: 0 - invert: 0 - type: 1 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse Y - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: .100000001 - snap: 0 - invert: 0 - type: 1 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Mouse ScrollWheel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: 0 - sensitivity: .100000001 - snap: 0 - invert: 0 - type: 1 - axis: 2 - joyNum: 0 - - serializedVersion: 3 - m_Name: Horizontal - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: .189999998 - sensitivity: 1 - snap: 0 - invert: 0 - type: 2 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Vertical - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: - altNegativeButton: - altPositiveButton: - gravity: 0 - dead: .189999998 - sensitivity: 1 - snap: 0 - invert: 1 - type: 2 - axis: 1 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire1 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 0 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire2 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 1 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Fire3 - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 2 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Jump - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: joystick button 3 - altNegativeButton: - altPositiveButton: - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: return - altNegativeButton: - altPositiveButton: joystick button 0 - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Submit - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: enter - altNegativeButton: - altPositiveButton: space - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 - - serializedVersion: 3 - m_Name: Cancel - descriptiveName: - descriptiveNegativeName: - negativeButton: - positiveButton: escape - altNegativeButton: - altPositiveButton: joystick button 1 - gravity: 1000 - dead: .00100000005 - sensitivity: 1000 - snap: 0 - invert: 0 - type: 0 - axis: 0 - joyNum: 0 diff --git a/DarkRift.Unity/ProjectSettings/NavMeshAreas.asset b/DarkRift.Unity/ProjectSettings/NavMeshAreas.asset deleted file mode 100644 index a04f35c..0000000 --- a/DarkRift.Unity/ProjectSettings/NavMeshAreas.asset +++ /dev/null @@ -1,71 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!126 &1 -NavMeshAreas: - m_ObjectHideFlags: 0 - serializedVersion: 2 - areas: - - name: Walkable - cost: 1 - - name: Not Walkable - cost: 1 - - name: Jump - cost: 2 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 - - name: - cost: 1 diff --git a/DarkRift.Unity/ProjectSettings/NavMeshLayers.asset b/DarkRift.Unity/ProjectSettings/NavMeshLayers.asset deleted file mode 100644 index b5370f0..0000000 Binary files a/DarkRift.Unity/ProjectSettings/NavMeshLayers.asset and /dev/null differ diff --git a/DarkRift.Unity/ProjectSettings/NetworkManager.asset b/DarkRift.Unity/ProjectSettings/NetworkManager.asset deleted file mode 100644 index 5dc6a83..0000000 --- a/DarkRift.Unity/ProjectSettings/NetworkManager.asset +++ /dev/null @@ -1,8 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!149 &1 -NetworkManager: - m_ObjectHideFlags: 0 - m_DebugLevel: 0 - m_Sendrate: 15 - m_AssetToPrefab: {} diff --git a/DarkRift.Unity/ProjectSettings/Physics2DSettings.asset b/DarkRift.Unity/ProjectSettings/Physics2DSettings.asset deleted file mode 100644 index 793c0c9..0000000 --- a/DarkRift.Unity/ProjectSettings/Physics2DSettings.asset +++ /dev/null @@ -1,25 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!19 &1 -Physics2DSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Gravity: {x: 0, y: -9.81000042} - m_DefaultMaterial: {fileID: 0} - m_VelocityIterations: 8 - m_PositionIterations: 3 - m_VelocityThreshold: 1 - m_MaxLinearCorrection: .200000003 - m_MaxAngularCorrection: 8 - m_MaxTranslationSpeed: 100 - m_MaxRotationSpeed: 360 - m_MinPenetrationForPenalty: .00999999978 - m_BaumgarteScale: .200000003 - m_BaumgarteTimeOfImpactScale: .75 - m_TimeToSleep: .5 - m_LinearSleepTolerance: .00999999978 - m_AngularSleepTolerance: 2 - m_QueriesHitTriggers: 1 - m_QueriesStartInColliders: 1 - m_ChangeStopsCallbacks: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/DarkRift.Unity/ProjectSettings/PresetManager.asset b/DarkRift.Unity/ProjectSettings/PresetManager.asset deleted file mode 100644 index 636a595..0000000 --- a/DarkRift.Unity/ProjectSettings/PresetManager.asset +++ /dev/null @@ -1,6 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1386491679 &1 -PresetManager: - m_ObjectHideFlags: 0 - m_DefaultList: [] diff --git a/DarkRift.Unity/ProjectSettings/ProjectSettings.asset b/DarkRift.Unity/ProjectSettings/ProjectSettings.asset deleted file mode 100644 index afb2fd9..0000000 --- a/DarkRift.Unity/ProjectSettings/ProjectSettings.asset +++ /dev/null @@ -1,638 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!129 &1 -PlayerSettings: - m_ObjectHideFlags: 0 - serializedVersion: 18 - productGUID: c33719c21f4274c499b06df6bdbfea4d - AndroidProfiler: 0 - AndroidFilterTouchesWhenObscured: 0 - AndroidEnableSustainedPerformanceMode: 0 - defaultScreenOrientation: 4 - targetDevice: 2 - useOnDemandResources: 0 - accelerometerFrequency: 60 - companyName: DefaultCompany - productName: DarkRift2 - defaultCursor: {fileID: 0} - cursorHotspot: {x: 0, y: 0} - m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} - m_ShowUnitySplashScreen: 1 - m_ShowUnitySplashLogo: 1 - m_SplashScreenOverlayOpacity: 1 - m_SplashScreenAnimation: 1 - m_SplashScreenLogoStyle: 1 - m_SplashScreenDrawMode: 0 - m_SplashScreenBackgroundAnimationZoom: 1 - m_SplashScreenLogoAnimationZoom: 1 - m_SplashScreenBackgroundLandscapeAspect: 1 - m_SplashScreenBackgroundPortraitAspect: 1 - m_SplashScreenBackgroundLandscapeUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenBackgroundPortraitUvs: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - m_SplashScreenLogos: [] - m_VirtualRealitySplashScreen: {fileID: 0} - m_HolographicTrackingLossScreen: {fileID: 0} - defaultScreenWidth: 1024 - defaultScreenHeight: 768 - defaultScreenWidthWeb: 960 - defaultScreenHeightWeb: 600 - m_StereoRenderingPath: 0 - m_ActiveColorSpace: 0 - m_MTRendering: 1 - m_StackTraceTypes: 010000000100000001000000010000000100000001000000 - iosShowActivityIndicatorOnLoading: -1 - androidShowActivityIndicatorOnLoading: -1 - displayResolutionDialog: 1 - iosUseCustomAppBackgroundBehavior: 0 - iosAllowHTTPDownload: 1 - allowedAutorotateToPortrait: 1 - allowedAutorotateToPortraitUpsideDown: 1 - allowedAutorotateToLandscapeRight: 1 - allowedAutorotateToLandscapeLeft: 1 - useOSAutorotation: 1 - use32BitDisplayBuffer: 1 - preserveFramebufferAlpha: 0 - disableDepthAndStencilBuffers: 0 - androidStartInFullscreen: 1 - androidRenderOutsideSafeArea: 0 - androidBlitType: 0 - defaultIsNativeResolution: 1 - macRetinaSupport: 1 - runInBackground: 1 - captureSingleScreen: 0 - muteOtherAudioSources: 0 - Prepare IOS For Recording: 0 - Force IOS Speakers When Recording: 0 - deferSystemGesturesMode: 0 - hideHomeButton: 0 - submitAnalytics: 1 - usePlayerLog: 1 - bakeCollisionMeshes: 0 - forceSingleInstance: 0 - resizableWindow: 0 - useMacAppStoreValidation: 0 - macAppStoreCategory: public.app-category.games - gpuSkinning: 0 - graphicsJobs: 0 - xboxPIXTextureCapture: 0 - xboxEnableAvatar: 0 - xboxEnableKinect: 0 - xboxEnableKinectAutoTracking: 0 - xboxEnableFitness: 0 - visibleInBackground: 0 - allowFullscreenSwitch: 1 - graphicsJobMode: 0 - fullscreenMode: 1 - xboxSpeechDB: 0 - xboxEnableHeadOrientation: 0 - xboxEnableGuest: 0 - xboxEnablePIXSampling: 0 - metalFramebufferOnly: 0 - xboxOneResolution: 0 - xboxOneSResolution: 0 - xboxOneXResolution: 3 - xboxOneMonoLoggingLevel: 0 - xboxOneLoggingLevel: 1 - xboxOneDisableEsram: 0 - xboxOneEnableTypeOptimization: 0 - xboxOnePresentImmediateThreshold: 0 - switchQueueCommandMemory: 1048576 - switchQueueControlMemory: 16384 - switchQueueComputeMemory: 262144 - switchNVNShaderPoolsGranularity: 33554432 - switchNVNDefaultPoolsGranularity: 16777216 - switchNVNOtherPoolsGranularity: 16777216 - switchNVNMaxPublicTextureIDCount: 0 - switchNVNMaxPublicSamplerIDCount: 0 - vulkanEnableSetSRGBWrite: 0 - m_SupportedAspectRatios: - 4:3: 1 - 5:4: 1 - 16:10: 1 - 16:9: 1 - Others: 1 - bundleVersion: 1.0 - preloadedAssets: [] - metroInputSource: 0 - wsaTransparentSwapchain: 0 - m_HolographicPauseOnTrackingLoss: 1 - xboxOneDisableKinectGpuReservation: 0 - xboxOneEnable7thCore: 0 - isWsaHolographicRemotingEnabled: 0 - vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 0 - oculus: - sharedDepthBuffer: 0 - dashSupport: 0 - lowOverheadMode: 0 - protectedContext: 0 - v2Signing: 0 - enable360StereoCapture: 0 - protectGraphicsMemory: 0 - enableFrameTimingStats: 0 - useHDRDisplay: 0 - m_ColorGamuts: 00000000 - targetPixelDensity: 30 - resolutionScalingMode: 0 - androidSupportedAspectRatio: 1 - androidMaxAspectRatio: 2.1 - applicationIdentifier: - Android: com.Company.ProductName - Standalone: unity.DefaultCompany.DarkRift2 - Tizen: com.Company.ProductName - iOS: com.Company.ProductName - tvOS: com.Company.ProductName - buildNumber: - iOS: 0 - AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 16 - AndroidTargetSdkVersion: 0 - AndroidPreferredInstallLocation: 1 - aotOptions: - stripEngineCode: 1 - iPhoneStrippingLevel: 0 - iPhoneScriptCallOptimization: 0 - ForceInternetPermission: 0 - ForceSDCardPermission: 0 - CreateWallpaper: 0 - APKExpansionFiles: 0 - keepLoadedShadersAlive: 0 - StripUnusedMeshComponents: 0 - VertexChannelCompressionMask: 4054 - iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 9.0 - tvOSSdkVersion: 0 - tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 9.0 - uIPrerenderedIcon: 0 - uIRequiresPersistentWiFi: 0 - uIRequiresFullScreen: 1 - uIStatusBarHidden: 1 - uIExitOnSuspend: 0 - uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPhone58inPortraitSplashScreen: {fileID: 0} - iPhone58inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} - appleTVSplashScreen: {fileID: 0} - appleTVSplashScreen2x: {fileID: 0} - tvOSSmallIconLayers: [] - tvOSSmallIconLayers2x: [] - tvOSLargeIconLayers: [] - tvOSLargeIconLayers2x: [] - tvOSTopShelfImageLayers: [] - tvOSTopShelfImageLayers2x: [] - tvOSTopShelfImageWideLayers: [] - tvOSTopShelfImageWideLayers2x: [] - iOSLaunchScreenType: 0 - iOSLaunchScreenPortrait: {fileID: 0} - iOSLaunchScreenLandscape: {fileID: 0} - iOSLaunchScreenBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreenFillPct: 100 - iOSLaunchScreenSize: 100 - iOSLaunchScreenCustomXibPath: - iOSLaunchScreeniPadType: 0 - iOSLaunchScreeniPadImage: {fileID: 0} - iOSLaunchScreeniPadBackgroundColor: - serializedVersion: 2 - rgba: 0 - iOSLaunchScreeniPadFillPct: 100 - iOSLaunchScreeniPadSize: 100 - iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 - iOSLaunchScreenCustomStoryboardPath: - iOSDeviceRequirements: [] - iOSURLSchemes: [] - iOSBackgroundModes: 0 - iOSMetalForceHardShadows: 0 - metalEditorSupport: 1 - metalAPIValidation: 1 - iOSRenderExtraFrameOnPause: 1 - iosCopyPluginsCodeInsteadOfSymlink: 0 - appleDeveloperTeamID: - iOSManualSigningProvisioningProfileID: - tvOSManualSigningProvisioningProfileID: - iOSManualSigningProvisioningProfileType: 0 - tvOSManualSigningProvisioningProfileType: 0 - appleEnableAutomaticSigning: 0 - iOSRequireARKit: 0 - iOSAutomaticallyDetectAndAddCapabilities: 1 - appleEnableProMotion: 0 - clonedFromGUID: 00000000000000000000000000000000 - templatePackageId: - templateDefaultScene: - AndroidTargetArchitectures: 5 - AndroidSplashScreenScale: 0 - androidSplashScreen: {fileID: 0} - AndroidKeystoreName: - AndroidKeyaliasName: - AndroidBuildApkPerCpuArchitecture: 0 - AndroidTVCompatibility: 1 - AndroidIsGame: 1 - AndroidEnableTango: 0 - androidEnableBanner: 1 - androidUseLowAccuracyLocation: 0 - m_AndroidBanners: - - width: 320 - height: 180 - banner: {fileID: 0} - androidGamepadSupportLevel: 0 - resolutionDialogBanner: {fileID: 0} - m_BuildTargetIcons: - - m_BuildTarget: - m_Icons: - - serializedVersion: 2 - m_Icon: {fileID: 0} - m_Width: 1 - m_Height: 1 - m_Kind: 47246 - m_BuildTargetPlatformIcons: [] - m_BuildTargetBatching: [] - m_BuildTargetGraphicsAPIs: [] - m_BuildTargetVRSettings: [] - m_BuildTargetEnableVuforiaSettings: [] - openGLRequireES31: 0 - openGLRequireES31AEP: 0 - m_TemplateCustomTags: {} - mobileMTRendering: - iPhone: 1 - tvOS: 1 - m_BuildTargetGroupLightmapEncodingQuality: - - m_BuildTarget: Standalone - m_EncodingQuality: 1 - - m_BuildTarget: XboxOne - m_EncodingQuality: 1 - - m_BuildTarget: PS4 - m_EncodingQuality: 1 - m_BuildTargetGroupLightmapSettings: [] - playModeTestRunnerEnabled: 0 - runPlayModeTestAsEditModeTest: 0 - actionOnDotNetUnhandledException: 1 - enableInternalProfiler: 0 - logObjCUncaughtExceptions: 1 - enableCrashReportAPI: 0 - cameraUsageDescription: - locationUsageDescription: - microphoneUsageDescription: - switchNetLibKey: - switchSocketMemoryPoolSize: 6144 - switchSocketAllocatorPoolSize: 128 - switchSocketConcurrencyLimit: 14 - switchScreenResolutionBehavior: 2 - switchUseCPUProfiler: 0 - switchApplicationID: 0x01004b9000490000 - switchNSODependencies: - switchTitleNames_0: - switchTitleNames_1: - switchTitleNames_2: - switchTitleNames_3: - switchTitleNames_4: - switchTitleNames_5: - switchTitleNames_6: - switchTitleNames_7: - switchTitleNames_8: - switchTitleNames_9: - switchTitleNames_10: - switchTitleNames_11: - switchTitleNames_12: - switchTitleNames_13: - switchTitleNames_14: - switchTitleNames_15: - switchPublisherNames_0: - switchPublisherNames_1: - switchPublisherNames_2: - switchPublisherNames_3: - switchPublisherNames_4: - switchPublisherNames_5: - switchPublisherNames_6: - switchPublisherNames_7: - switchPublisherNames_8: - switchPublisherNames_9: - switchPublisherNames_10: - switchPublisherNames_11: - switchPublisherNames_12: - switchPublisherNames_13: - switchPublisherNames_14: - switchPublisherNames_15: - switchIcons_0: {fileID: 0} - switchIcons_1: {fileID: 0} - switchIcons_2: {fileID: 0} - switchIcons_3: {fileID: 0} - switchIcons_4: {fileID: 0} - switchIcons_5: {fileID: 0} - switchIcons_6: {fileID: 0} - switchIcons_7: {fileID: 0} - switchIcons_8: {fileID: 0} - switchIcons_9: {fileID: 0} - switchIcons_10: {fileID: 0} - switchIcons_11: {fileID: 0} - switchIcons_12: {fileID: 0} - switchIcons_13: {fileID: 0} - switchIcons_14: {fileID: 0} - switchIcons_15: {fileID: 0} - switchSmallIcons_0: {fileID: 0} - switchSmallIcons_1: {fileID: 0} - switchSmallIcons_2: {fileID: 0} - switchSmallIcons_3: {fileID: 0} - switchSmallIcons_4: {fileID: 0} - switchSmallIcons_5: {fileID: 0} - switchSmallIcons_6: {fileID: 0} - switchSmallIcons_7: {fileID: 0} - switchSmallIcons_8: {fileID: 0} - switchSmallIcons_9: {fileID: 0} - switchSmallIcons_10: {fileID: 0} - switchSmallIcons_11: {fileID: 0} - switchSmallIcons_12: {fileID: 0} - switchSmallIcons_13: {fileID: 0} - switchSmallIcons_14: {fileID: 0} - switchSmallIcons_15: {fileID: 0} - switchManualHTML: - switchAccessibleURLs: - switchLegalInformation: - switchMainThreadStackSize: 1048576 - switchPresenceGroupId: - switchLogoHandling: 0 - switchReleaseVersion: 0 - switchDisplayVersion: 1.0.0 - switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 - switchSupportedLanguagesMask: 0 - switchLogoType: 0 - switchApplicationErrorCodeCategory: - switchUserAccountSaveDataSize: 0 - switchUserAccountSaveDataJournalSize: 0 - switchApplicationAttribute: 0 - switchCardSpecSize: -1 - switchCardSpecClock: -1 - switchRatingsMask: 0 - switchRatingsInt_0: 0 - switchRatingsInt_1: 0 - switchRatingsInt_2: 0 - switchRatingsInt_3: 0 - switchRatingsInt_4: 0 - switchRatingsInt_5: 0 - switchRatingsInt_6: 0 - switchRatingsInt_7: 0 - switchRatingsInt_8: 0 - switchRatingsInt_9: 0 - switchRatingsInt_10: 0 - switchRatingsInt_11: 0 - switchRatingsInt_12: 0 - switchLocalCommunicationIds_0: - switchLocalCommunicationIds_1: - switchLocalCommunicationIds_2: - switchLocalCommunicationIds_3: - switchLocalCommunicationIds_4: - switchLocalCommunicationIds_5: - switchLocalCommunicationIds_6: - switchLocalCommunicationIds_7: - switchParentalControl: 0 - switchAllowsScreenshot: 1 - switchAllowsVideoCapturing: 1 - switchAllowsRuntimeAddOnContentInstall: 0 - switchDataLossConfirmation: 0 - switchUserAccountLockEnabled: 0 - switchSystemResourceMemory: 16777216 - switchSupportedNpadStyles: 3 - switchNativeFsCacheSize: 32 - switchIsHoldTypeHorizontal: 0 - switchSupportedNpadCount: 8 - switchSocketConfigEnabled: 0 - switchTcpInitialSendBufferSize: 32 - switchTcpInitialReceiveBufferSize: 64 - switchTcpAutoSendBufferSizeMax: 256 - switchTcpAutoReceiveBufferSizeMax: 256 - switchUdpSendBufferSize: 9 - switchUdpReceiveBufferSize: 42 - switchSocketBufferEfficiency: 4 - switchSocketInitializeEnabled: 1 - switchNetworkInterfaceManagerInitializeEnabled: 1 - switchPlayerConnectionEnabled: 1 - ps4NPAgeRating: 12 - ps4NPTitleSecret: - ps4NPTrophyPackPath: - ps4ParentalLevel: 1 - ps4ContentID: ED1633-NPXX51362_00-0000000000000000 - ps4Category: 0 - ps4MasterVersion: 01.00 - ps4AppVersion: 01.00 - ps4AppType: 0 - ps4ParamSfxPath: - ps4VideoOutPixelFormat: 0 - ps4VideoOutInitialWidth: 1920 - ps4VideoOutBaseModeInitialWidth: 1920 - ps4VideoOutReprojectionRate: 120 - ps4PronunciationXMLPath: - ps4PronunciationSIGPath: - ps4BackgroundImagePath: - ps4StartupImagePath: - ps4StartupImagesFolder: - ps4IconImagesFolder: - ps4SaveDataImagePath: - ps4SdkOverride: - ps4BGMPath: - ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: - ps4ExtraSceSysFile: - ps4NPtitleDatPath: - ps4RemotePlayKeyAssignment: -1 - ps4RemotePlayKeyMappingDir: - ps4PlayTogetherPlayerCount: 0 - ps4EnterButtonAssignment: 1 - ps4ApplicationParam1: 0 - ps4ApplicationParam2: 0 - ps4ApplicationParam3: 0 - ps4ApplicationParam4: 0 - ps4DownloadDataSize: 0 - ps4GarlicHeapSize: 2048 - ps4ProGarlicHeapSize: 2560 - ps4Passcode: eaoEiIgxIX4a2dREbbSqWy6yhKIDCdJO - ps4pnSessions: 1 - ps4pnPresence: 1 - ps4pnFriends: 1 - ps4pnGameCustomData: 1 - playerPrefsSupport: 0 - enableApplicationExit: 0 - resetTempFolder: 1 - restrictedAudioUsageRights: 0 - ps4UseResolutionFallback: 0 - ps4ReprojectionSupport: 0 - ps4UseAudio3dBackend: 0 - ps4SocialScreenEnabled: 0 - ps4ScriptOptimizationLevel: 3 - ps4Audio3dVirtualSpeakerCount: 14 - ps4attribCpuUsage: 0 - ps4PatchPkgPath: - ps4PatchLatestPkgPath: - ps4PatchChangeinfoPath: - ps4PatchDayOne: 0 - ps4attribUserManagement: 0 - ps4attribMoveSupport: 0 - ps4attrib3DSupport: 0 - ps4attribShareSupport: 0 - ps4attribExclusiveVR: 0 - ps4disableAutoHideSplash: 0 - ps4videoRecordingFeaturesUsed: 0 - ps4contentSearchFeaturesUsed: 0 - ps4CompatibilityPS5: 0 - ps4AllowPS5Detection: 0 - ps4GPU800MHz: 1 - ps4attribEyeToEyeDistanceSettingVR: 0 - ps4IncludedModules: [] - monoEnv: - splashScreenBackgroundSourceLandscape: {fileID: 0} - splashScreenBackgroundSourcePortrait: {fileID: 0} - spritePackerPolicy: - webGLMemorySize: 256 - webGLExceptionSupport: 1 - webGLNameFilesAsHashes: 0 - webGLDataCaching: 0 - webGLDebugSymbols: 0 - webGLEmscriptenArgs: - webGLModulesDirectory: - webGLTemplate: APPLICATION:Default - webGLAnalyzeBuildSize: 0 - webGLUseEmbeddedResources: 0 - webGLCompressionFormat: 1 - webGLLinkerTarget: 1 - webGLThreadsSupport: 0 - scriptingDefineSymbols: - 1: CROSS_PLATFORM_INPUT - 2: CROSS_PLATFORM_INPUT - 4: CROSS_PLATFORM_INPUT;MOBILE_INPUT - 7: CROSS_PLATFORM_INPUT;MOBILE_INPUT - 14: MOBILE_INPUT - 15: CROSS_PLATFORM_INPUT;MOBILE_INPUT - 16: CROSS_PLATFORM_INPUT;MOBILE_INPUT - 17: MOBILE_INPUT - 20: MOBILE_INPUT - platformArchitecture: {} - scriptingBackend: - Standalone: 0 - il2cppCompilerConfiguration: {} - managedStrippingLevel: {} - incrementalIl2cppBuild: {} - allowUnsafeCode: 0 - additionalIl2CppArgs: - scriptingRuntimeVersion: 1 - apiCompatibilityLevelPerPlatform: {} - m_RenderingPath: 1 - m_MobileRenderingPath: 1 - metroPackageName: DarkRift2 - metroPackageVersion: - metroCertificatePath: - metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: - metroCertificateNotAfter: 0000000000000000 - metroApplicationDescription: DarkRift2 - wsaImages: {} - metroTileShortName: - metroTileShowName: 0 - metroMediumTileShowName: 0 - metroLargeTileShowName: 0 - metroWideTileShowName: 0 - metroSupportStreamingInstall: 0 - metroLastRequiredScene: 0 - metroDefaultTileSize: 1 - metroTileForegroundText: 1 - metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} - metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} - metroSplashScreenUseBackgroundColor: 0 - platformCapabilities: {} - metroTargetDeviceFamilies: {} - metroFTAName: - metroFTAFileTypes: [] - metroProtocolName: - metroCompilationOverrides: 1 - XboxOneProductId: - XboxOneUpdateKey: - XboxOneSandboxId: - XboxOneContentId: - XboxOneTitleId: - XboxOneSCId: - XboxOneGameOsOverridePath: - XboxOnePackagingOverridePath: - XboxOneAppManifestOverridePath: - XboxOneVersion: 1.0.0.0 - XboxOnePackageEncryption: 0 - XboxOnePackageUpdateGranularity: 2 - XboxOneDescription: - XboxOneLanguage: - - enus - XboxOneCapability: [] - XboxOneGameRating: {} - XboxOneIsContentPackage: 0 - XboxOneEnableGPUVariability: 0 - XboxOneSockets: {} - XboxOneSplashScreen: {fileID: 0} - XboxOneAllowedProductIds: [] - XboxOnePersistentLocalStorageSize: 0 - XboxOneXTitleMemory: 8 - xboxOneScriptCompiler: 0 - XboxOneOverrideIdentityName: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} - cloudServicesEnabled: {} - luminIcon: - m_Name: - m_ModelFolderPath: - m_PortalFolderPath: - luminCert: - m_CertPath: - m_PrivateKeyPath: - luminIsChannelApp: 0 - luminVersion: - m_VersionCode: 1 - m_VersionName: - facebookSdkVersion: 7.9.4 - facebookAppId: - facebookCookies: 1 - facebookLogging: 1 - facebookStatus: 1 - facebookXfbml: 0 - facebookFrictionlessRequests: 1 - apiCompatibilityLevel: 6 - cloudProjectId: - framebufferDepthMemorylessMode: 0 - projectName: - organizationId: - cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 - legacyClampBlendShapeWeights: 1 diff --git a/DarkRift.Unity/ProjectSettings/ProjectVersion.txt b/DarkRift.Unity/ProjectSettings/ProjectVersion.txt deleted file mode 100644 index ff8802c..0000000 --- a/DarkRift.Unity/ProjectSettings/ProjectVersion.txt +++ /dev/null @@ -1 +0,0 @@ -m_EditorVersion: 2018.4.36f1 diff --git a/DarkRift.Unity/ProjectSettings/QualitySettings.asset b/DarkRift.Unity/ProjectSettings/QualitySettings.asset deleted file mode 100644 index d8e2099..0000000 --- a/DarkRift.Unity/ProjectSettings/QualitySettings.asset +++ /dev/null @@ -1,170 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!47 &1 -QualitySettings: - m_ObjectHideFlags: 0 - serializedVersion: 5 - m_CurrentQuality: 3 - m_QualitySettings: - - serializedVersion: 2 - name: Fastest - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 15 - shadowNearPlaneOffset: 2 - shadowCascade2Split: .333333343 - shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} - blendWeights: 1 - textureQuality: 1 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: .300000012 - maximumLODLevel: 0 - particleRaycastBudget: 4 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Fast - pixelLightCount: 0 - shadows: 0 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 2 - shadowCascade2Split: .333333343 - shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 0 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: .400000006 - maximumLODLevel: 0 - particleRaycastBudget: 16 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Simple - pixelLightCount: 1 - shadows: 1 - shadowResolution: 0 - shadowProjection: 1 - shadowCascades: 1 - shadowDistance: 20 - shadowNearPlaneOffset: 2 - shadowCascade2Split: .333333343 - shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 0 - realtimeReflectionProbes: 0 - billboardsFaceCameraPosition: 0 - vSyncCount: 0 - lodBias: .699999988 - maximumLODLevel: 0 - particleRaycastBudget: 64 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Good - pixelLightCount: 2 - shadows: 2 - shadowResolution: 1 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 40 - shadowNearPlaneOffset: 2 - shadowCascade2Split: .333333343 - shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} - blendWeights: 2 - textureQuality: 0 - anisotropicTextures: 1 - antiAliasing: 0 - softParticles: 0 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1 - maximumLODLevel: 0 - particleRaycastBudget: 256 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Beautiful - pixelLightCount: 3 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 2 - shadowDistance: 70 - shadowNearPlaneOffset: 2 - shadowCascade2Split: .333333343 - shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 1.5 - maximumLODLevel: 0 - particleRaycastBudget: 1024 - excludedTargetPlatforms: [] - - serializedVersion: 2 - name: Fantastic - pixelLightCount: 4 - shadows: 2 - shadowResolution: 2 - shadowProjection: 1 - shadowCascades: 4 - shadowDistance: 150 - shadowNearPlaneOffset: 2 - shadowCascade2Split: .333333343 - shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} - blendWeights: 4 - textureQuality: 0 - anisotropicTextures: 2 - antiAliasing: 2 - softParticles: 1 - softVegetation: 1 - realtimeReflectionProbes: 1 - billboardsFaceCameraPosition: 1 - vSyncCount: 1 - lodBias: 2 - maximumLODLevel: 0 - particleRaycastBudget: 4096 - excludedTargetPlatforms: [] - m_PerPlatformDefaultQuality: - Android: 2 - BlackBerry: 2 - FlashPlayer: 3 - GLES Emulation: 3 - PS3: 3 - PS4: 3 - PSM: 3 - PSP2: 3 - Samsung TV: 2 - Standalone: 3 - Tizen: 2 - WP8: 3 - Web: 3 - Windows Store Apps: 3 - XBOX360: 3 - XboxOne: 3 - iPhone: 2 diff --git a/DarkRift.Unity/ProjectSettings/TagManager.asset b/DarkRift.Unity/ProjectSettings/TagManager.asset deleted file mode 100644 index 1c92a78..0000000 --- a/DarkRift.Unity/ProjectSettings/TagManager.asset +++ /dev/null @@ -1,43 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!78 &1 -TagManager: - serializedVersion: 2 - tags: [] - layers: - - Default - - TransparentFX - - Ignore Raycast - - - - Water - - UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_SortingLayers: - - name: Default - uniqueID: 0 - locked: 0 diff --git a/DarkRift.Unity/ProjectSettings/TimeManager.asset b/DarkRift.Unity/ProjectSettings/TimeManager.asset deleted file mode 100644 index f0e494b..0000000 --- a/DarkRift.Unity/ProjectSettings/TimeManager.asset +++ /dev/null @@ -1,8 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!5 &1 -TimeManager: - m_ObjectHideFlags: 0 - Fixed Timestep: .0199999996 - Maximum Allowed Timestep: .333333343 - m_TimeScale: 1 diff --git a/DarkRift.Unity/ProjectSettings/UnityConnectSettings.asset b/DarkRift.Unity/ProjectSettings/UnityConnectSettings.asset deleted file mode 100644 index fa0b146..0000000 --- a/DarkRift.Unity/ProjectSettings/UnityConnectSettings.asset +++ /dev/null @@ -1,34 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!310 &1 -UnityConnectSettings: - m_ObjectHideFlags: 0 - serializedVersion: 1 - m_Enabled: 0 - m_TestMode: 0 - m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events - m_EventUrl: https://cdp.cloud.unity3d.com/v1/events - m_ConfigUrl: https://config.uca.cloud.unity3d.com - m_TestInitMode: 0 - CrashReportingSettings: - m_EventUrl: https://perf-events.cloud.unity3d.com - m_Enabled: 0 - m_LogBufferSize: 10 - m_CaptureEditorExceptions: 1 - UnityPurchasingSettings: - m_Enabled: 0 - m_TestMode: 0 - UnityAnalyticsSettings: - m_Enabled: 0 - m_TestMode: 0 - m_InitializeOnStartup: 1 - UnityAdsSettings: - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_IosGameId: - m_AndroidGameId: - m_GameIds: {} - m_GameId: - PerformanceReportingSettings: - m_Enabled: 0 diff --git a/DarkRift.Unity/ProjectSettings/VFXManager.asset b/DarkRift.Unity/ProjectSettings/VFXManager.asset deleted file mode 100644 index 6e0eaca..0000000 --- a/DarkRift.Unity/ProjectSettings/VFXManager.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!937362698 &1 -VFXManager: - m_ObjectHideFlags: 0 - m_IndirectShader: {fileID: 0} - m_CopyBufferShader: {fileID: 0} - m_SortShader: {fileID: 0} - m_RenderPipeSettingsPath: - m_FixedTimeStep: 0.016666668 - m_MaxDeltaTime: 0.05 diff --git a/DarkRift/Properties/AssemblyInfo.cs b/DarkRift/AssemblyInfo.cs similarity index 66% rename from DarkRift/Properties/AssemblyInfo.cs rename to DarkRift/AssemblyInfo.cs index b10c721..ef35645 100644 --- a/DarkRift/Properties/AssemblyInfo.cs +++ b/DarkRift/AssemblyInfo.cs @@ -4,9 +4,10 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +using System.Reflection; using System.Runtime.CompilerServices; -//Make internals visible for testing -[assembly: InternalsVisibleTo("DarkRift.Testing")] +[assembly: DarkRift.Preserve] [assembly: InternalsVisibleTo("DarkRift.Client")] -[assembly: InternalsVisibleTo("DarkRift.Server")] \ No newline at end of file +[assembly: InternalsVisibleTo("DarkRift.Server")] +[assembly: InternalsVisibleTo("DarkRift.Tests")] diff --git a/DarkRift.Client/Properties/AssemblyInfo.cs b/DarkRift/AssemblyInfo.gen.cs similarity index 52% rename from DarkRift.Client/Properties/AssemblyInfo.cs rename to DarkRift/AssemblyInfo.gen.cs index 2feef8a..47dbff7 100644 --- a/DarkRift.Client/Properties/AssemblyInfo.cs +++ b/DarkRift/AssemblyInfo.gen.cs @@ -1,6 +1,10 @@ -/* +/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +// +// Do not modify this file manually +// This file is is updated based on the version found on package.json +[assembly: System.Reflection.AssemblyVersion("2.10.1")] diff --git a/DarkRift/DarkRift.asmdef b/DarkRift/DarkRift.asmdef new file mode 100644 index 0000000..0f72d06 --- /dev/null +++ b/DarkRift/DarkRift.asmdef @@ -0,0 +1,14 @@ +{ + "name": "DarkRift", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": true +} \ No newline at end of file diff --git a/DarkRift/PreserveAttribute.cs b/DarkRift/PreserveAttribute.cs new file mode 100644 index 0000000..a1f6d7a --- /dev/null +++ b/DarkRift/PreserveAttribute.cs @@ -0,0 +1,10 @@ +namespace DarkRift +{ + /// + /// Instructs Unity to preserve all types from target assembly. + /// See Managed Code Stripping. + /// + public class PreserveAttribute : System.Attribute + { + } +} diff --git a/.props b/MSBuild~/.props similarity index 100% rename from .props rename to MSBuild~/.props diff --git a/.targets b/MSBuild~/.targets similarity index 100% rename from .targets rename to MSBuild~/.targets diff --git a/DarkRift.Client/DarkRift.Client.csproj b/MSBuild~/DarkRift.Client.csproj similarity index 80% rename from DarkRift.Client/DarkRift.Client.csproj rename to MSBuild~/DarkRift.Client.csproj index 2e9b9c4..e8ecea7 100644 --- a/DarkRift.Client/DarkRift.Client.csproj +++ b/MSBuild~/DarkRift.Client.csproj @@ -2,7 +2,12 @@ + + + + + true net3.5;netstandard2.0 netstandard2.0 bin\$(Configuration)\$(TargetFramework)\DarkRift.Client.xml @@ -11,11 +16,11 @@ - + - + @@ -23,7 +28,7 @@ - + diff --git a/DarkRift.Server/DarkRift.Server.csproj b/MSBuild~/DarkRift.Server.csproj similarity index 77% rename from DarkRift.Server/DarkRift.Server.csproj rename to MSBuild~/DarkRift.Server.csproj index 644f32b..ac2ede7 100644 --- a/DarkRift.Server/DarkRift.Server.csproj +++ b/MSBuild~/DarkRift.Server.csproj @@ -1,8 +1,13 @@  - + + + + + + true net3.5;netstandard2.0 netstandard2.0 bin\$(Configuration)\$(TargetFramework)\DarkRift.Server.xml @@ -11,7 +16,7 @@ - + @@ -23,7 +28,7 @@ - - + + diff --git a/DarkRift/DarkRift.csproj b/MSBuild~/DarkRift.csproj similarity index 85% rename from DarkRift/DarkRift.csproj rename to MSBuild~/DarkRift.csproj index 4678203..512029d 100644 --- a/DarkRift/DarkRift.csproj +++ b/MSBuild~/DarkRift.csproj @@ -2,7 +2,12 @@ + + + + + true net3.5;netstandard2.0 netstandard2.0 bin\$(Configuration)\$(TargetFramework)\DarkRift.xml diff --git a/DarkRift2.sln b/MSBuild~/DarkRift2.sln similarity index 67% rename from DarkRift2.sln rename to MSBuild~/DarkRift2.sln index b177e42..7f2fc7e 100644 --- a/DarkRift2.sln +++ b/MSBuild~/DarkRift2.sln @@ -5,40 +5,23 @@ VisualStudioVersion = 16.0.29911.84 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4FF06EA-45F9-4D56-9ED8-5EC6335F617E}" ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig + ..\.editorconfig = ..\.editorconfig .props = .props .targets = .targets - bitbucket-pipelines.yml = bitbucket-pipelines.yml - ReadMe.md = ReadMe.md - DarkRift.Schemas\Server.config.xsd = DarkRift.Schemas\Server.config.xsd EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Client", "DarkRift.Client\DarkRift.Client.csproj", "{44FBEEB9-2D0D-4025-9E43-BE436983C335}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Client", "DarkRift.Client.csproj", "{44FBEEB9-2D0D-4025-9E43-BE436983C335}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift", "DarkRift\DarkRift.csproj", "{1324A37A-AC08-44CF-85DE-E9A05876E1EC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift", "DarkRift.csproj", "{1324A37A-AC08-44CF-85DE-E9A05876E1EC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Server", "DarkRift.Server\DarkRift.Server.csproj", "{922AA4BA-B14E-40B7-96C5-980E21BA03CF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Server", "DarkRift.Server.csproj", "{922AA4BA-B14E-40B7-96C5-980E21BA03CF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Server.Console", "DarkRift.Server.Console\DarkRift.Server.Console.csproj", "{138B0F99-4B3D-48C5-95B6-19AFB72331C6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Testing", "DarkRift.Testing\DarkRift.Testing.csproj", "{BCC508DD-AF2D-413C-B79F-00F4323528B5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.Server.Testing", "DarkRift.Server.Testing\DarkRift.Server.Testing.csproj", "{81DEEF02-0CBB-45D7-B734-3D7152B5B37F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DarkRift.Schemas", "DarkRift.Schemas", "{7A08EBFF-18F5-45C2-A7AF-FC859D4208D0}" - ProjectSection(SolutionItems) = preProject - DarkRift.Schemas\Cluster.config.xsd = DarkRift.Schemas\Cluster.config.xsd - DarkRift.Schemas\Server.config.xsd = DarkRift.Schemas\Server.config.xsd - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkRift.SystemTesting", "DarkRift.SystemTesting\DarkRift.SystemTesting.csproj", "{832116B6-841F-44F0-BCA7-0905055D3E79}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{B25EA3A4-5663-409B-B817-82DD8E043E13}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{B25EA3A4-5663-409B-B817-82DD8E043E13}" ProjectSection(SolutionItems) = preProject - scripts\get_version.py = scripts\get_version.py - scripts\post_release.sh = scripts\post_release.sh - scripts\release.sh = scripts\release.sh - scripts\update_props.py = scripts\update_props.py + Scripts\get_version.py = Scripts\get_version.py + Scripts\post_release.sh = Scripts\post_release.sh + Scripts\release.sh = Scripts\release.sh + Scripts\update_props.py = Scripts\update_props.py EndProjectSection EndProject Global diff --git a/scripts/get_version.py b/MSBuild~/Scripts/get_version.py similarity index 66% rename from scripts/get_version.py rename to MSBuild~/Scripts/get_version.py index e386ce0..c7d7dcd 100644 --- a/scripts/get_version.py +++ b/MSBuild~/Scripts/get_version.py @@ -1,12 +1,16 @@ #!/usr/bin/env python +import os import sys """ Get version from .props file. """ def get_version_number(): + dirname = os.path.dirname(__file__) + props = os.path.join(dirname, '../.props') + import xml.etree.ElementTree as ET - xmldoc = ET.parse("./.props") + xmldoc = ET.parse(props) root = xmldoc.getroot() return root.find("PropertyGroup").find("Version").text diff --git a/scripts/post_release.sh b/MSBuild~/Scripts/post_release.sh similarity index 100% rename from scripts/post_release.sh rename to MSBuild~/Scripts/post_release.sh diff --git a/scripts/release.sh b/MSBuild~/Scripts/release.sh similarity index 100% rename from scripts/release.sh rename to MSBuild~/Scripts/release.sh diff --git a/scripts/update_props.py b/MSBuild~/Scripts/update_props.py similarity index 79% rename from scripts/update_props.py rename to MSBuild~/Scripts/update_props.py index 072a766..a4cc6ef 100644 --- a/scripts/update_props.py +++ b/MSBuild~/Scripts/update_props.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import os import sys VERSION_PATTERN = r"^\d+\.\d+\.\d+$" @@ -16,13 +17,16 @@ def validate_version_number(version_number): Update version in .props file. """ def update_version_number(version_number): + dirname = os.path.dirname(__file__) + props = os.path.join(dirname, '../.props') + import xml.etree.ElementTree as ET - xmldoc = ET.parse("./.props") + xmldoc = ET.parse(props) root = xmldoc.getroot() root.find("PropertyGroup").find("Version").text = version_number - xmldoc.write("./.props") + xmldoc.write(props) if validate_version_number(sys.argv[1]): update_version_number(sys.argv[1]) diff --git a/README.md b/README.md deleted file mode 100644 index 02612fd..0000000 --- a/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Hello! -Welcome to the DarkRift 2 open source project! - -DarkRift 1 and 2 were originally written by Jamie Read. DarkRift 2 has since been open sourced under the care of Unordinal AB and the DarkRift community. - -## Building -This project requires Microsoft Visual Studio 2022 (the free Community edition is fine) or at least one Visual C# project will fail to build in VS2019 and below. See detailed exposition in [BUILDING.md](BUILDING.md) - -## Source Code License -Most source files are licensed under MPL 2.0, with some exceptions where MIT applies. See [LICENSE.md](LICENSE.md) - -## Contributing -We are happy to see community contributions to this project. See [CONTRIBUTING.md](CONTRIBUTING.md) - -## Code of Conduct -Be civil. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - -## Wiki -The [wiki](https://github.com/DarkRiftNetworking/DarkRift-Networking/wiki) is publicly editable and is a place for anyone to add content, code snippets, tutorials and anything that would be useful to other members of the DarkRift Networking community. - -Feel free to add pages and use the space as you wish. You are more than welcome (and even encouraged) to cross post from personal blogs and link to external sites (as long as it's relevant)! - -DarkRift Networking is not responsible for any content or links on the wiki, although we will monitor it nevertheless. diff --git a/package.json b/package.json new file mode 100644 index 0000000..f237a0b --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "com.unordial.darkrift", + "version": "2.10.1", + "displayName": "DarkRift", + "description": "DarkRift Networking", + "keywords": [ + "editor" + ], + "author": { + "name": "Francisco Requena", + "email": "frarees@gmail.com", + "url": "https://frarees.github.io" + } +} \ No newline at end of file