chore: move to thread application logic, updated logo

This commit is contained in:
2022-05-18 22:17:25 +04:00
parent 8481cb89ad
commit 35ca016520
4 changed files with 22 additions and 9 deletions

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

+14 -6
View File
@@ -16,6 +16,8 @@ namespace Ragon.Core
private readonly ENetServer _socketServer;
private int _roomThreadBalancer = 0;
private Thread _thread;
public Application(PluginFactory factory, Configuration configuration, int threadsCount)
{
_socketServer = new ENetServer();
@@ -29,13 +31,8 @@ namespace Ragon.Core
}
}
public void Start()
private void Loop()
{
_socketServer.Start(_configuration.Server.Port);
foreach (var roomThread in _roomThreads)
roomThread.Start();
while (true)
{
foreach (var roomThread in _roomThreads)
@@ -79,6 +76,17 @@ namespace Ragon.Core
}
}
public void Start()
{
_socketServer.Start(_configuration.Server.Port);
foreach (var roomThread in _roomThreads)
roomThread.Start();
_thread = new Thread(Loop);
_thread.Start();
}
public void Dispose()
{
foreach (var roomThread in _roomThreads)
+6 -2
View File
@@ -1,4 +1,7 @@
using NLog;
using System;
using System.Diagnostics;
using System.IO;
using NLog;
namespace Ragon.Core
{
@@ -9,7 +12,8 @@ namespace Ragon.Core
public void Configure(PluginFactory factory)
{
_logger.Info("Configure application...");
var configuration = ConfigurationLoader.Load("config.json");
var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json");
var configuration = ConfigurationLoader.Load(filePath);
var app = new Application(factory, configuration, 2);
app.Start();
}
+2 -1
View File
@@ -1,5 +1,5 @@
<p align="center">
<img src="Images/logo.png" width="200" >
<img src="Images/ragon-logo.png" width="200" >
</p>
## Ragon Server
@@ -37,6 +37,7 @@ Ragon is fully free high perfomance room based game server with plugin based arc
### Requirements
- OSX, Windows, Linux(Ubuntu, Debian)
- .NET 6.0
### Dependencies
* ENet-Sharp v2.4.8
* NetStack latest