Compare commits
2 Commits
TaiWanMast
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5129f68dad | |||
| 8e3535ecf6 |
@ -170,6 +170,7 @@ namespace Zerolauncher.Manager
|
||||
|
||||
private void Handle(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
Trace.WriteLine($"from client:{e.Data}");
|
||||
var lines = e.Data == null? [""] : e.Data.Split(" ", 2); // 切成两半
|
||||
switch (lines[0])
|
||||
{
|
||||
|
||||
@ -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<string, string>
|
||||
{
|
||||
@ -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;
|
||||
@ -182,7 +194,7 @@ namespace Zerolauncher.Manager
|
||||
await Task.Delay(1000);
|
||||
if (!game.Send($"{StaticHandleS.HintText} 自动登录失败,将在{i}后启用网页登录,关闭窗口取消")) { return; }
|
||||
}
|
||||
game.Send($"{StaticHandleS.UseBrowser} {need_web}");
|
||||
}
|
||||
game.Send($"{StaticHandleS.UseBrowser} {need_web} {game.account.providerId + 1} {game.account.serverId} {game.account.userName} {game.account.userPWD}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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", "典"];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,32 +1,34 @@
|
||||
namespace Zerolauncher
|
||||
{
|
||||
class StaticHandleS
|
||||
{
|
||||
public const string ShowWindow = "a0";
|
||||
public const string HintText = "b0";
|
||||
public const string MiniSize = "c0";
|
||||
public const string NormalSize = "d0";
|
||||
public const string UseBrowser = "e0";
|
||||
public const string GameSa = "f0";
|
||||
public const string CloseGame = "g0";
|
||||
public const string UpdateInfo = "h0";
|
||||
}
|
||||
class StaticHandleS
|
||||
{
|
||||
public const string ShowWindow = "a0";
|
||||
public const string HintText = "b0";
|
||||
public const string MiniSize = "c0";
|
||||
public const string NormalSize = "d0";
|
||||
public const string UseBrowser = "e0";
|
||||
public const string GameSa = "f0";
|
||||
public const string CloseGame = "g0";
|
||||
public const string UpdateInfo = "h0";
|
||||
public const string VerifyDone = "i0";
|
||||
}
|
||||
|
||||
class StaticHandleC
|
||||
{
|
||||
public const string LoadDone = "0a";
|
||||
public const string StartDone = "0b";
|
||||
public const string BrowserDone = "0c";
|
||||
public const string StartGame = "0d";
|
||||
public const string GameDone = "0e";
|
||||
public const string Version = "0f";
|
||||
public const string DownloadDone = "0g";
|
||||
}
|
||||
class StaticHandleC
|
||||
{
|
||||
public const string LoadDone = "0a";
|
||||
public const string StartDone = "0b";
|
||||
public const string BrowserDone = "0c";
|
||||
public const string StartGame = "0d";
|
||||
public const string GameDone = "0e";
|
||||
public const string Version = "0f";
|
||||
public const string DownloadDone = "0g";
|
||||
public const string TakeVerify = "0i";
|
||||
}
|
||||
|
||||
class StaticHandleA
|
||||
{
|
||||
public const string GameMode = "0a";
|
||||
public const string UpdateMode = "0b";
|
||||
public const string VersionMode = "0c";
|
||||
}
|
||||
class StaticHandleA
|
||||
{
|
||||
public const string GameMode = "0a";
|
||||
public const string UpdateMode = "0b";
|
||||
public const string VersionMode = "0c";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user