mirror of
https://github.com/project-redbud/FunGame-Desktop.git
synced 2025-04-20 20:19:34 +08:00

* Add QuitRoom * 添加加入房间时与服务器的通信,修复无法接收房间聊天信息的问题 * Add CreateRoom * 添加一定操作时刷新房间列表 * 刷新房间列表前需要先清空
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using Milimoe.FunGame.Desktop.Library.Component;
|
|
using Milimoe.FunGame.Desktop.Library;
|
|
using Milimoe.FunGame.Desktop.Model;
|
|
using Milimoe.FunGame.Core.Library.Constant;
|
|
using Milimoe.FunGame.Desktop.UI;
|
|
using Milimoe.FunGame.Core.Library.Common.Architecture;
|
|
using Milimoe.FunGame.Core.Library.Exception;
|
|
using Milimoe.FunGame.Core.Library.Common.Event;
|
|
|
|
namespace Milimoe.FunGame.Desktop.Controller
|
|
{
|
|
public class RegisterController : BaseController
|
|
{
|
|
private readonly Register Register;
|
|
private readonly RegisterModel RegModel;
|
|
|
|
public RegisterController(Register reg)
|
|
{
|
|
Register = reg;
|
|
RegModel = new RegisterModel();
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
RegModel.Dispose();
|
|
}
|
|
|
|
public async Task<bool> Reg(params object[]? objs)
|
|
{
|
|
bool result = false;
|
|
|
|
try
|
|
{
|
|
RegisterEventArgs RegEventArgs = new (objs);
|
|
if (Register.OnBeforeRegEvent(RegEventArgs) == EventResult.Fail) return false;
|
|
|
|
result = await RegModel.Reg(objs);
|
|
|
|
if (result) Register.OnSucceedRegEvent(RegEventArgs);
|
|
else Register.OnFailedRegEvent(RegEventArgs);
|
|
Register.OnAfterRegEvent(RegEventArgs);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
RunTime.WritelnSystemInfo(e.GetErrorInfo());
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|