refactoring: heap -> span

This commit is contained in:
2022-04-30 08:20:17 +04:00
parent 9ab5d4aca5
commit 2dd81cd859
36 changed files with 494 additions and 489 deletions
+26
View File
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Game</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Ragon\Ragon.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Source\Events" />
</ItemGroup>
</Project>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="logs/server-log-${shortdate}.log" layout="[${longdate}][${logger}][${level}] ${message} ${exception:format=ToString}" />
<target name="logconsole" xsi:type="Console" layout="[${date}][${logger}][${level}] ${message} ${exception:format=ToString}"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="logconsole" />
<logger name="*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>
+18
View File
@@ -0,0 +1,18 @@
using System;
using Game.Source;
using NetStack.Serialization;
using Ragon.Core;
namespace Game
{
class Program
{
static void Main(string[] args)
{
var bootstrap = new Bootstrap();
bootstrap.Configure(new GameFactory());
Console.Read();
}
}
}
+11
View File
@@ -0,0 +1,11 @@
using Ragon.Core;
namespace Game.Source;
public class GameAuthorizer: AuthorizationManager
{
public override bool OnAuthorize(uint peerId, byte[] payload)
{
return true;
}
}
+11
View File
@@ -0,0 +1,11 @@
using Ragon.Core;
namespace Game.Source
{
public class GameFactory : PluginFactory
{
public string PluginName { get; set; } = "ExamplePlugin";
public PluginBase CreatePlugin(string map) => new ExamplePlugin();
public AuthorizationManager CreateManager() => new GameAuthorizer();
}
}
+20
View File
@@ -0,0 +1,20 @@
using NLog;
using Ragon.Core;
namespace Game.Source
{
public class ExamplePlugin: PluginBase
{
private ILogger _logger = LogManager.GetCurrentClassLogger();
public override void OnStart()
{
_logger.Info("Plugin started");
}
public override void OnStop()
{
_logger.Info("Plugin stopped");
}
}
}
+27
View File
@@ -0,0 +1,27 @@
{
"apiKey": "123",
"server": {
"port": 4444,
"skipTimeout": 60
},
"blacklist": [
"пидор",
"сука",
"хуидор",
"хуй",
"Hitler",
"Гитлер",
"Гей",
"Админ",
"admin",
"падла",
"уебок",
"собака",
"пидорас",
"мразь",
"ебасос",
"еблан",
"ебучий",
"дрочь"
]
}