المشاركة الأصلية كتبت بواسطة rider
					(المشاركة 16739)
				 
				
	كود PHP: 
	
		 
		
		
			
#region helpdeskrdb
                     case 10075:
                     Case 99123130:
                     Case 99123129:
                     Case 99123128:
                     Case 99123127:
                     Case 99123126:
                     Case 99123125:
                     Case 99123124:
                     Case 99123123:
                         Switch (npcrequest.optionid)
                         {
                             case 0:
                                 Dialog.text("hello <tip color=0xfff05050>" + client.player.name + " </tip> welcome to the helpdesk. Is there anything you require below?");
                                 dialog.option("register new acc", 1);
                               //  dialog.option("vote", 2);
                                 //dialog.option("my own ip", 50);
                                 dialog.option("change password", 6);
                                 dialog.option("thanks.", 255);
                                 dialog.avatar(0x5f);
                                 dialog.send();
                                 break;
                             #region changemasterpassword
                             //#region change password
 
                             //case 71:
                             //    {
                             //        if (client.account.masterpassword != "")
                             //        {
                             //            dialog.text("please insert the old password you have now.");
                             //            dialog.input("here:", 72, 14);
                             //            dialog.option("forget it.", 255);
                             //        }
                             //        else
                             //        {
                             //            client.account.masterpassword = client.account.password;
                             //            dialog.text("you don't have a password set.");
                             //            dialog.option("really !!", 255);
                             //        }
                             //        dialog.send();
                             //        break;
                             //    }
                             //case 72:
                             //    {
                             //        if (client.account.masterpassword != "")
                             //        {
                             //            if (npcrequest.input.length <= 14)
                             //            {
                             //                if (client.account.masterpassword == npcrequest.input)
                             //                {
                             //                    dialog.text("please insert the password again.");
                             //                    dialog.input("here:", 73, 14);
                             //                    dialog.option("forget it.", 255);
                             //                }
                             //                else
                             //                {
                             //                    dialog.text("wrong password. Try again?");
                             //                    dialog.input("here:", 72, 14);
                             //                    dialog.option("really !!", 255);
                             //                }
                             //            }
                             //            else
                             //            {
                             //                dialog.text("invalid password, please try again.");
                             //                dialog.input("here:", 206, 14);
                             //                dialog.option("really !!", 255);
                             //            }
                             //        }
                             //        dialog.send();
                             //        break;
                             //    }
                             //case 73:
                             //    {
                             //        if (client.account.masterpassword != "")
                             //        {
                             //            if (npcrequest.input.length <= 14)
                             //            {
                             //                client.temppassword = npcrequest.input;
                             //                dialog.text("please insert the password again.");
                             //                dialog.input("here:", 74, 14);
                             //                dialog.option("forget it.", 255);
                             //            }
                             //            else
                             //            {
                             //                dialog.text("invalid password, please try again.");
                             //                dialog.input("here:", 73, 14);
                             //                dialog.option("really !!", 255);
                             //            }
                             //        }
                             //        else
                             //        {
                             //            dialog.text("you don't have a password set.");
                             //            dialog.option("really !!", 255);
                             //        }
                             //        dialog.send();
                             //        break;
                             //    }
                             //case 74:
                             //    {
                             //        if (client.account.masterpassword != "")
                             //        {
                             //            if (npcrequest.input.length <= 14)
                             //            {
                             //                if (client.temppassword == npcrequest.input)
                             //                {
                             //                    client.temppassword = "";
                             //                    client.account.masterpassword = npcrequest.input;
                             //                    client.account.save();
                             //                    dialog.text("password changed!");
                             //                    dialog.option("thanks !!", 255);
                             //                }
                             //                else
                             //                {
                             //                    dialog.text("wrong password.");
                             //                    dialog.input("here:", 74, 14);
                             //                    dialog.option("really !!", 255);
                             //                }
                             //            }
                             //            else
                             //            {
                             //                dialog.text("invalid password, please try again.");
                             //                dialog.input("here:", 74, 14);
                             //                dialog.option("really !!", 255);
                             //            }
                             //        }
                             //        else
                             //        {
                             //            dialog.text("you don't have a password set.");
                             //            dialog.option("really !!", 255);
                             //        }
                             //        dialog.send();
                             //        break;
                             //    }
 
                             //#endregion change password
                             #endregion
                             case 1:
                                 Dialog.text("welcome to the helpdesk. Is there anything you require below?");
                                 dialog.option("client register", 100);
                                 //dialog.option("web register", 11);
                                 dialog.avatar(0x5f);
                                 dialog.send();
                                 break;
 
                             case 6:
                                 Dialog.text("welcome to the helpdesk. Is there anything you require below?");
                                 dialog.option("client chg pass", 200);
                                 //dialog.option("web chg pass", 66);
                                 dialog.avatar(0x5f);
                                 dialog.send();
                                 break;
                             #region changepassword
                             case 200:
                                 {
                                     dialog.text("hello. I'm the one that was choosen to set/change your account  password .you can change you password for 14 letters nubmer or characters.");
 
                                     dialog.option("i want to change the password.", 202);
                                     // dialog.option("i want to remove the password.", 3);
                                     dialog.option("forget it.", 255);
                                     dialog.send();
                                     break;
                                 }
 
                             #region change password
 
                             case 202:
                                 {
                                     if (client.account.password != "")
                                     {
                                         dialog.text("aktb el pass el adym ele byfy7 byh.");
                                         dialog.input("here:", 206, 14);
                                         dialog.option("forget it.", 255);
                                     }
                                     else
                                     {
                                         dialog.text("you don't have a password set.");
                                         dialog.option("really !!", 255);
                                     }
                                     dialog.send();
                                     break;
                                 }
                             case 206:
                                 {
                                     if (client.account.password != "")
                                     {
                                         if (npcrequest.input.length >= 6 && npcrequest.input.length <= 14)
                                         {
                                             if (client.account.password == npcrequest.input)
                                             {
                                                 dialog.text("aktb el password el gdeed.");
                                                 dialog.input("here:", 207, 14);
                                                 dialog.option("forget it.", 255);
                                             }
                                             else
                                             {
                                                 dialog.text("wrong password. Try again?");
                                                 dialog.input("here:", 206, 14);
                                                 dialog.option("really !!", 255);
                                             }
                                         }
                                         else
                                         {
                                             dialog.text("invalid password, please try again.");
                                             dialog.input("here:", 206, 14);
                                             dialog.option("really !!", 255);
                                         }
                                     }
                                     else
                                     {
                                         dialog.text("you don't have a password set.");
                                         dialog.option("really !!", 255);
                                     }
                                     dialog.send();
                                     break;
                                 }
                             case 207:
                                 {
                                     if (client.account.password != "")
                                     {
                                         if (npcrequest.input.length <= 14)
                                         {
                                             client.temppassword = npcrequest.input;
                                             dialog.text("aktb el password el gdeed tany.");
                                             dialog.input("here:", 208, 14);
                                             dialog.option("forget it.", 255);
                                         }
                                         else
                                         {
                                             dialog.text("invalid password, please try again.");
                                             dialog.input("here:", 207, 14);
                                             dialog.option("really !!", 255);
                                         }
                                     }
                                     else
                                     {
                                         dialog.text("you don't have a password set.");
                                         dialog.option("really !!", 255);
                                     }
                                     dialog.send();
                                     break;
                                 }
                             case 208:
                                 {
                                     if (client.account.password != "")
                                     {
                                         if (npcrequest.input.length <= 14)
                                         {
                                             if (client.temppassword == npcrequest.input)
                                             {
                                                 client.temppassword = "";
                                                 client.account.password = npcrequest.input;
                                                 client.account.save();
                                                 dialog.text("password changed!");
                                                 dialog.option("thanks !!", 255);
                                             }
                                             else
                                             {
                                                 dialog.text("wrong password.");
                                                 dialog.input("here:", 208, 14);
                                                 dialog.option("really !!", 255);
                                             }
                                         }
                                         else
                                         {
                                             dialog.text("invalid password, please try again.");
                                             dialog.input("here:", 208, 14);
                                             dialog.option("really !!", 255);
                                         }
                                     }
                                     else
                                     {
                                         dialog.text("you don't have a password set.");
                                         dialog.option("really !!", 255);
                                     }
                                     dialog.send();
                                     break;
                                 }
 
                             #endregion change password
 
 
                             #endregion changepassword
 
                             case 11:
                                 Client.send(new message("" + helpdesk.register + "", client.player.name, system.drawing.color.yellow, 0x839));
                                 break;
 
                             #region new register
                             case 100://new register fixed and done by mr_panda :p
                                 {
                                     dialog.text("hello. I'm the one that was choosen to make your new account.");
                                     dialog.option("i want to register.", 102);
                                     dialog.option("nooooo.", 255);
                                     dialog.send();
                                     break;
                                 }
 
                             #region new register
 
                             case 102:
                                 {
                                     dialog.text("please insert the new acc you want now.");
                                     dialog.input("here:", 106, 16);
                                     dialog.option("forget it.", 110);
                                     dialog.send();
                                     break;
                                 }
                             case 106:
                                 Uint input;
                                 if (uint.tryparse(npcrequest.input, out*input))
                                 {
                                     string accountname;
                                     accountname = npcrequest.input;
                                     client.accountname = accountname;
                                     if (!exists(accountname) && input < 4)
                                     {
                                         dialog.text("please insert the password .");
                                         dialog.input("here:", 107, 14);
                                         dialog.option("no.", 255);
 
                                     }
                                     else
                                     {
                                         dialog.text("invaild account name or account name already exit.");
                                         dialog.option("really", 255);
                                     }
                                     dialog.send();
                                     break;
                                 }
                                 else
                                 {
                                     dialog.text("please write the correct value 6 litters or more.");
                                     dialog.option("try again.", 102);
                                     dialog.option("quit.", 110);
                                     dialog.send();
                                 }
                                 break;
                             case 107:
                                 If (uint.tryparse(npcrequest.input, out*input))
                                 {
                                     string accountpass1;
                                     accountpass1 = npcrequest.input;
                                     client.accountpass1 = accountpass1;
                                     if (input < 6) return;
                                     dialog.text("please insert the password again.");
                                     dialog.input("here:", 108, 14);
                                     dialog.option("no.", 110);
                                     dialog.send();
                                     break;
                                 }
                                 else
                                 {
                                     dialog.text("please write the correct value 6 litters or more.");
                                     dialog.option("try again.", 106);
                                     dialog.option("quit.", 110);
                                     dialog.send();
                                 }
                                 break;
                             case 108:
                                 Try
                                 {
                                     string accountpass2;
 
                                     accountpass2 = npcrequest.input;
                                     client.accountpass2 = accountpass2;
                                     if (accountpass2 == client.accountpass1)
                                     {
                                         dialog.text("please insert the email || @yahoo.com will be added automatically.");
                                         dialog.input("here:", 109, 100);
                                         dialog.option("no.", 10);
 
                                     }
                                     else
                                     {
                                         dialog.text("wrong pass.");
                                         dialog.option("really !!", 10);
                                     }
                                     dialog.send();
                                     break;
                                 }
                                 catch
                                 {
                                     dialog.text("please write the correct value.");
                                     dialog.option("try again.", 7);
                                     dialog.option("quit.", 0xff);
                                     dialog.send();
                                 }
                                 break;
                             case 109:
                                 String accountemail;
                                 accountemail = npcrequest.input + "@yahoo.com";
                                 client.accountemail = accountemail;
                                 string str2 = client.socket.ip.tostring().split(new char[] { ':' })[0].tostring();
                                 client.account.ip = str2;
                                 using (var cmd = new mysqlcommand(mysqlcommandtype.insert))
                                     cmd.insert("accounts").insert("username", client.accountname)
                                         .insert("password", client.accountpass1).insert("state", (int)0).insert("ip", client.account.ip).insert("lastip", client.account.ip)
                                         .execute();
                                 //  conquer.database.account.insert(client.accountname, client.accountpass1, client.account.ip, client.account.ip, (ulong)0, (byte)0, 0, client.accountemail);
                                 client.accountname = "";
                                 client.accountpass1 = "";
                                 client.accountpass2 = "";
                                 client.accountemail = "";
                                 dialog.text("new account successfully done. || all rights® reserved to ahmed ©");
                                 dialog.option("ty 4 ur time.", 255);
                                 dialog.send();
                                 break;
                             case 110:
                                 Client.accountname = "";
                                 client.accountpass1 = "";
                                 client.accountpass2 = "";
                                 client.accountemail = "";
                                 dialog.text("failed !!. Good luck next time.");
                                 dialog.option("ty 4 ur time.", 255);
                                 dialog.send();
                                 break;
 
                             #endregion new register
 
 
 
                             #endregion changepassword
                             case 2:
                                 Client.send(new message("" + helpdesk.vote + "", client.player.name, system.drawing.color.yellow, 0x839));
                                 break;
 
                             case 3:
                                 Client.send(new message("" + helpdesk.chatbox + "", client.player.name, system.drawing.color.yellow, 0x839));
                                 break;
 
                             case 4:
                                 Client.send(new message("" + helpdesk.purchase + "", client.player.name, system.drawing.color.yellow, 0x839));
                                 break;
 
                             case 5:
                                 Client.send(new message("" + helpdesk.facebook + "", client.player.name, system.drawing.color.yellow, 0x839));
                                 break;
 
                             case 66:
                                 Client.send(new message("" + helpdesk.changepass + "", client.player.name, system.drawing.color.yellow, 0x839));
                                 break;
                         }
                         break;
 
                     #endregion 
 
		 
		
		 
	 
  
			
			 
		 |