add 43经典

This commit is contained in:
1415ddfer 2024-07-05 16:32:50 +08:00
parent 52393d8d67
commit 8e3535ecf6
2 changed files with 19 additions and 7 deletions

View File

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

View File

@ -2,7 +2,7 @@
{ {
class ServicesStaticInfo class ServicesStaticInfo
{ {
public static string[] ServicesName = ["4399大区", "7k7k大区", "第七大道"]; public static string[] ServicesName = ["4399大区", "7k7k大区", "第七大道", "4399经典"];
public static string[] ServicesShortName = ["43", "7k", "7d"]; public static string[] ServicesShortName = ["43", "7k", "7d", "典"];
} }
} }