diff --git a/Manager/LoginManager.cs b/Manager/LoginManager.cs index 0000447..3ff0f51 100644 --- a/Manager/LoginManager.cs +++ b/Manager/LoginManager.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json.Linq; +using System.Diagnostics; using System.Net; using System.Net.Http; @@ -70,8 +71,9 @@ namespace Zerolauncher.Manager game.Send($"{StaticHandleS.HintText} 尝试登玩家{game.account.nickName}到{ServicesStaticInfo.ServicesName[game.account.providerId]}的{game.account.serverId}服"); switch (game.account.providerId) { + case 3: case 0: - need_web = $"http://web.4399.com/stat/togame.php?target=ddt&server_id=S{game.account.serverId}"; + need_web = $"http://web.4399.com/stat/togame.php?target={(game.account.providerId == 3? "ddts":"ddt")}&server_id=S{game.account.serverId}"; { var values = new Dictionary { @@ -101,11 +103,12 @@ namespace Zerolauncher.Manager if (!game.Send($"{StaticHandleS.HintText} 登录成功,开始解析iframe")) return; } { - var responseString = await AssetNet(client, game, $"http://web.4399.com/stat/togame.php?target=ddt&server_id=S{game.account.serverId}"); + var responseString = await AssetNet(client, game, need_web); if (responseString == null) break; if (!responseString.Contains("name=\"game_box\"")) { game.Send($"{StaticHandleS.HintText} 解析异常:服务器返回数据不正确"); + Trace.WriteLine(responseString); if (responseString.Contains("维护")) game.Send($"{StaticHandleS.HintText} 检测到服务器在维护中,请耐心等候官方开服"); break; } @@ -120,9 +123,15 @@ namespace Zerolauncher.Manager game.Send($"{StaticHandleS.HintText} 网络发生错误,类型:{ex.GetType().Name.Replace(" ", "_")},消息:{ex.Message.Replace(" ", "_")}"); break; } - responseString = await response.Content.ReadAsStringAsync(); - responseString = "http://" + response.RequestMessage.RequestUri.ToString().Split("/")[2] + "/" + responseString.Split("movie\" value='")[1].Split("'")[0]; - //Trace.WriteLine(responseString); + + responseString = await response.Content.ReadAsStringAsync(); + if (game.account.providerId == 3) + { + responseString = responseString.Split("\"movie\" value='")[1].Split("'", 2)[0]; + }else + { + responseString = "http://" + response.RequestMessage.RequestUri.ToString().Split("/")[2] + "/" + responseString.Split("movie\" value='")[1].Split("'")[0]; + } game.Send($"{StaticHandleS.GameSa} {responseString}"); } need_web = null ; @@ -171,6 +180,9 @@ namespace Zerolauncher.Manager case 2: need_web = $"http://www.wan.com/game/play/id/{game.account.serverId}"; break; + // case 3: + //need_web = $"https://web.4399.com/stat/togame.php?target=ddts&server_id=S{game.account.serverId}"; + // break; default: game.Send($"{StaticHandleS.HintText} 错误。未适配的运营商:{game.account.serverId}"); break; diff --git a/ServicesStaticInfo.cs b/ServicesStaticInfo.cs index f5403dd..db78e45 100644 --- a/ServicesStaticInfo.cs +++ b/ServicesStaticInfo.cs @@ -2,7 +2,7 @@ { class ServicesStaticInfo { - public static string[] ServicesName = ["4399大区", "7k7k大区", "第七大道"]; - public static string[] ServicesShortName = ["43", "7k", "7d"]; + public static string[] ServicesName = ["4399大区", "7k7k大区", "第七大道", "4399经典"]; + public static string[] ServicesShortName = ["43", "7k", "7d", "典"]; } }