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