mirror of
https://github.com/project-redbud/FunGame-Server.git
synced 2025-04-22 03:59:36 +08:00
CheckReg
This commit is contained in:
parent
fcdc70f46b
commit
f7ce113c6f
@ -25,7 +25,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="FunGame.Core">
|
<Reference Include="FunGame.Core">
|
||||||
<HintPath>..\..\FunGame\bin\Server\Debug\net7.0\FunGame.Core.dll</HintPath>
|
<HintPath>..\..\FunGame\bin\Debug\net7.0\FunGame.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using Milimoe.FunGame.Core.Library.Common.Network;
|
|||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
using Milimoe.FunGame.Core.Library.Server;
|
using Milimoe.FunGame.Core.Library.Server;
|
||||||
using Milimoe.FunGame.Core.Library.SQLScript.Common;
|
using Milimoe.FunGame.Core.Library.SQLScript.Common;
|
||||||
|
using Milimoe.FunGame.Core.Library.SQLScript.Entity;
|
||||||
using Milimoe.FunGame.Server.Others;
|
using Milimoe.FunGame.Server.Others;
|
||||||
using Milimoe.FunGame.Server.Utility;
|
using Milimoe.FunGame.Server.Utility;
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
if (username != null && password != null)
|
if (username != null && password != null)
|
||||||
{
|
{
|
||||||
ServerHelper.WriteLine("[" + ServerSocket.GetTypeString(type) + "] UserName: " + username);
|
ServerHelper.WriteLine("[" + ServerSocket.GetTypeString(type) + "] UserName: " + username);
|
||||||
SQLHelper.Script = Core.Library.SQLScript.Entity.UserQuery.Select_Users_LoginQuery(username, password);
|
SQLHelper.Script = UserQuery.Select_Users_LoginQuery(username, password);
|
||||||
SQLHelper.ExecuteDataSet(out SQLResult result);
|
SQLHelper.ExecuteDataSet(out SQLResult result);
|
||||||
if (result == SQLResult.Success)
|
if (result == SQLResult.Success)
|
||||||
{
|
{
|
||||||
@ -120,6 +121,8 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
// 添加至玩家列表
|
// 添加至玩家列表
|
||||||
AddUser();
|
AddUser();
|
||||||
GetUsersCount();
|
GetUsersCount();
|
||||||
|
// CheckLogin
|
||||||
|
SQLHelper.Script = UserQuery.Update_CheckLogin(UserName, socket.ClientIP.Split(':')[0]);
|
||||||
return Send(socket, type, UserName, Password);
|
return Send(socket, type, UserName, Password);
|
||||||
}
|
}
|
||||||
ServerHelper.WriteLine("客户端发送了错误的秘钥,不允许本次登录。");
|
ServerHelper.WriteLine("客户端发送了错误的秘钥,不允许本次登录。");
|
||||||
@ -225,17 +228,19 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
{
|
{
|
||||||
// 注册
|
// 注册
|
||||||
ServerHelper.WriteLine("[" + ServerSocket.GetTypeString(type) + "] UserName: " + username + " Email: " + email);
|
ServerHelper.WriteLine("[" + ServerSocket.GetTypeString(type) + "] UserName: " + username + " Email: " + email);
|
||||||
SQLHelper.Script = Core.Library.SQLScript.Entity.UserQuery.Register(username, password, email);
|
SQLHelper.Script = UserQuery.Insert_Register(username, password, email);
|
||||||
SQLHelper.Execute(out result);
|
SQLHelper.Execute(out result);
|
||||||
if (result == SQLResult.Success)
|
if (result == SQLResult.Success)
|
||||||
{
|
{
|
||||||
msg = "注册成功!请牢记您的账号与密码!";
|
msg = "注册成功!请牢记您的账号与密码!";
|
||||||
|
SQLHelper.Script = RegVerifyCodes.Delete_RegVerifyCode(username, email);
|
||||||
return Send(socket, type, true, msg);
|
return Send(socket, type, true, msg);
|
||||||
}
|
}
|
||||||
else msg = "服务器无法处理您的注册,注册失败!";
|
else msg = "服务器无法处理您的注册,注册失败!";
|
||||||
}
|
}
|
||||||
else msg = "验证码不正确,请重新输入!";
|
else msg = "验证码不正确,请重新输入!";
|
||||||
}
|
}
|
||||||
|
else if (result == SQLResult.NotFound) msg = "验证码不正确,请重新输入!";
|
||||||
else msg = "服务器无法处理您的注册,注册失败!";
|
else msg = "服务器无法处理您的注册,注册失败!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -386,11 +391,8 @@ namespace Milimoe.FunGame.Server.Model
|
|||||||
{
|
{
|
||||||
SQLHelper.Close();
|
SQLHelper.Close();
|
||||||
MailSender?.Dispose();
|
MailSender?.Dispose();
|
||||||
if (Socket != null)
|
Socket?.Close();
|
||||||
{
|
|
||||||
Socket.Close();
|
|
||||||
_Socket = null;
|
_Socket = null;
|
||||||
}
|
|
||||||
_Running = false;
|
_Running = false;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user