You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
669 B
31 lines
669 B
using Fleck;
|
|
using RSND.Core;
|
|
using RSND.Core.DbInternals;
|
|
|
|
namespace RSND;
|
|
|
|
public static class RsndMain
|
|
{
|
|
public static Database Db = new(Environment.GetCommandLineArgs()[1]);
|
|
|
|
public static void Run()
|
|
{
|
|
Db.SetupFiles();
|
|
Db.Save();
|
|
|
|
WebSocketServer server = new WebSocketServer("ws://0.0.0.0:7878");
|
|
Console.WriteLine("Server started");
|
|
FleckLog.Level = LogLevel.Error;
|
|
|
|
server.Start(socket =>
|
|
{
|
|
socket.OnOpen = () =>
|
|
{
|
|
var dbClient = new DbClient(socket);
|
|
dbClient.Handle();
|
|
};
|
|
});
|
|
|
|
Database.Loop();
|
|
}
|
|
}
|