本文整理汇总了C#中Bussiness.PlayerBussiness.UpdatePasswordTwo方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.UpdatePasswordTwo方法的具体用法?C# PlayerBussiness.UpdatePasswordTwo怎么用?C# PlayerBussiness.UpdatePasswordTwo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.UpdatePasswordTwo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
string msg = "";
bool result = false;
int re_Type = 0;
bool addInfo = false;
int Count = 0;
string PasswordTwo = packet.ReadString();
string PasswordTwo_new = packet.ReadString();
int Type = packet.ReadInt();
string PasswordQuestion1 = packet.ReadString();
string PasswordAnswer1 = packet.ReadString();
string PasswordQuestion2 = packet.ReadString();
string PasswordAnswer2 = packet.ReadString();
switch (Type)
{
case 1:
{
re_Type = 1;
if (string.IsNullOrEmpty(client.Player.PlayerCharacter.PasswordTwo))
using (PlayerBussiness db = new PlayerBussiness())
{
if (PasswordTwo != "")
{
if (db.UpdatePasswordTwo(client.Player.PlayerCharacter.ID, PasswordTwo))
{
client.Player.PlayerCharacter.PasswordTwo = PasswordTwo;
client.Player.PlayerCharacter.IsLocked = false;
msg = "SetPassword.success";
//string db_PasswordQuestion1 = "";
//string db_PasswordQuestion2 = "";
//string db_PasswordAnswer1 = "";
//string db_PasswordAnswer2 = "";
//db.GetPasswordInfo(client.Player.PlayerCharacter.ID, ref db_PasswordQuestion1, ref db_PasswordAnswer1, ref db_PasswordQuestion2, ref db_PasswordAnswer2, ref Count);
//{
// if (db_PasswordQuestion1 != "" && db_PasswordQuestion2 != "" && db_PasswordAnswer1 != "" && db_PasswordAnswer2 != "")
// {
// result = true;
// addInfo = false;
// }
// else
// {
// }
//}
}
}
if (PasswordQuestion1 != "" && PasswordAnswer1 != "" && PasswordQuestion2 != "" && PasswordAnswer2 != "")
{
if (db.UpdatePasswordInfo(client.Player.PlayerCharacter.ID, PasswordQuestion1, PasswordAnswer1, PasswordQuestion2, PasswordAnswer2, 5))
{
result = true;
addInfo = false;
msg = "UpdatePasswordInfo.Success";
}
else
{
result = false;
}
}
else
{
result = true;
addInfo = true;
}
}
else
{
msg = "SetPassword.Fail";
result = false;
addInfo = false;
}
}
break;
case 2:
{
re_Type = 2;
if (PasswordTwo == client.Player.PlayerCharacter.PasswordTwo)
{
client.Player.PlayerCharacter.IsLocked = false;
msg = "BagUnlock.success";
result = true;
//using (PlayerBussiness db = new PlayerBussiness())
//{
// db.GetPasswordInfo(client.Player.PlayerCharacter.ID, ref PasswordQuestion1, ref PasswordAnswer1, ref PasswordQuestion2, ref PasswordAnswer2, ref Count);
// {
// if (PasswordQuestion1 != "" && PasswordQuestion2 != "" && PasswordAnswer1 != "" && PasswordAnswer2 != "")
// {
// addInfo = false;
// }
// else
// {
// addInfo = true;
// }
// }
//}
//.........这里部分代码省略.........