mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-14 07:24:50 +01:00
JSON data table parsing stuff
This commit is contained in:
23
BLHX.Server.Common/Data/Config.cs
Normal file
23
BLHX.Server.Common/Data/Config.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using BLHX.Server.Common.Utils;
|
||||
|
||||
namespace BLHX.Server.Common.Data;
|
||||
|
||||
public class Config : Singleton<Config>
|
||||
{
|
||||
public string Address { get; set; } = "127.0.0.1";
|
||||
public uint Port { get; set; } = 20000;
|
||||
|
||||
public static void Load()
|
||||
{
|
||||
Instance = JSON.Load<Config>(JSON.ConfigPath);
|
||||
|
||||
Logger.c.Log($"Config loaded");
|
||||
}
|
||||
|
||||
public static void Save()
|
||||
{
|
||||
JSON.Save(JSON.ConfigPath, Instance);
|
||||
|
||||
Logger.c.Log("Config saved");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user