[font=Tahoma]

Bu Scrıpt Ile Sıfrenizi Oyunıcı Degıstırebılırsınız...[/font]


[font=Tahoma]Sifre.cs[/font]
using System; 
using Server; 
using System.IO; 
using Server.Gumps; 
using Server.Network; 
using Server.Items; 
using Server.Mobiles; 
using Server.Accounting; 

namespace Server.Gumps 
{ 
      public class AccountLogin : Gump 
      { 
            public static void Initialize() 
            { 
               Commands.Register( "sifre", AccessLevel.Player, new CommandEventHandler( AccountLogin_OnCommand ) ); 
            } 

            private static void AccountLogin_OnCommand( CommandEventArgs e ) 
            { 
               e.Mobile.SendGump( new AccountLogin( e.Mobile ) ); 
            } 

            private Mobile m_From; 

            public AccountLogin( Mobile owner ) : base( 25,25 ) 
            { 
         Closable=true; 
         Disposable=true; 
         Dragable=true; 
         Resizable=false; 
         AddPage(0); 
         AddBackground(13, 12, 333, 193, 5120); 
         AddImageTiled(28, 81, 212, 25, 9304); 
         AddImageTiled(28, 135, 212, 25, 9304); 
         AddLabel(30, 59, 1160, @"Kullanici Adi:"); 
         AddLabel(30, 114, 1160, @"Sifre:"); 
         AddImage(255, 53, 5504); 
         AddButton(250, 136, 4023, 4024, 1, GumpButtonType.Reply, 0); 
         AddLabel(286, 138, 1149, @"Onayla"); 
         AddTextEntry(28, 81, 212, 25, 0, 1, @""); 
         AddTextEntry(28, 135, 212, 25, 0, 2, @""); 
         AddLabel(28, 166, 1149, @"Güvenliginiz için lütfen kullanici adinizi ve"); 
         AddLabel(28, 178, 1149, @"sifrenizi giriniz"); 
         AddLabel(25, 16, 1160, @"Hesap Giris Penceresi"); 

      } 
            public override void OnResponse( NetState state, RelayInfo info ) 
            { 

              if ( info.ButtonID == 1 ) // Add Email 
               { 
                           Mobile from = state.Mobile; 
                           Account acct = (Account)from.Account; 
                     string user = (string)info.GetTextEntry( 1 ).Text; 
                     string pass = (string)info.GetTextEntry( 2 ).Text; 

            if ( user == acct.Username && acct.CheckPassword( pass ) ) 
            { 
               from.SendMessage( 64, "Giris Onaylandi." ); 
               from.SendGump( new AccountInfo( from ) ); 
            } 
            else 
            { 
               from.SendMessage( 38, "Kullanici adiniz ya da sifreniz hatali, Lütfen yadiklarinizi kontrol edin, sifreniz ve kullanici adiniz büyük/küçük harfe duyarlidir. Lütfen tekrar deneyiniz." ); 
            } 
         } 
           } 
   } 
}

[font=Tahoma]SifreGump.cs[/font]
using System; 
using Server; 
using Server.Network; 
using Server.Mobiles; 
using Server.Accounting; 
using System.Collections; 
using Server.Scripts.Commands; 
using Server.Gumps; 

namespace Server.Gumps 
{ 
   public class AccountInfo : Gump 
   { 
      private Mobile m_From; 

      private int m_PassLength = 6; 

