initial
This commit is contained in:
Executable
+14
@@ -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>
|
||||
Executable
+18
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
using NLog;
|
||||
using Ragon.Core;
|
||||
|
||||
namespace Game.Source
|
||||
{
|
||||
public class ArenaPlugin: PluginBase
|
||||
{
|
||||
private ILogger _logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
// _logger.Info("Plugin started");
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
// _logger.Info("Plugin stopped");
|
||||
}
|
||||
|
||||
public long FindPrimeNumber(int n)
|
||||
{
|
||||
int count=0;
|
||||
long a = 2;
|
||||
while(count<n)
|
||||
{
|
||||
long b = 2;
|
||||
int prime = 1;// to check if found a prime
|
||||
while(b * b <= a)
|
||||
{
|
||||
if(a % b == 0)
|
||||
{
|
||||
prime = 0;
|
||||
break;
|
||||
}
|
||||
b++;
|
||||
}
|
||||
if(prime > 0)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
return (--a);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Game.Source.Events;
|
||||
|
||||
public class SpawnEvent
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Ragon.Core;
|
||||
|
||||
namespace Game.Source
|
||||
{
|
||||
public class GameFactory : PluginFactory
|
||||
{
|
||||
public PluginBase CreatePlugin(string map)
|
||||
{
|
||||
// if (map == "spawn")
|
||||
// return new SpawnPlugin();
|
||||
//
|
||||
// if (map == "arena")
|
||||
// return new ArenaPlugin();
|
||||
return new SpawnPlugin();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
using Game.Source.Events;
|
||||
using NLog;
|
||||
using Ragon.Core;
|
||||
|
||||
namespace Game.Source
|
||||
{
|
||||
public class SpawnPlugin: PluginBase
|
||||
{
|
||||
private ILogger _logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public void SpawnEvent(SpawnEvent evnt)
|
||||
{
|
||||
|
||||
}
|
||||
public override void OnStart()
|
||||
{
|
||||
Subscribe<SpawnEvent>(SpawnEvent);
|
||||
|
||||
_logger.Info("Plugin started");
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
_logger.Info("Plugin stopped");
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
<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>
|
||||
|
||||
</Project>
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"server": {
|
||||
"port": 4444,
|
||||
"skipTimeout": 60
|
||||
},
|
||||
"blacklist": [
|
||||
"пидор",
|
||||
"сука",
|
||||
"хуидор",
|
||||
"хуй",
|
||||
"Hitler",
|
||||
"Гитлер",
|
||||
"Гей",
|
||||
"Админ",
|
||||
"admin",
|
||||
"падла",
|
||||
"уебок",
|
||||
"собака",
|
||||
"пидорас",
|
||||
"мразь",
|
||||
"ебасос",
|
||||
"еблан",
|
||||
"ебучий",
|
||||
"дрочь"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user