major update

This commit is contained in:
2023-03-06 10:06:43 +04:00
parent e84511e1ae
commit cbda5e9974
174 changed files with 7441 additions and 1975 deletions
+16
View File
@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /App
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/runtime:7.0
WORKDIR /App
COPY --from=build-env /App/out .
ENTRYPOINT ["Ragon.Relay"]
Executable → Regular
View File
Executable → Regular
+16 -17
View File
@@ -1,7 +1,18 @@
using System;
using System.Runtime.InteropServices;
using NLog;
using Ragon.Core;
/*
* 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.
*/
namespace Ragon.Relay
{
@@ -9,20 +20,8 @@ namespace Ragon.Relay
{
static void Main(string[] args)
{
var logger = LogManager.GetLogger("Ragon.Relay");
logger.Info("Relay Application");
var configuration = Configuration.Load("relay.config.json");
var relay = new Application(configuration);
logger.Info("Started");
var relay = new Relay();
relay.Start();
Console.ReadKey();
relay.Stop();
logger.Info("Stopped");
}
}
}
Executable → Regular
+8 -3
View File
@@ -2,8 +2,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Game</RootNamespace>
<RootNamespace>Ragon.Relay</RootNamespace>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
@@ -17,10 +17,15 @@
<None Update="relay.config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="libenet.dylib">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ragon.Core\Ragon.Core.csproj" />
<ProjectReference Include="..\Ragon.Server.ENet\Ragon.Server.ENet.csproj" />
<ProjectReference Include="..\Ragon.Server.DotNetWebSockets\Ragon.Server.DotNetWebSockets.csproj" />
<ProjectReference Include="..\Ragon.Server\Ragon.Server.csproj" />
</ItemGroup>
</Project>
+53
View File
@@ -0,0 +1,53 @@
/*
* 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.Server;
using Ragon.Server.ENet;
using Ragon.Server.DotNetWebsockets;
namespace Ragon.Relay;
public class Relay
{
public void Start()
{
var logger = LogManager.GetLogger("Ragon.Relay");
logger.Info("Relay Application");
var configuration = Configuration.Load("relay.config.json");
var serverType = Configuration.GetServerType(configuration.ServerType);
INetworkServer server = null;
switch (serverType)
{
case ServerType.ENET:
server = new ENetServer();
break;
case ServerType.WEBSOCKET:
server = new DotNetWebSocketServer();
break;
default:
server = new ENetServer();
break;
}
var relay = new RagonServer(server, configuration);
logger.Info("Started");
relay.Start();
}
}
+2 -2
View File
@@ -1,9 +1,9 @@
{
"serverKey": "defaultkey",
"serverType": "enet",
"serverTickRate": 20,
"serverTickRate": 30,
"gameProtocol": "1.0.0",
"port": 5000,
"port": 5001,
"limitConnections": 4095,
"limitPlayersPerRoom": 20,
"limitRooms": 200