BeforeConnect添加参数

This commit is contained in:
milimoe 2023-09-09 16:16:30 +08:00
parent ec5e34a356
commit 3c5dc29491
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E

View File

@ -65,7 +65,7 @@ namespace Milimoe.FunGame.Core.Controller
/// <returns></returns> /// <returns></returns>
public ConnectResult Connect(string ip, int port) public ConnectResult Connect(string ip, int port)
{ {
if (!BeforeConnect()) if (!BeforeConnect(ip, port))
{ {
return ConnectResult.ConnectFailed; return ConnectResult.ConnectFailed;
} }
@ -162,8 +162,10 @@ namespace Milimoe.FunGame.Core.Controller
/// 此方法将在连接服务器前触发<para/> /// 此方法将在连接服务器前触发<para/>
/// 客户端可以重写此方法 /// 客户端可以重写此方法
/// </summary> /// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
/// <returns>false中止连接</returns> /// <returns>false中止连接</returns>
public virtual bool BeforeConnect() public virtual bool BeforeConnect(string ip, int port)
{ {
return true; return true;
} }