Skip to content

Commit

Permalink
hoyoplay game server config
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Nov 16, 2024
1 parent ca1319d commit c2e7c09
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Starward.Core/HoYoPlay/GameId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public class GameId : IEquatable<GameId>
{
GameBiz.bh3_cn => new GameId { Id = "osvnlOc0S8", GameBiz = "bh3_cn" },
GameBiz.bh3_global => new GameId { Id = "5TIVvvcwtM", GameBiz = "bh3_global" },
GameBiz.bh3_jp => new GameId { Id = "g0mMIvshDb", GameBiz = "bh3_global" },
GameBiz.bh3_kr => new GameId { Id = "uxB4MC7nzC", GameBiz = "bh3_global" },
GameBiz.bh3_os => new GameId { Id = "bxPTXSET5t", GameBiz = "bh3_global" },
GameBiz.bh3_asia => new GameId { Id = "wkE5P5WsIf", GameBiz = "bh3_global" },
GameBiz.hk4e_cn => new GameId { Id = "1Z8W5NHUQb", GameBiz = "hk4e_cn" },
GameBiz.hk4e_global => new GameId { Id = "gopR6Cufr3", GameBiz = "hk4e_global" },
GameBiz.hk4e_bilibili => new GameId { Id = "T2S0Gz4Dr2", GameBiz = "hk4e_cn" },
Expand All @@ -32,7 +36,7 @@ public class GameId : IEquatable<GameId>
GameBiz.hkrpg_bilibili => new GameId { Id = "EdtUqXfCHh", GameBiz = "hkrpg_cn" },
GameBiz.nap_cn => new GameId { Id = "x6znKlJ0xK", GameBiz = "nap_cn" },
GameBiz.nap_global => new GameId { Id = "U5hbdsT9W7", GameBiz = "nap_global" },
GameBiz.nap_bilibili => new GameId { Id = "HXAFlmYa17", GameBiz = "nap_bilibili" },
GameBiz.nap_bilibili => new GameId { Id = "HXAFlmYa17", GameBiz = "nap_cn" },
_ => null,
};
}
Expand Down
57 changes: 57 additions & 0 deletions src/Starward.Core/HoYoPlay/GameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class GameInfo : GameId
[JsonPropertyName("display_status")]
public string DisplayStatus { get; set; }

/// <summary>
/// 服务器信息,暂时仅崩坏三国际服在使用
/// </summary>
[JsonPropertyName("game_server_configs")]
public List<GameServerConfig> GameServerConfigs { get; set; }

}

Expand Down Expand Up @@ -103,4 +108,56 @@ public abstract class GameInfoDisplayStatus
public const string LAUNCHER_GAME_DISPLAY_STATUS_COMING_SOON = "LAUNCHER_GAME_DISPLAY_STATUS_COMING_SOON";

public const string LAUNCHER_GAME_DISPLAY_STATUS_RESERVATION_ENABLED = "LAUNCHER_GAME_DISPLAY_STATUS_RESERVATION_ENABLED";
}



public class GameServerConfig
{

/// <summary>
/// 游戏本地化名称
/// </summary>
[JsonPropertyName("i18n_name")]
public string I18nName { get; set; }

/// <summary>
/// 游戏服务器本地化名称
/// </summary>
[JsonPropertyName("i18n_description")]
public string I18nDescription { get; set; }

/// <summary>
/// 服务器id
/// </summary>
[JsonPropertyName("package_name")]
public string PackageName { get; set; }

/// <summary>
/// 注册表key
/// </summary>
[JsonPropertyName("auto_scan_registry_key")]
public string AutoScanRegistryKey { get; set; }

/// <summary>
/// 服务器id
/// </summary>
[JsonPropertyName("package_detection_info")]
public string PackageDetectionInfo { get; set; }

[JsonPropertyName("game_id")]
public string GameId { get; set; }

/// <summary>
/// 预约链接
/// </summary>
[JsonPropertyName("reservation")]
public GameInfoReservation? Reservation { get; set; }

/// <summary>
/// <see cref="GameInfoDisplayStatus"/>
/// </summary>
[JsonPropertyName("display_status")]
public string DisplayStatus { get; set; }

}

0 comments on commit c2e7c09

Please sign in to comment.