      public AccountInfo( Mobile from ) : base( 0, 0 ) 
      { 
         m_From = from; 

                        Account acct = (Account)from.Account; 
         PlayerMobile pm = (PlayerMobile)from; 
         NetState ns = from.NetState; 
         ClientVersion v = ns.Version; 

         TimeSpan totalTime = (DateTime.Now - acct.Created); 

         Closable=true; 
         Disposable=true; 
         Dragable=true; 
         Resizable=false; 
         AddPage(0); 
         AddPage(1); 
         AddBackground(39, 29, 417, 276, 5120); 
         AddLabel(49, 33, 1160, @"Hesap Ana Menusu"); 
         AddButton(52, 67, 4005, 4006, 1, GumpButtonType.Page, 2); 
         AddLabel(85, 68, 1149, @"Sifre Degistir"); 
         AddImageTiled(52, 159, 393, 131, 9254); 
         AddAlphaRegion(52, 158, 393, 131); 
         AddLabel(56, 136, 1160, @"Hesap Bilgisi:"); 
         AddLabel(60, 165, 1149, @"Kullanici Adi:"); 
         AddLabel(60, 185, 1149, @"Client Versiyonu:"); 
         AddLabel(60, 205, 1149, @"IP Adresiniz:"); 
         AddLabel(60, 225, 1149, @"Hesap Yaratim Tarihi:"); 
         AddLabel(60, 245, 1149, @"Oyun Süreniz:"); 
         AddLabel(60, 265, 1149, @"Hesap Yasi:"); 
         AddImage(384, 39, 5523); 
         AddLabel(134, 165, 64, acct.Username.ToString() ); 
         AddLabel(157, 185, 64, v == null ? "(null)" : v.ToString() ); 
         AddLabel(135, 205, 64, ns.ToString() ); 
         AddLabel(187, 225, 64, acct.Created.ToString() ); 
          
         string gt = pm.GameTime.Days + " Gün, " + pm.GameTime.Hours + " Saat, " + pm.GameTime.Minutes + " Dakika, " + pm.GameTime.Seconds + " Saniye."; 
         AddLabel(145, 245, 64, gt.ToString() ); 

         string tt = totalTime.Days + " Gün, " + totalTime.Hours + " Saat, " + totalTime.Minutes + " Dakika, " + totalTime.Seconds + " Saniye."; 
         AddLabel(150, 265, 64, tt.ToString() ); 
         AddPage(2); 
         AddBackground(39, 29, 262, 240, 5120); 
         AddLabel(50, 30, 1160, @"Sifre Degistirme Menusu"); 
         AddImageTiled(50, 75, 238, 29, 9304); 
         AddImageTiled(50, 135, 238, 29, 9304); 
         AddImageTiled(50, 195, 238, 29, 9304); 
         AddLabel(50, 55, 1149, @"Simdiki Sifreniz:"); 
         AddLabel(50, 115, 1149, @"Yeni Sifreniz:"); 
         AddLabel(50, 175, 1149, @"Sifrenizi Onaylayin:"); 
         AddButton(50, 233, 4023, 4024, 1, GumpButtonType.Reply, 0); 
         AddLabel(85, 234, 1160, @"Sifremi Degistir"); 
         AddTextEntry(50, 75, 238, 29, 0, 1, @""); 
         AddTextEntry(50, 135, 238, 29, 0, 2, @""); 
         AddTextEntry(50, 195, 238, 29, 0, 3, @""); 

      } 
            public override void OnResponse( NetState state, RelayInfo info ) 
            { 

              if ( info.ButtonID == 1 ) // Add Email 
               { 
                           Mobile from = state.Mobile; 
                           Account acct = (Account)from.Account; 
                     string cpass = (string)info.GetTextEntry( 1 ).Text; 
                     string newpass = (string)info.GetTextEntry( 2 ).Text; 
                     string newpass2 = (string)info.GetTextEntry( 3 ).Text; 

            if ( acct.CheckPassword( cpass ) ) 
            { 
               if ( newpass == null || newpass2 == null ) 
               { 
                  from.SendMessage( 38, "Yeni bir sifre yazip onaylamalisiniz." ); 
               } 
               else if ( newpass.Length <= m_PassLength ) 
               { 
                  from.SendMessage( 38, "Yeni sifreniz en az {0} karakter uzunlugunda olmali.", m_PassLength ); 
               } 
               else if ( newpass == newpass2 ) 
               { 
                  from.SendMessage( "Yeni sifreniz {0} olarak degistirildi.", newpass ); 
                  acct.SetPassword( newpass ); 
                  CommandLogging.WriteLine( from, "{0} {1} has changed thier password for account {2} using the [accountlogin command", from.AccessLevel, CommandLogging.Format( from ), acct.Username ); 
               } 
               else 
               { 
                  from.SendMessage( 38, "Yeni sifrenizi yazarken dikkat ediniz, yazdiginiz sifre birbirini tutmuyor.Lütfen yazdiginiz sifrenizi bir kere daha kontrol ediniz" ); 
                  from.SendMessage( 38, "Hatirlatma: Sifreler büyük/küçük harfe duyarlidir." ); 
               } 
            } 
            else 
            { 
               from.SendMessage( 38, "Yeni sifrenizi yazarken dikkat ediniz, yazdiginiz sifre birbirini tutmuyor.Lütfen yazdiginiz sifrenizi bir kere daha kontrol ediniz" ); 
               from.SendMessage( 38, "Hatirlatma: Sifreler büyük/küçük harfe duyarlidir." ); 
            } 
         } 
           } 
   } 
}

Üye Ol veya Giriş Yap

Bu forum başlığına mesaj atmak istiyorsanız hemen üye olun veya giriş yapın.