1
0
mirror of synced 2024-12-18 01:05:54 +01:00

Add replay server for test

This commit is contained in:
Yuchen Ji 2022-06-10 00:48:55 +08:00
parent 47cdbb0315
commit 2f185890e5
4 changed files with 12 additions and 2 deletions

View File

@ -70,7 +70,7 @@ public static class Configs
public const string MUSIC_AOU = "music_aou";
public const string MUSIC_AOU_XPATH = $"{ROOT_XPATH}/{MUSIC_AOU}";
public const string MUSIC_AOU_XPATH = $"{ROOT_XPATH}/{MUSIC_AOU}/record";
public const string ITEM = "item";
@ -142,4 +142,6 @@ public static class Configs
public const string DEFAULT_CARD_DB_NAME = "card.db3";
public const string DEFAULT_MUSIC_DB_NAME = "music4MAX465.db3";
public const string DEFAULT_SERVER_IP = "127.0.0.1";
public const string DEFAULT_RELAY_SERVER = "127.0.0.1";
public const int DEFAULT_RELAY_PORT = 54321;
}

View File

@ -31,5 +31,11 @@ public interface IAppSettings
[Option(DefaultValue = Configs.DEFAULT_SERVER_IP)]
string ServerIp { get; }
[Option(DefaultValue = Configs.DEFAULT_RELAY_SERVER)]
string RelayServer { get; }
[Option(DefaultValue = Configs.DEFAULT_RELAY_PORT)]
int RelayPort { get; }
IEnumerable<IDataResponse> ResponseData { get; }
}

View File

@ -8,6 +8,8 @@
"CardDbName": "card.db3",
"MusicDbName": "music4MAX465.db3",
"ServerIp": "127.0.0.1",
"RelayServer": "127.0.0.1",
"RelayPort": 54321,
"ResponseData": [
{
"FileName": "/event_031_20160112.evt",

View File

@ -63,7 +63,7 @@ public class ServerController : WebApiController
md5.ComputeHash(Encoding.UTF8.GetBytes(gid)).Select(b => b.ToString("x2")));
var response = "host=card_id=7020392000147361\n" +
var response = $"host=card_id=7020392000147361,relay_addr={Configs.SETTINGS.RelayServer},relay_port={Configs.SETTINGS.RelayPort}\n" +
"no=1337\n" +
"name=123\n" +
"pref=nesys\n" +