From b8dfc4cf417335b4306a74df9bf036d207ba47e9 Mon Sep 17 00:00:00 2001 From: edmand46 Date: Wed, 5 Apr 2023 18:48:37 +0400 Subject: [PATCH] chore: removed unused project --- Ragon.Relay/relay.config.json | 2 +- Ragon.Tests/Basic.cs | 154 --------------------------- Ragon.Tests/Ragon.Tests.csproj | 32 ------ Ragon.Tests/Usings.cs | 17 --- Ragon.Tests/Utils/TestRagonLogger.cs | 50 --------- Ragon.sln | 6 -- 6 files changed, 1 insertion(+), 260 deletions(-) delete mode 100644 Ragon.Tests/Basic.cs delete mode 100644 Ragon.Tests/Ragon.Tests.csproj delete mode 100644 Ragon.Tests/Usings.cs delete mode 100644 Ragon.Tests/Utils/TestRagonLogger.cs diff --git a/Ragon.Relay/relay.config.json b/Ragon.Relay/relay.config.json index 715fa3c..c6faf4a 100644 --- a/Ragon.Relay/relay.config.json +++ b/Ragon.Relay/relay.config.json @@ -3,7 +3,7 @@ "serverType": "enet", "serverTickRate": 30, "gameProtocol": "1.0.0", - "port": 5001, + "port": 5000, "limitConnections": 4095, "limitPlayersPerRoom": 20, "limitRooms": 200 diff --git a/Ragon.Tests/Basic.cs b/Ragon.Tests/Basic.cs deleted file mode 100644 index 4e7e448..0000000 --- a/Ragon.Tests/Basic.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2023 Eduard Kargin - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using NLog; -using Ragon.Client; -using Ragon.Protocol; -using Xunit.Abstractions; - -namespace Ragon.Core.Tests; - -public class Connection -{ - private readonly ITestOutputHelper _testOutputHelper; - - public Connection(ITestOutputHelper testOutputHelper) - { - _testOutputHelper = testOutputHelper; - } - - public class Game : IRagonListener - { - private RagonClient _client; - - public Game(RagonClient client, TaskCompletionSource taskCompletionSource) - { - _client = client; - } - - public void OnConnected(RagonClient client) - { - Console.WriteLine("Console Connected"); - RagonLog.Trace("Connected"); - - client.Session.AuthorizeWithKey("defaultkey", "Player Eduard", Array.Empty()); - } - - public void OnAuthorizationSuccess(RagonClient client, string playerId, string playerName) - { - RagonLog.Trace("Authorized"); - - client.Session.Create("Example", 1, 20); - } - - public void OnAuthorizationFailed(RagonClient client, string message) - { - RagonLog.Trace($"Authorization failed: {message}"); - } - - public void OnJoined(RagonClient client) - { - } - - public void OnFailed(RagonClient client, string message) - { - RagonLog.Trace("Failed to join"); - } - - public void OnLeft(RagonClient client) - { - RagonLog.Trace("Left"); - } - - public void OnDisconnected(RagonClient client) - { - RagonLog.Trace("Disconnected"); - } - - public void OnPlayerJoined(RagonClient client, RagonPlayer player) - { - RagonLog.Trace("Player joined"); - } - - public void OnPlayerLeft(RagonClient client, RagonPlayer player) - { - RagonLog.Trace("Player left"); - } - - public void OnOwnershipChanged(RagonClient client, RagonPlayer player) - { - RagonLog.Trace("Owner ship changed"); - } - - public void OnLevel(RagonClient client, string sceneName) - { - RagonLog.Trace($"New level: {sceneName}"); - client.Room.SceneLoaded(); - } - } - - // [Fact] - // public async void Connect() - // { - // RagonLog.Set(new RagonXUnitLogger(_testOutputHelper)); - // - // var joining = new TaskCompletionSource(); - // var network = new RagonNetwork(); - // var game = new Game(network, joining); - // - // network.AddListener(game); - // - // var clientConfiguration = new RagonConnectionConfiguration(); - // clientConfiguration.Type = RagonConnectionType.UDP; - // clientConfiguration.Protocol = "1.0.0"; - // clientConfiguration.Address = "127.0.0.1"; - // clientConfiguration.Port = 5000; - // - // network.Connect(clientConfiguration); - // - // var relayConfiguration = new Configuration() - // { - // GameProtocol = "1.0.0", - // LimitConnections = 4095, - // LimitRooms = 20, - // LimitPlayersPerRoom = 20, - // Port = 5000, - // ServerKey = "defaultkey", - // ServerTickRate = 30, - // ServerType = "enet" - // }; - // - // var relay = new RagonServer(relayConfiguration); - // relay.Start(true); - // - // var ticks = 0; - // while (true) - // { - // ticks += 1; - // network.Update(); - // - // if (ticks > 100) - // break; - // - // await Task.Delay(100); - // } - // - // Assert.Equal(network.Status, RagonStatus.ROOM); - // - // network.Dispose(); - // relay.Dispose(); - // } -} \ No newline at end of file diff --git a/Ragon.Tests/Ragon.Tests.csproj b/Ragon.Tests/Ragon.Tests.csproj deleted file mode 100644 index 0085550..0000000 --- a/Ragon.Tests/Ragon.Tests.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - net7.0 - enable - enable - - false - - Ragon.Core.Tests - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - diff --git a/Ragon.Tests/Usings.cs b/Ragon.Tests/Usings.cs deleted file mode 100644 index 096f36b..0000000 --- a/Ragon.Tests/Usings.cs +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2023 Eduard Kargin - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -global using Xunit; \ No newline at end of file diff --git a/Ragon.Tests/Utils/TestRagonLogger.cs b/Ragon.Tests/Utils/TestRagonLogger.cs deleted file mode 100644 index 766387f..0000000 --- a/Ragon.Tests/Utils/TestRagonLogger.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023 Eduard Kargin - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Ragon.Client; -using Ragon.Protocol; -using Xunit.Abstractions; - -namespace Ragon.Core.Tests; - -public class RagonXUnitLogger: IRagonLogger -{ - private ITestOutputHelper _outputHelper; - public RagonXUnitLogger(ITestOutputHelper outputHelper) - { - _outputHelper = outputHelper; - } - - public void Warn(string message) - { - _outputHelper.WriteLine($"[Warn] {message}"); - } - - public void Trace(string message) - { - _outputHelper.WriteLine($"[Trace] {message}"); - } - - public void Info(string message) - { - _outputHelper.WriteLine($"[Info] {message}"); - } - - public void Error(string message) - { - _outputHelper.WriteLine($"[Error] {message}"); - } -} \ No newline at end of file diff --git a/Ragon.sln b/Ragon.sln index 20fb719..97863a5 100644 --- a/Ragon.sln +++ b/Ragon.sln @@ -14,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client", "Ragon.Clien EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client.Simulation", "Ragon.Client.Simulation\Ragon.Client.Simulation.csproj", "{0384848D-3B63-4B3A-B15F-A836EBB3E95D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Tests", "Ragon.Tests\Ragon.Tests.csproj", "{D1F44471-A700-4E7C-B047-334685850A5C}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client.Property", "Ragon.Client.Property\Ragon.Client.Property.csproj", "{46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}" EndProject Global @@ -52,10 +50,6 @@ Global {0384848D-3B63-4B3A-B15F-A836EBB3E95D}.Debug|Any CPU.Build.0 = Debug|Any CPU {0384848D-3B63-4B3A-B15F-A836EBB3E95D}.Release|Any CPU.ActiveCfg = Release|Any CPU {0384848D-3B63-4B3A-B15F-A836EBB3E95D}.Release|Any CPU.Build.0 = Release|Any CPU - {D1F44471-A700-4E7C-B047-334685850A5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D1F44471-A700-4E7C-B047-334685850A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D1F44471-A700-4E7C-B047-334685850A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D1F44471-A700-4E7C-B047-334685850A5C}.Release|Any CPU.Build.0 = Release|Any CPU {46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}.Debug|Any CPU.Build.0 = Debug|Any CPU {46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}.Release|Any CPU.ActiveCfg = Release|Any CPU