عرض مشاركة واحدة
احصائياتى

الردود
7

المشاهدات
1715
 
Commander

Commander is on a distinguished road

    غير متواجد

المشاركات
127

+التقييم
0.06

تاريخ التسجيل
Jul 2019

الاقامة
https://www.facebook.com/Hossam.eldein123/

نظام التشغيل

رقم العضوية
407
2019-12-06, 11:00 PM
المشاركة 1 
#1  
افتراضي Register Npc : ان بي سي عمل اكونت
بسم الله الرحمن الرحيم
انا لقيت ان بي سي تسجيل نازل مع احترامي للشخص الي منزلو تكويده غلط فا قولت اعمل واحد وانزلو لاي حد يستفاد بيه

كود:
#region Register Commander
                
case 764738:
                    {
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    
dialog.Text("I`m HelpDesk I'M Here For Your Help ");
                                    
dialog.Option("Register Account"1);
                                    
dialog.Avatar(7070);
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    
dialog.Text("Please insert UserName");
                                    
dialog.Input("here:"28);
                                    if (
npcRequest.Input.Length 8)
                                    {
                                        
dialog.Text("Max Letter 8");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
dialog.Send();
                                    break;
                                }
                            case 
2:
                                {
                                    
string username npcRequest.Input;
                                    
MySqlCommand cmd2 = new MySqlCommand(MySqlCommandType.SELECT).Select("accounts").Where("Username"username);//debug and test!
                                    
MySqlReader r = new MySqlReader(cmd2);
                                    if (!
r.Read())//wait
                                    
{
                                        
client.Username username;
                                    }
                                    else
                                    {
                                        
dialog.Text("UserName Is Already Here");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
dialog.Text("Please insert Password");
                                    
dialog.Input("here:"314);
                                    if (
npcRequest.Input.Length 14)
                                    {
                                        
dialog.Text("Max Letter 14");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }                                 
                                    break;
                                }
                            case 
3:
                                {
                                    
string password npcRequest.Input;
                                    
client.Password password;
                                    
using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
                                        
cmd.Insert("accounts").Insert("Username"client.Username)
                                        .
Insert("Password"client.Password).Insert("IP"client.Account.IP)
                                        .
Execute();
                                    
client.Username "";
                                    
client.Password "";
                                    
dialog.Text("Register Successfully Done");
                                    
dialog.Option("Thanks."255);
                                    
dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
               
#endregion 

روح كلاس

كود:
 GameState Or GameClient 

حط ده

كود:
#region Register
        
public string Username;
        public 
string Password;
       
        
#endregion 

بس كدا الانبي سي شغال ومفهوش غلطات ان شاء الله ولو حد لقي غلطه يقولي وهصلحها في ساعتها