修复新账号系统的问题,禁用自动更新
This commit is contained in:
parent
e92c497407
commit
afe8d53638
@ -33,7 +33,7 @@ namespace Zerolauncher
|
|||||||
{
|
{
|
||||||
var member = new MemberControl();
|
var member = new MemberControl();
|
||||||
member.memberId = i++;
|
member.memberId = i++;
|
||||||
member.text.Content = ServicesStaticInfo.ServicesShortName[account.providerId] + "-" + account.nickName;
|
member.text.Content = ServicesStaticInfo.ServicesShortName[account.ProviderId] + "-" + account.nickName;
|
||||||
mLayout.Children.Add(member);
|
mLayout.Children.Add(member);
|
||||||
}
|
}
|
||||||
if (i ==0)
|
if (i ==0)
|
||||||
@ -52,7 +52,7 @@ namespace Zerolauncher
|
|||||||
{
|
{
|
||||||
var member = new MemberControl();
|
var member = new MemberControl();
|
||||||
member.memberId = i++;
|
member.memberId = i++;
|
||||||
member.text.Content = ServicesStaticInfo.ServicesShortName[account.providerId] + "-" + account.nickName;
|
member.text.Content = ServicesStaticInfo.ServicesShortName[account.ProviderId] + "-" + account.nickName;
|
||||||
mLayout.Children.Add(member);
|
mLayout.Children.Add(member);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Zerolauncher.Manager
|
namespace Zerolauncher.Manager
|
||||||
{
|
{
|
||||||
@ -25,9 +26,12 @@ namespace Zerolauncher.Manager
|
|||||||
public static void ChangeTeam(int index)
|
public static void ChangeTeam(int index)
|
||||||
{
|
{
|
||||||
_teamId = TeamManager.Index2Key(index);
|
_teamId = TeamManager.Index2Key(index);
|
||||||
_teamId = AccountData.TeamIndex;
|
AccountData.TeamIndex = _teamId;
|
||||||
TeamName = GroupsData.Data[_teamId];
|
TeamName = GroupsData.Data[_teamId];
|
||||||
|
if (!AccountData.Data.ContainsKey(_teamId))
|
||||||
|
AccountData.Data.Add(_teamId, []);
|
||||||
AccountsList = AccountData.Data[_teamId];
|
AccountsList = AccountData.Data[_teamId];
|
||||||
|
DataStreamNew.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveEdit()
|
public static void SaveEdit()
|
||||||
@ -38,7 +42,7 @@ namespace Zerolauncher.Manager
|
|||||||
|
|
||||||
public static bool AddAccount(AccountNew account)
|
public static bool AddAccount(AccountNew account)
|
||||||
{
|
{
|
||||||
account.groupId = _teamId;
|
account.GroupId = _teamId;
|
||||||
AccountData.AddAccount(account);
|
AccountData.AddAccount(account);
|
||||||
|
|
||||||
DataStreamNew.Save();
|
DataStreamNew.Save();
|
||||||
@ -48,7 +52,7 @@ namespace Zerolauncher.Manager
|
|||||||
|
|
||||||
public static bool AddAccounts(AccountNew account)
|
public static bool AddAccounts(AccountNew account)
|
||||||
{
|
{
|
||||||
account.groupId = _teamId;
|
account.GroupId = _teamId;
|
||||||
AccountData.AddAccount(account);
|
AccountData.AddAccount(account);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -113,7 +117,8 @@ namespace Zerolauncher.Manager
|
|||||||
|
|
||||||
public static void AddTeam(string teamName)
|
public static void AddTeam(string teamName)
|
||||||
{
|
{
|
||||||
GroupsData.Data.Add(GroupsData.Data.Keys.LastOrDefault() + 1, teamName);
|
var key = GroupsData.Data.Keys.LastOrDefault() + 1;
|
||||||
|
GroupsData.Data.Add(key, teamName);
|
||||||
DataStreamNew.Save();
|
DataStreamNew.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,67 +1,75 @@
|
|||||||
using System.Diagnostics;
|
using System.Buffers;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
|
|
||||||
namespace Zerolauncher.Manager
|
namespace Zerolauncher.Manager
|
||||||
{
|
{
|
||||||
enum NameSpace
|
|
||||||
|
class DiyWriteSteamer()
|
||||||
{
|
{
|
||||||
Accounts,
|
ArrayBufferWriter<byte> data = new();
|
||||||
Groups,
|
|
||||||
ecs,
|
|
||||||
None
|
public void WriteInt(int value)
|
||||||
|
{
|
||||||
|
data.Write(BitConverter.GetBytes(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
static class DataStreamNew
|
public void WriteString(string value)
|
||||||
{
|
{
|
||||||
private const string path = "users.data";
|
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(value);
|
||||||
static byte[] key = [9, 5, 33, 64, 99, 200, 66, 77];
|
WriteInt(bytes.Length);
|
||||||
static int hearder_version = 20240531;
|
data.Write(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
static void InitHandle(NameSpace ns, DataItem item)
|
public byte[] GetBytes() => data.WrittenSpan.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
class DiyReader(byte[] data, int _offset=0)
|
||||||
{
|
{
|
||||||
switch (ns)
|
public int ReadInt()
|
||||||
{
|
{
|
||||||
case NameSpace.Accounts:
|
_offset += 4;
|
||||||
AccountData.Init(item);
|
return BitConverter.ToInt32(data, _offset - 4);
|
||||||
break;
|
|
||||||
case NameSpace.Groups:
|
}
|
||||||
GroupsData.Init(item);
|
public string ReadStr()
|
||||||
break;
|
{
|
||||||
|
int lenght = ReadInt();
|
||||||
|
_offset += lenght;
|
||||||
|
return System.Text.Encoding.UTF8.GetString(data, _offset - lenght, lenght);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static DataItem[] GetAllData() { return [GroupsData.Out(), AccountData.Out()]; }
|
internal static class DataStreamNew
|
||||||
|
{
|
||||||
|
private const string Path = "users.data";
|
||||||
|
private static readonly byte[] Key = [9, 5, 33, 64, 99, 200, 66, 77];
|
||||||
|
private const int HeaderVersion = 20240531;
|
||||||
|
|
||||||
public static void Load()
|
public static void Load()
|
||||||
{
|
{
|
||||||
if (File.Exists(path))
|
if (File.Exists(Path))
|
||||||
{
|
{
|
||||||
byte[] byteArray;
|
byte[] byteArray;
|
||||||
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
|
using (var fs = new FileStream(Path, FileMode.Open, FileAccess.Read))
|
||||||
{
|
{
|
||||||
byteArray = new byte[fs.Length];
|
byteArray = new byte[fs.Length];
|
||||||
fs.Read(byteArray, 0, byteArray.Length);
|
fs.ReadExactly(byteArray, 0, byteArray.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteCry(byteArray);
|
ByteCry(byteArray);
|
||||||
byteArray = Decompress(byteArray);
|
byteArray = Decompress(byteArray);
|
||||||
{
|
{
|
||||||
var data = new DataItem(NameSpace.None, byteArray);
|
var data = new DiyReader(byteArray);
|
||||||
if (data.ReadInt() != hearder_version)
|
if (data.ReadInt() != HeaderVersion)
|
||||||
{
|
{
|
||||||
data.ReSetOffset();
|
|
||||||
OldDataUpdate(data);
|
OldDataUpdate(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NameSpace _id;
|
GroupsData.Init(data);
|
||||||
int _lenght;
|
AccountData.Init(data);
|
||||||
while (!data.IsEnd())
|
|
||||||
{
|
|
||||||
_id = (NameSpace)data.ReadInt();
|
|
||||||
_lenght = data.ReadInt();
|
|
||||||
|
|
||||||
InitHandle(_id, new DataItem(_id, data.GetBytes(_lenght)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -69,7 +77,7 @@ namespace Zerolauncher.Manager
|
|||||||
InitDefaultData();
|
InitDefaultData();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OldDataUpdate(DataItem _item)
|
static void OldDataUpdate(DiyReader _item)
|
||||||
{
|
{
|
||||||
InitDefaultData();
|
InitDefaultData();
|
||||||
}
|
}
|
||||||
@ -83,21 +91,19 @@ namespace Zerolauncher.Manager
|
|||||||
|
|
||||||
public static void Save()
|
public static void Save()
|
||||||
{
|
{
|
||||||
byte[] buffer;
|
var data = new DiyWriteSteamer();
|
||||||
{
|
|
||||||
DataItem buffers = new(NameSpace.None, []);
|
data.WriteInt(HeaderVersion);
|
||||||
buffers.WriteInt(hearder_version);
|
GroupsData.Out(data);
|
||||||
foreach (DataItem item in GetAllData())
|
AccountData.Out(data);
|
||||||
{
|
|
||||||
buffers.Write(BitConverter.GetBytes((uint)item.id));
|
var buffer = CompressBytes(data.GetBytes());
|
||||||
buffers.Write(BitConverter.GetBytes(item.value.Length));
|
|
||||||
buffers.Write(item.value);
|
|
||||||
}
|
|
||||||
buffer = CompressBytes(buffers.value);
|
|
||||||
ByteCry(buffer);
|
ByteCry(buffer);
|
||||||
}
|
|
||||||
using (FileStream file = new(path, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
|
||||||
|
using (FileStream file = new(Path, FileMode.OpenOrCreate, FileAccess.ReadWrite))
|
||||||
{
|
{
|
||||||
|
file.Seek(0, SeekOrigin.Begin);
|
||||||
file.Write(buffer);
|
file.Write(buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +113,7 @@ namespace Zerolauncher.Manager
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < data.Length; i++)
|
for (int i = 0; i < data.Length; i++)
|
||||||
{
|
{
|
||||||
data[i] = (byte)(data[i] ^ key[i % key.Length]);
|
data[i] = (byte)(data[i] ^ Key[i % Key.Length]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,13 +123,11 @@ namespace Zerolauncher.Manager
|
|||||||
//3.将需要压缩的字节写到被压缩的文件流
|
//3.将需要压缩的字节写到被压缩的文件流
|
||||||
static byte[] CompressBytes(byte[] bytes)
|
static byte[] CompressBytes(byte[] bytes)
|
||||||
{
|
{
|
||||||
using (MemoryStream compressStream = new MemoryStream())
|
using var compressStream = new MemoryStream();
|
||||||
{
|
|
||||||
using (var zipStream = new GZipStream(compressStream, CompressionMode.Compress))
|
using (var zipStream = new GZipStream(compressStream, CompressionMode.Compress))
|
||||||
zipStream.Write(bytes, 0, bytes.Length);
|
zipStream.Write(bytes, 0, bytes.Length);
|
||||||
return compressStream.ToArray();
|
return compressStream.ToArray();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//解压缩字节
|
//解压缩字节
|
||||||
//1.创建被压缩的数据流
|
//1.创建被压缩的数据流
|
||||||
@ -147,95 +151,37 @@ namespace Zerolauncher.Manager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DataItem
|
|
||||||
{
|
|
||||||
public NameSpace id;
|
|
||||||
int offset = 0;
|
|
||||||
public byte[] value;
|
|
||||||
|
|
||||||
public DataItem(NameSpace id, byte[] value)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsEnd() { return offset >= value.Length - 1; }
|
|
||||||
|
|
||||||
public void ReSetOffset()
|
|
||||||
{
|
|
||||||
offset = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] GetBytes(int lenght)
|
|
||||||
{
|
|
||||||
offset += lenght;
|
|
||||||
return value.Skip(offset - lenght).Take(lenght).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ReadInt()
|
|
||||||
{
|
|
||||||
offset += 4;
|
|
||||||
return BitConverter.ToInt32(value, offset - 4);
|
|
||||||
|
|
||||||
}
|
|
||||||
public String ReadStr()
|
|
||||||
{
|
|
||||||
int lenght = ReadInt();
|
|
||||||
offset += lenght;
|
|
||||||
return System.Text.Encoding.UTF8.GetString(value, offset - lenght, lenght);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Write(byte[] bytes)
|
|
||||||
{
|
|
||||||
var arr = new byte[bytes.Length + value.Length];
|
|
||||||
Array.Copy(value, arr, value.Length);
|
|
||||||
Array.Copy(bytes, 0, arr, value.Length, bytes.Length);
|
|
||||||
value = arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void WriteInt(int value)
|
|
||||||
{
|
|
||||||
Write(BitConverter.GetBytes(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void WriteString(string value)
|
|
||||||
{
|
|
||||||
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(value);
|
|
||||||
WriteInt(bytes.Length);
|
|
||||||
Write(bytes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AccountNew
|
public class AccountNew
|
||||||
{
|
{
|
||||||
public int groupId, providerId, serverId;
|
public int GroupId, ProviderId, ServerId;
|
||||||
public string userName, userPWD, nickName;
|
public string userName, userPWD, nickName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal static class AccountData
|
internal static class AccountData
|
||||||
{
|
{
|
||||||
public static int TeamIndex;
|
public static int TeamIndex = 0;
|
||||||
|
|
||||||
public static readonly Dictionary<int, List<AccountNew>> Data = [];
|
public static readonly Dictionary<int, List<AccountNew>> Data = [];
|
||||||
|
|
||||||
public static readonly Dictionary<string, AccountNew> Dict = [];
|
public static readonly Dictionary<string, AccountNew> Dict = [];
|
||||||
|
|
||||||
public static void Init(DataItem dataItem)
|
public static void Init(DiyReader data)
|
||||||
{
|
{
|
||||||
dataItem.ReSetOffset();
|
TeamIndex = data.ReadInt();
|
||||||
TeamIndex = dataItem.ReadInt();
|
var accountCount = data.ReadInt();
|
||||||
var accountCount = dataItem.ReadInt();
|
|
||||||
for (var i = 0; i < accountCount; i++)
|
for (var i = 0; i < accountCount; i++)
|
||||||
{
|
{
|
||||||
AddAccount(new AccountNew()
|
AddAccount(new AccountNew()
|
||||||
{
|
{
|
||||||
groupId = dataItem.ReadInt(),
|
GroupId = data.ReadInt(),
|
||||||
providerId = dataItem.ReadInt(),
|
ProviderId = data.ReadInt(),
|
||||||
serverId = dataItem.ReadInt(),
|
ServerId = data.ReadInt(),
|
||||||
userName = dataItem.ReadStr(),
|
userName = data.ReadStr(),
|
||||||
userPWD = dataItem.ReadStr(),
|
userPWD = data.ReadStr(),
|
||||||
nickName = dataItem.ReadStr()
|
nickName = data.ReadStr()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -244,9 +190,9 @@ namespace Zerolauncher.Manager
|
|||||||
{
|
{
|
||||||
AddAccount(new AccountNew()
|
AddAccount(new AccountNew()
|
||||||
{
|
{
|
||||||
groupId = 0,
|
GroupId = 0,
|
||||||
providerId = 0,
|
ProviderId = 0,
|
||||||
serverId = 1,
|
ServerId = 1,
|
||||||
userName = "test",
|
userName = "test",
|
||||||
userPWD = "test",
|
userPWD = "test",
|
||||||
nickName = "右键修改账号"
|
nickName = "右键修改账号"
|
||||||
@ -258,7 +204,8 @@ namespace Zerolauncher.Manager
|
|||||||
var count = 0;
|
var count = 0;
|
||||||
while (Dict.ContainsKey(item.nickName))
|
while (Dict.ContainsKey(item.nickName))
|
||||||
item.nickName += count++.ToString();
|
item.nickName += count++.ToString();
|
||||||
if (CheckGroup(item.groupId)) Data[item.groupId].Add(item);
|
if (CheckGroup(item.GroupId))
|
||||||
|
Data[item.GroupId].Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CheckGroup(int groupId)
|
public static bool CheckGroup(int groupId)
|
||||||
@ -278,28 +225,30 @@ namespace Zerolauncher.Manager
|
|||||||
Data.Remove(TeamIndex);
|
Data.Remove(TeamIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataItem Out()
|
public static void Out(DiyWriteSteamer data)
|
||||||
{
|
{
|
||||||
var res = new DataItem(NameSpace.Accounts, []);
|
data.WriteInt(TeamIndex);
|
||||||
res.WriteInt(TeamIndex);
|
|
||||||
res.WriteInt(Data.Count);
|
var arr = new List<AccountNew>();
|
||||||
foreach (var item in Data.Values.SelectMany(items => items))
|
foreach (var item in Data.Values)
|
||||||
|
arr.AddRange(item);
|
||||||
|
data.WriteInt(arr.Count);
|
||||||
|
foreach (var item in arr)
|
||||||
{
|
{
|
||||||
res.WriteInt(item.groupId);
|
data.WriteInt(item.GroupId);
|
||||||
res.WriteInt(item.providerId);
|
data.WriteInt(item.ProviderId);
|
||||||
res.WriteInt(item.serverId);
|
data.WriteInt(item.ServerId);
|
||||||
res.WriteString(item.userName);
|
data.WriteString(item.userName);
|
||||||
res.WriteString(item.userPWD);
|
data.WriteString(item.userPWD);
|
||||||
res.WriteString(item.nickName);
|
data.WriteString(item.nickName);
|
||||||
}
|
}
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class GroupsData
|
internal static class GroupsData
|
||||||
{
|
{
|
||||||
public static readonly Dictionary<int, string> Data = [];
|
public static readonly Dictionary<int, string> Data = [];
|
||||||
public static void Init(DataItem dataItem)
|
public static void Init(DiyReader dataItem)
|
||||||
{
|
{
|
||||||
var count = dataItem.ReadInt();
|
var count = dataItem.ReadInt();
|
||||||
for (var i = 0; i < count; i++)
|
for (var i = 0; i < count; i++)
|
||||||
@ -313,16 +262,14 @@ namespace Zerolauncher.Manager
|
|||||||
Data.Add(0, "队伍1");
|
Data.Add(0, "队伍1");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataItem Out()
|
public static void Out(DiyWriteSteamer data)
|
||||||
{
|
{
|
||||||
var res = new DataItem(NameSpace.Groups, []);
|
data.WriteInt(Data.Count);
|
||||||
res.WriteInt(Data.Count);
|
|
||||||
foreach (var item in Data)
|
foreach (var item in Data)
|
||||||
{
|
{
|
||||||
res.WriteInt(item.Key);
|
data.WriteInt(item.Key);
|
||||||
res.WriteString(item.Value);
|
data.WriteString(item.Value);
|
||||||
}
|
}
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ namespace Zerolauncher.Manager
|
|||||||
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
|
||||||
private static string AccToKey(AccountNew account)
|
private static string AccToKey(AccountNew account)
|
||||||
{
|
{
|
||||||
return string.Format("{0}{1}{2}", account.providerId, account.serverId, account.userName);
|
return string.Format("{0}{1}{2}", account.ProviderId, account.ServerId, account.userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CreateGame(AccountNew account)
|
public static bool CreateGame(AccountNew account)
|
||||||
@ -181,7 +181,7 @@ namespace Zerolauncher.Manager
|
|||||||
UpDateManager.DoUpdate1();
|
UpDateManager.DoUpdate1();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Send($"{StaticHandleS.ShowWindow} {ServicesStaticInfo.ServicesName[account.providerId]}-{account.nickName}");
|
Send($"{StaticHandleS.ShowWindow} {ServicesStaticInfo.ServicesName[account.ProviderId]}-{account.nickName}");
|
||||||
break;
|
break;
|
||||||
case StaticHandleC.StartDone:
|
case StaticHandleC.StartDone:
|
||||||
if (gameMode == StaticHandleA.UpdateMode)
|
if (gameMode == StaticHandleA.UpdateMode)
|
||||||
|
|||||||
@ -70,15 +70,15 @@ namespace Zerolauncher.Manager
|
|||||||
client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0");
|
client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0");
|
||||||
string? need_web = null;
|
string? need_web = null;
|
||||||
client.Timeout = TimeSpan.FromSeconds(3);
|
client.Timeout = TimeSpan.FromSeconds(3);
|
||||||
game.Send($"{StaticHandleS.HintText} 尝试登玩家{game.account.nickName}到{ServicesStaticInfo.ServicesName[game.account.providerId]}的{ServicesStaticInfo.ServerNames[game.account.serverId]}服");
|
game.Send($"{StaticHandleS.HintText} 尝试登玩家{game.account.nickName}到{ServicesStaticInfo.ServicesName[game.account.ProviderId]}的{ServicesStaticInfo.ServerNames[game.account.ServerId]}服");
|
||||||
switch (game.account.providerId)
|
switch (game.account.ProviderId)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
need_web = "https://www.917play.com.tw/ddt_webserver";
|
need_web = "https://www.917play.com.tw/ddt_webserver";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
game.Send($"{StaticHandleS.HintText} 错误。未适配的运营商:{game.account.serverId}");
|
game.Send($"{StaticHandleS.HintText} 错误。未适配的运营商:{game.account.ServerId}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
client.Dispose();
|
client.Dispose();
|
||||||
@ -88,7 +88,7 @@ namespace Zerolauncher.Manager
|
|||||||
// await Task.Delay(1000);
|
// await Task.Delay(1000);
|
||||||
// if (!game.Send($"{StaticHandleS.HintText} 自动登录失败,将在{i}后启用网页登录,关闭窗口取消")) { return; }
|
// if (!game.Send($"{StaticHandleS.HintText} 自动登录失败,将在{i}后启用网页登录,关闭窗口取消")) { return; }
|
||||||
//}
|
//}
|
||||||
game.Send($"{StaticHandleS.UseBrowser} {need_web} {game.account.providerId + 4} {ServicesStaticInfo.ServerIds[game.account.serverId]} {game.account.userName} {game.account.userPWD}");
|
game.Send($"{StaticHandleS.UseBrowser} {need_web} {game.account.ProviderId + 4} {ServicesStaticInfo.ServerIds[game.account.ServerId]} {game.account.userName} {game.account.userPWD}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task DoVerify(SingleGame game, string vid, string cookie)
|
public static async Task DoVerify(SingleGame game, string vid, string cookie)
|
||||||
|
|||||||
@ -72,16 +72,16 @@ namespace Zerolauncher.Manager
|
|||||||
MessageBoxResult result = MessageBox.Show($"大厅组件需要更新\n是否更新?喵", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
|
MessageBoxResult result = MessageBox.Show($"大厅组件需要更新\n是否更新?喵", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
|
||||||
if (result == MessageBoxResult.OK)
|
if (result == MessageBoxResult.OK)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
updateProcess = new SingleGame(null, StaticHandleA.UpdateMode);
|
|
||||||
Process.Start(new ProcessStartInfo(UpDateData.lanzou + UpDateData.user_packet_url) { UseShellExecute = true });
|
Process.Start(new ProcessStartInfo(UpDateData.lanzou + UpDateData.user_packet_url) { UseShellExecute = true });
|
||||||
return;
|
// try
|
||||||
}
|
// {
|
||||||
catch (Exception _ex)
|
// updateProcess = new SingleGame(null, StaticHandleA.UpdateMode);
|
||||||
{
|
// return;
|
||||||
MessageBox.Show("执行自动更新失败!,\n请手动访问链接重新下载大厅文件或联系管理员喵。", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
// }
|
||||||
}
|
// catch (Exception _ex)
|
||||||
|
// {
|
||||||
|
// MessageBox.Show("执行自动更新失败!,\n请手动访问链接重新下载大厅文件或联系管理员喵。", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,8 +29,8 @@ namespace Zerolauncher.dialog
|
|||||||
{
|
{
|
||||||
int index = (int)EditMemberDialog.member;
|
int index = (int)EditMemberDialog.member;
|
||||||
var acc = AccountManager.AccountsList[index];
|
var acc = AccountManager.AccountsList[index];
|
||||||
cb_pid.SelectedIndex = acc.providerId;
|
cb_pid.SelectedIndex = acc.ProviderId;
|
||||||
cb_sid.SelectedIndex = acc.serverId;
|
cb_sid.SelectedIndex = acc.ServerId;
|
||||||
edit_acc.Text = acc.userName;
|
edit_acc.Text = acc.userName;
|
||||||
edit_pwd.Password = acc.userPWD;
|
edit_pwd.Password = acc.userPWD;
|
||||||
edit_nick.Text = acc.nickName;
|
edit_nick.Text = acc.nickName;
|
||||||
@ -64,15 +64,15 @@ namespace Zerolauncher.dialog
|
|||||||
}
|
}
|
||||||
if (EditMemberDialog.member == null)
|
if (EditMemberDialog.member == null)
|
||||||
{
|
{
|
||||||
AccountManager.AddAccount(new AccountNew { providerId = cb_pid.SelectedIndex, serverId = cb_sid.SelectedIndex, userName = edit_acc.Text, userPWD = edit_pwd.Password, nickName = edit_nick.Text });
|
AccountManager.AddAccount(new AccountNew { ProviderId = cb_pid.SelectedIndex, ServerId = cb_sid.SelectedIndex, userName = edit_acc.Text, userPWD = edit_pwd.Password, nickName = edit_nick.Text });
|
||||||
|
|
||||||
EditMemberDialog.Close();
|
EditMemberDialog.Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int index = (int)EditMemberDialog.member;
|
int index = (int)EditMemberDialog.member;
|
||||||
var acc = AccountManager.AccountsList[index];
|
var acc = AccountManager.AccountsList[index];
|
||||||
acc.providerId = cb_pid.SelectedIndex;
|
acc.ProviderId = cb_pid.SelectedIndex;
|
||||||
acc.serverId = cb_sid.SelectedIndex;
|
acc.ServerId = cb_sid.SelectedIndex;
|
||||||
acc.userName = edit_acc.Text;
|
acc.userName = edit_acc.Text;
|
||||||
acc.userPWD = edit_pwd.Password;
|
acc.userPWD = edit_pwd.Password;
|
||||||
acc.nickName = edit_nick.Text;
|
acc.nickName = edit_nick.Text;
|
||||||
|
|||||||
@ -39,24 +39,24 @@ namespace Zerolauncher.dialog
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var acc = new AccountNew { };
|
var acc = new AccountNew { };
|
||||||
if (!int.TryParse(accTexts[0], out acc.providerId))
|
if (!int.TryParse(accTexts[0], out acc.ProviderId))
|
||||||
{
|
{
|
||||||
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{lines[i]}]无法转换成服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{lines[i]}]无法转换成服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(0 < acc.providerId || acc.providerId > ServicesStaticInfo.ServicesName.Length)
|
if(0 < acc.ProviderId || acc.ProviderId > ServicesStaticInfo.ServicesName.Length)
|
||||||
{
|
{
|
||||||
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{acc.providerId}]不是有效的服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{acc.ProviderId}]不是有效的服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!int.TryParse(accTexts[1], out acc.serverId))
|
if (!int.TryParse(accTexts[1], out acc.ServerId))
|
||||||
{
|
{
|
||||||
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{lines[i]}]无法转换成服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{lines[i]}]无法转换成服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (0 < acc.providerId || acc.providerId > ServicesStaticInfo.ServerIds.Length)
|
if (0 < acc.ProviderId || acc.ProviderId > ServicesStaticInfo.ServerIds.Length)
|
||||||
{
|
{
|
||||||
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{acc.providerId}]不是有效的服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show($"输入的服务器代号错误喵!在{i}行\n错误:[{acc.ProviderId}]不是有效的服务器代号", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
acc.userName = accTexts[2];
|
acc.userName = accTexts[2];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user