chore: removed unused project
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"serverType": "enet",
|
"serverType": "enet",
|
||||||
"serverTickRate": 30,
|
"serverTickRate": 30,
|
||||||
"gameProtocol": "1.0.0",
|
"gameProtocol": "1.0.0",
|
||||||
"port": 5001,
|
"port": 5000,
|
||||||
"limitConnections": 4095,
|
"limitConnections": 4095,
|
||||||
"limitPlayersPerRoom": 20,
|
"limitPlayersPerRoom": 20,
|
||||||
"limitRooms": 200
|
"limitRooms": 200
|
||||||
|
|||||||
@@ -1,154 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
|
|
||||||
*
|
|
||||||
* 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<byte>());
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
|
|
||||||
<RootNamespace>Ragon.Core.Tests</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
|
||||||
<PackageReference Include="xunit" Version="2.4.2" />
|
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Ragon.Client\Ragon.Client.csproj" />
|
|
||||||
<ProjectReference Include="..\Ragon.Server\Ragon.Server.csproj" />
|
|
||||||
<ProjectReference Include="..\Ragon.Protocol\Ragon.Protocol.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
|
|
||||||
*
|
|
||||||
* 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;
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
|
|
||||||
*
|
|
||||||
* 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}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client", "Ragon.Clien
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client.Simulation", "Ragon.Client.Simulation\Ragon.Client.Simulation.csproj", "{0384848D-3B63-4B3A-B15F-A836EBB3E95D}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client.Simulation", "Ragon.Client.Simulation\Ragon.Client.Simulation.csproj", "{0384848D-3B63-4B3A-B15F-A836EBB3E95D}"
|
||||||
EndProject
|
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}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ragon.Client.Property", "Ragon.Client.Property\Ragon.Client.Property.csproj", "{46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
@@ -52,10 +50,6 @@ Global
|
|||||||
{0384848D-3B63-4B3A-B15F-A836EBB3E95D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{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.ActiveCfg = Release|Any CPU
|
||||||
{0384848D-3B63-4B3A-B15F-A836EBB3E95D}.Release|Any CPU.Build.0 = 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.ActiveCfg = Debug|Any CPU
|
||||||
{46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}.Debug|Any CPU.Build.0 = 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
|
{46A60DAB-F854-4BB6-A119-BD4C5B2B0D29}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|||||||
Reference in New Issue
Block a user