mirror of
https://github.com/project-redbud/FunGame-Desktop.git
synced 2025-12-05 08:09:06 +00:00
Rebuild RunTime's Controller Model
This commit is contained in:
parent
b79a7c4b63
commit
751e436869
@ -9,7 +9,7 @@ namespace Milimoe.FunGame.Desktop.Controller
|
|||||||
{
|
{
|
||||||
public class RunTimeController
|
public class RunTimeController
|
||||||
{
|
{
|
||||||
public bool Connected => Do<bool>(RunTimeInvokeType.Connected);
|
public bool Connected => RunTimeModel.Connected;
|
||||||
|
|
||||||
private RunTimeModel RunTimeModel { get; }
|
private RunTimeModel RunTimeModel { get; }
|
||||||
private Main Main { get; }
|
private Main Main { get; }
|
||||||
@ -20,100 +20,100 @@ namespace Milimoe.FunGame.Desktop.Controller
|
|||||||
RunTimeModel = new RunTimeModel(Main);
|
RunTimeModel = new RunTimeModel(Main);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public async Task<bool> GetServerConnection()
|
||||||
* 从内部去调用Model的方法,并记录日志。
|
|
||||||
*/
|
|
||||||
private T Do<T>(RunTimeInvokeType DoType, params object[] args)
|
|
||||||
{
|
{
|
||||||
object result = new();
|
bool result = false;
|
||||||
switch (DoType)
|
|
||||||
{
|
|
||||||
case RunTimeInvokeType.GetServerConnection:
|
|
||||||
result = RunTimeModel.GetServerConnection();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RunTimeInvokeType.Connect:
|
try
|
||||||
result = RunTimeModel.Connect();
|
|
||||||
if ((ConnectResult)result != ConnectResult.Success)
|
|
||||||
{
|
{
|
||||||
Main.OnFailedConnectEvent(new GeneralEventArgs());
|
RunTimeModel.GetServerConnection();
|
||||||
Main.OnAfterConnectEvent(new GeneralEventArgs());
|
result = await Connect() == ConnectResult.Success;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case RunTimeInvokeType.Connected:
|
return result;
|
||||||
result = RunTimeModel.Connected;
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case RunTimeInvokeType.Disconnect:
|
public async Task<ConnectResult> Connect()
|
||||||
if (Main.OnBeforeDisconnectEvent(new GeneralEventArgs()) == EventResult.Fail) return (T)result;
|
{
|
||||||
RunTimeModel.Disconnect();
|
ConnectResult result = ConnectResult.ConnectFailed;
|
||||||
break;
|
|
||||||
|
|
||||||
case RunTimeInvokeType.Disconnected:
|
try
|
||||||
break;
|
{
|
||||||
|
ConnectEventArgs EventArgs = new(Constant.Server_IP, Constant.Server_Port);
|
||||||
|
if (Main.OnBeforeConnectEvent(EventArgs) == EventResult.Fail) return ConnectResult.ConnectFailed;
|
||||||
|
|
||||||
case RunTimeInvokeType.AutoLogin:
|
result = await RunTimeModel.Connect();
|
||||||
break;
|
|
||||||
|
if (result == ConnectResult.Success) Main.OnSucceedConnectEvent(EventArgs);
|
||||||
|
else Main.OnFailedConnectEvent(EventArgs);
|
||||||
|
Main.OnAfterConnectEvent(EventArgs);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Disconnect()
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Main.OnBeforeDisconnectEvent(new GeneralEventArgs()) == EventResult.Fail) return result;
|
||||||
|
|
||||||
|
result = RunTimeModel.Disconnect();
|
||||||
|
|
||||||
|
if (result) Main.OnSucceedDisconnectEvent(new GeneralEventArgs());
|
||||||
|
else Main.OnFailedDisconnectEvent(new GeneralEventArgs());
|
||||||
|
Main.OnAfterDisconnectEvent(new GeneralEventArgs());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Close(params object[] args)
|
||||||
|
{
|
||||||
|
bool result;
|
||||||
|
|
||||||
|
if (Connected) Disconnect();
|
||||||
|
|
||||||
case RunTimeInvokeType.Close:
|
|
||||||
if (args != null && args.Length > 0)
|
if (args != null && args.Length > 0)
|
||||||
{
|
{
|
||||||
RunTimeModel.Error((Exception)args[0]);
|
RunTimeModel.Error((Exception)args[0]);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
else
|
else result = RunTimeModel.Close();
|
||||||
result = RunTimeModel.Close();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
return result;
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (T)result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GetServerConnection()
|
|
||||||
{
|
|
||||||
return Do<bool>(RunTimeInvokeType.GetServerConnection);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConnectResult Connect()
|
|
||||||
{
|
|
||||||
return Do<ConnectResult>(RunTimeInvokeType.Connect);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Disconnect()
|
|
||||||
{
|
|
||||||
Do<object>(RunTimeInvokeType.Disconnect);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Disconnected()
|
|
||||||
{
|
|
||||||
Do<object>(RunTimeInvokeType.Disconnected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Close()
|
|
||||||
{
|
|
||||||
return Do<bool>(RunTimeInvokeType.Close);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Error(Exception e)
|
public bool Error(Exception e)
|
||||||
{
|
{
|
||||||
return Do<bool>(RunTimeInvokeType.Close, e);
|
return Close(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task AutoLogin(params object[] objs)
|
public async Task AutoLogin(params object[] objs)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Do<object>(RunTimeInvokeType.AutoLogin);
|
|
||||||
LoginController LoginController = new();
|
LoginController LoginController = new();
|
||||||
await LoginController.LoginAccount(objs);
|
await LoginController.LoginAccount(objs);
|
||||||
LoginController.Dispose();
|
LoginController.Dispose();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Main.GetMessage(e.GetErrorInfo());
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,12 +8,12 @@ namespace Milimoe.FunGame.Desktop.Library.Base
|
|||||||
public class BaseMain : GeneralForm, IConnectEventHandler, IDisconnectEventHandler, ILoginEventHandler, ILogoutEventHandler, IIntoRoomEventHandler, ISendTalkEventHandler,
|
public class BaseMain : GeneralForm, IConnectEventHandler, IDisconnectEventHandler, ILoginEventHandler, ILogoutEventHandler, IIntoRoomEventHandler, ISendTalkEventHandler,
|
||||||
ICreateRoomEventHandler, IQuitRoomEventHandler, IStartMatchEventHandler, IStartGameEventHandler, IOpenInventoryEventHandler, IOpenStoreEventHandler
|
ICreateRoomEventHandler, IQuitRoomEventHandler, IStartMatchEventHandler, IStartGameEventHandler, IOpenInventoryEventHandler, IOpenStoreEventHandler
|
||||||
{
|
{
|
||||||
public event IEventHandler.BeforeEventHandler? BeforeConnect;
|
public event IConnectEventHandler.BeforeEventHandler? BeforeConnect;
|
||||||
public event IEventHandler.AfterEventHandler? AfterConnect;
|
public event IConnectEventHandler.AfterEventHandler? AfterConnect;
|
||||||
public event IEventHandler.SucceedEventHandler? SucceedConnect;
|
public event IConnectEventHandler.SucceedEventHandler? SucceedConnect;
|
||||||
public event IEventHandler.FailedEventHandler? FailedConnect;
|
public event IConnectEventHandler.FailedEventHandler? FailedConnect;
|
||||||
|
|
||||||
public EventResult OnAfterConnectEvent(GeneralEventArgs e)
|
public EventResult OnAfterConnectEvent(ConnectEventArgs e)
|
||||||
{
|
{
|
||||||
if (AfterConnect != null)
|
if (AfterConnect != null)
|
||||||
{
|
{
|
||||||
@ -22,7 +22,7 @@ namespace Milimoe.FunGame.Desktop.Library.Base
|
|||||||
else return EventResult.NoEventImplement;
|
else return EventResult.NoEventImplement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EventResult OnBeforeConnectEvent(GeneralEventArgs e)
|
public EventResult OnBeforeConnectEvent(ConnectEventArgs e)
|
||||||
{
|
{
|
||||||
if (BeforeConnect != null)
|
if (BeforeConnect != null)
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ namespace Milimoe.FunGame.Desktop.Library.Base
|
|||||||
else return EventResult.NoEventImplement;
|
else return EventResult.NoEventImplement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EventResult OnSucceedConnectEvent(GeneralEventArgs e)
|
public EventResult OnSucceedConnectEvent(ConnectEventArgs e)
|
||||||
{
|
{
|
||||||
if (SucceedConnect != null)
|
if (SucceedConnect != null)
|
||||||
{
|
{
|
||||||
@ -40,7 +40,7 @@ namespace Milimoe.FunGame.Desktop.Library.Base
|
|||||||
else return EventResult.NoEventImplement;
|
else return EventResult.NoEventImplement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EventResult OnFailedConnectEvent(GeneralEventArgs e)
|
public EventResult OnFailedConnectEvent(ConnectEventArgs e)
|
||||||
{
|
{
|
||||||
if (FailedConnect != null)
|
if (FailedConnect != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,7 +13,7 @@ namespace Milimoe.FunGame.Desktop.Library
|
|||||||
/**
|
/**
|
||||||
* Socket Configs
|
* Socket Configs
|
||||||
*/
|
*/
|
||||||
public static string Server_Address { get; set; } = ""; // 服务器IP地址
|
public static string Server_IP { get; set; } = ""; // 服务器IP地址
|
||||||
public static int Server_Port { get; set; } = 0; // 服务器端口号
|
public static int Server_Port { get; set; } = 0; // 服务器端口号
|
||||||
public static Encoding Default_Encoding { get; } = General.DefaultEncoding;
|
public static Encoding Default_Encoding { get; } = General.DefaultEncoding;
|
||||||
|
|
||||||
|
|||||||
@ -16,8 +16,8 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class LoginModel : BaseModel
|
public class LoginModel : BaseModel
|
||||||
{
|
{
|
||||||
private static SocketObject Work;
|
private static new SocketObject Work;
|
||||||
private static bool Working = false;
|
private static new bool Working = false;
|
||||||
|
|
||||||
public LoginModel() : base(RunTime.Socket)
|
public LoginModel() : base(RunTime.Socket)
|
||||||
{
|
{
|
||||||
@ -133,7 +133,7 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetWorking()
|
private static new void SetWorking()
|
||||||
{
|
{
|
||||||
Working = true;
|
Working = true;
|
||||||
Work = default;
|
Work = default;
|
||||||
|
|||||||
@ -12,8 +12,6 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
public class RegisterModel : BaseModel
|
public class RegisterModel : BaseModel
|
||||||
{
|
{
|
||||||
private readonly Register Register;
|
private readonly Register Register;
|
||||||
private SocketObject Work;
|
|
||||||
private bool Working = false;
|
|
||||||
|
|
||||||
public RegisterModel(Register reg) : base(RunTime.Socket)
|
public RegisterModel(Register reg) : base(RunTime.Socket)
|
||||||
{
|
{
|
||||||
@ -129,11 +127,5 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
}
|
}
|
||||||
return (success, msg);
|
return (success, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetWorking()
|
|
||||||
{
|
|
||||||
Working = true;
|
|
||||||
Work = default;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,18 +28,20 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
|
|
||||||
#region 公开方法
|
#region 公开方法
|
||||||
|
|
||||||
public void Disconnect()
|
public bool Disconnect()
|
||||||
{
|
{
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Socket?.Send(SocketMessageType.Disconnect, "");
|
result = Socket?.Send(SocketMessageType.Disconnect, "") == SocketResult.Success;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Main.GetMessage(e.GetErrorInfo());
|
Main.GetMessage(e.GetErrorInfo());
|
||||||
Main.OnFailedDisconnectEvent(new GeneralEventArgs());
|
|
||||||
Main.OnAfterDisconnectEvent(new GeneralEventArgs());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disconnected()
|
public void Disconnected()
|
||||||
@ -47,7 +49,7 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetServerConnection()
|
public void GetServerConnection()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -58,9 +60,8 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
string[] s = ipaddress.Split(':');
|
string[] s = ipaddress.Split(':');
|
||||||
if (s != null && s.Length > 1)
|
if (s != null && s.Length > 1)
|
||||||
{
|
{
|
||||||
Constant.Server_Address = s[0];
|
Constant.Server_IP = s[0];
|
||||||
Constant.Server_Port = Convert.ToInt32(s[1]);
|
Constant.Server_Port = Convert.ToInt32(s[1]);
|
||||||
if (Connect() == ConnectResult.Success) return true; // 连接服务器
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -74,18 +75,13 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
{
|
{
|
||||||
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConnectResult Connect()
|
public async Task<ConnectResult> Connect()
|
||||||
{
|
{
|
||||||
if (Main.OnBeforeConnectEvent(new GeneralEventArgs()) == EventResult.Fail) return ConnectResult.ConnectFailed;
|
if (Constant.Server_IP == "" || Constant.Server_Port <= 0)
|
||||||
if (Constant.Server_Address == "" || Constant.Server_Port <= 0)
|
|
||||||
{
|
{
|
||||||
ShowMessage.ErrorMessage("查找可用的服务器失败!");
|
ShowMessage.ErrorMessage("查找可用的服务器失败!");
|
||||||
Main.OnFailedConnectEvent(new GeneralEventArgs());
|
|
||||||
Main.OnAfterConnectEvent(new GeneralEventArgs());
|
|
||||||
return ConnectResult.FindServerFailed;
|
return ConnectResult.FindServerFailed;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
@ -94,8 +90,6 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
{
|
{
|
||||||
Main.GetMessage("正在连接服务器,请耐心等待。");
|
Main.GetMessage("正在连接服务器,请耐心等待。");
|
||||||
Config.FunGame_isRetrying = false;
|
Config.FunGame_isRetrying = false;
|
||||||
Main.OnFailedConnectEvent(new GeneralEventArgs());
|
|
||||||
Main.OnAfterConnectEvent(new GeneralEventArgs());
|
|
||||||
return ConnectResult.CanNotConnect;
|
return ConnectResult.CanNotConnect;
|
||||||
}
|
}
|
||||||
if (!Config.FunGame_isConnected)
|
if (!Config.FunGame_isConnected)
|
||||||
@ -111,7 +105,7 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
// 与服务器建立连接
|
// 与服务器建立连接
|
||||||
Socket?.Close();
|
Socket?.Close();
|
||||||
Config.FunGame_isRetrying = true;
|
Config.FunGame_isRetrying = true;
|
||||||
Socket = Socket.Connect(Constant.Server_Address, Constant.Server_Port);
|
Socket = Socket.Connect(Constant.Server_IP, Constant.Server_Port);
|
||||||
if (Socket != null && Socket.Connected)
|
if (Socket != null && Socket.Connected)
|
||||||
{
|
{
|
||||||
// 设置可复用Socket
|
// 设置可复用Socket
|
||||||
@ -119,36 +113,33 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
// 发送连接请求
|
// 发送连接请求
|
||||||
if (Socket.Send(SocketMessageType.Connect) == SocketResult.Success)
|
if (Socket.Send(SocketMessageType.Connect) == SocketResult.Success)
|
||||||
{
|
{
|
||||||
Task t = Task.Factory.StartNew(() =>
|
SocketMessageType Result = Receiving();
|
||||||
{
|
if (Result == SocketMessageType.Connect)
|
||||||
if (Receiving() == SocketMessageType.Connect)
|
|
||||||
{
|
{
|
||||||
Main.GetMessage("连接服务器成功,请登录账号以体验FunGame。");
|
Main.GetMessage("连接服务器成功,请登录账号以体验FunGame。");
|
||||||
Main.UpdateUI(MainInvokeType.Connected);
|
Main.UpdateUI(MainInvokeType.Connected);
|
||||||
StartReceiving();
|
StartReceiving();
|
||||||
|
await Task.Factory.StartNew(() =>
|
||||||
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (IsReceiving)
|
if (IsReceiving)
|
||||||
{
|
{
|
||||||
Main.OnSucceedConnectEvent(new GeneralEventArgs());
|
|
||||||
Main.OnAfterConnectEvent(new GeneralEventArgs());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Config.FunGame_isRetrying = false;
|
|
||||||
Socket.Close();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return ConnectResult.Success;
|
return ConnectResult.Success;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Config.FunGame_isRetrying = false;
|
||||||
|
Socket.Close();
|
||||||
|
return ConnectResult.ConnectFailed;
|
||||||
|
}
|
||||||
Socket?.Close();
|
Socket?.Close();
|
||||||
Config.FunGame_isRetrying = false;
|
Config.FunGame_isRetrying = false;
|
||||||
throw new CanNotConnectException();
|
throw new CanNotConnectException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Main.GetMessage("已连接至服务器,请勿重复连接。");
|
Main.GetMessage("已连接至服务器,请勿重复连接。");
|
||||||
@ -160,14 +151,8 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
Main.UpdateUI(MainInvokeType.SetRed);
|
Main.UpdateUI(MainInvokeType.SetRed);
|
||||||
Config.FunGame_isRetrying = false;
|
Config.FunGame_isRetrying = false;
|
||||||
Task.Factory.StartNew(() =>
|
|
||||||
{
|
|
||||||
Main.OnFailedConnectEvent(new GeneralEventArgs());
|
|
||||||
Main.OnAfterConnectEvent(new GeneralEventArgs());
|
|
||||||
});
|
|
||||||
return ConnectResult.ConnectFailed;
|
return ConnectResult.ConnectFailed;
|
||||||
}
|
}
|
||||||
return ConnectResult.CanNotConnect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Close()
|
public bool Close()
|
||||||
@ -198,7 +183,7 @@ namespace Milimoe.FunGame.Desktop.Model
|
|||||||
{
|
{
|
||||||
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
Main.GetMessage(e.GetErrorInfo(), TimeType.None);
|
||||||
Main.UpdateUI(MainInvokeType.Disconnected);
|
Main.UpdateUI(MainInvokeType.Disconnected);
|
||||||
Main.OnFailedConnectEvent(new GeneralEventArgs());
|
Main.OnFailedConnectEvent(new ConnectEventArgs(Constant.Server_IP, Constant.Server_Port));
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -107,7 +107,7 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
|
|
||||||
case MainInvokeType.SetGreenAndPing:
|
case MainInvokeType.SetGreenAndPing:
|
||||||
Config.FunGame_isRetrying = false;
|
Config.FunGame_isRetrying = false;
|
||||||
SetServerStatusLight((int)LightType.Green, ping: NetworkUtility.GetServerPing(Constant.Server_Address));
|
SetServerStatusLight((int)LightType.Green, ping: NetworkUtility.GetServerPing(Constant.Server_IP));
|
||||||
SetButtonEnableIfLogon(true, ClientState.Online);
|
SetButtonEnableIfLogon(true, ClientState.Online);
|
||||||
Config.FunGame_isConnected = true;
|
Config.FunGame_isConnected = true;
|
||||||
CurrentRetryTimes = 0;
|
CurrentRetryTimes = 0;
|
||||||
@ -1354,7 +1354,7 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
ErrorType ErrorType = NetworkUtility.IsServerAddress(ip, port);
|
ErrorType ErrorType = NetworkUtility.IsServerAddress(ip, port);
|
||||||
if (ErrorType == Core.Library.Constant.ErrorType.None)
|
if (ErrorType == Core.Library.Constant.ErrorType.None)
|
||||||
{
|
{
|
||||||
Constant.Server_Address = ip;
|
Constant.Server_IP = ip;
|
||||||
Constant.Server_Port = port;
|
Constant.Server_Port = port;
|
||||||
CurrentRetryTimes = -1;
|
CurrentRetryTimes = -1;
|
||||||
Config.FunGame_isAutoRetry = true;
|
Config.FunGame_isAutoRetry = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user