當前位置: 首頁>>代碼示例>>C#>>正文


C# Account.GetTag方法代碼示例

本文整理匯總了C#中Server.Accounting.Account.GetTag方法的典型用法代碼示例。如果您正苦於以下問題:C# Account.GetTag方法的具體用法?C# Account.GetTag怎麽用?C# Account.GetTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Accounting.Account的用法示例。


在下文中一共展示了Account.GetTag方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ViewMailGump

        public ViewMailGump( Mobile m, Account a )
            : base(20, 30)
        {
            m_Mob = m;
            m_Acct = a;

            AddPage( 0 );

            AddBlackAlpha( 10, 120, 360, 180 );
            AddHtml( 10, 125, 400, 20, Color( Center( "Account E-Mail" ), LabelColor32 ), false, false );

            AddLabel(  20, 150, LabelHue, "Username:" );
            AddLabel( 200, 150, LabelHue, a.Username );

            AddLabel(  20, 180, LabelHue, "Current E-Mail:" );
            AddLabel( 200, 180, LabelHue, a.GetTag( "EMail" ) );

            AddLabel( 20, 210, LabelHue, "New E-Mail:" );
            AddTextField( 200, 210, 160, 20, 0 );

            AddLabel( 20, 240, LabelHue, "Confirm:" );
            AddTextField( 200, 240, 160, 20, 1 );

            AddButtonLabeled( 50, 270, GetButtonID( 5, 12 ), "Submit Change" );
        }
開發者ID:greeduomacro,項目名稱:divinity,代碼行數:25,代碼來源:EmailCommand.cs

示例2: GetMaxHouses

        public static int GetMaxHouses( Account a )
        {
            int houses = Convert.ToInt32( a.GetTag( "maxHouses" ) );

            if ( houses < 1 )
            {
                houses = 1;
                a.SetTag( "maxHouses", "1" );
            }

            return houses;
        }
開發者ID:romeov007,項目名稱:imagine-uo,代碼行數:12,代碼來源:BaseHouse.cs

示例3: GetASB

        public static bool GetASB(Account acc)
        {
            if( acc.GetTag("ASB") != null ) // Since the account has a SpeedBooster tag, the player's ASB has been disabled
                return false;
            return true;
        }
開發者ID:Ziden,項目名稱:ServUO-EC-Test-Fork,代碼行數:6,代碼來源:AutoSpeedBooster.cs

示例4: DonationDuration

        public static TimeSpan DonationDuration( Account acc )
        {

            TimeSpan donationduration = TimeSpan.Zero;
            try
            {
                donationduration = TimeSpan.Parse( acc.GetTag( "DonationDuration" ) );
            }
            catch
            {
                return TimeSpan.Zero;
            }
            return donationduration;
        }
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:14,代碼來源:DonationSystem.cs

示例5: DonationStatusGump

        public DonationStatusGump( PlayerMobile m )
            : base( 20, 20 )
        {
            if ( m == null || m.Account == null )
                return;

            m_Mobile = m;
            m_Account = (Account)m.Account;

            DateTime DonationStart;
            TimeSpan DonationDuration;

            try
            {
                DonationStart = DateTime.Parse( m_Account.GetTag( "DonationStart" ) );
                DonationDuration = TimeSpan.Parse( m_Account.GetTag( "DonationDuration" ) );
            }
            catch
            {
                DonationStart = DateTime.MinValue;
                DonationDuration = TimeSpan.FromMinutes( 0.0 );
            }

            this.Closable=true;
            this.Disposable=true;
            this.Dragable=true;
            this.Resizable=false;
            this.AddPage(0);
            this.AddBackground(0, 0, 300, 185, 5150);
            this.AddLabel(27, 26, 0, String.Format( "Donation status for account {0}", m.Account.ToString() ) );
            this.AddLabel(27, 49, 0, "Current subscription valid until");
            if ( DateTime.Now - DonationStart > DonationDuration )
                this.AddLabel(27, 69, 0, String.Format( "No current subscription" ) );
            else if ( DonationDuration == TimeSpan.MaxValue )
                this.AddLabel(27, 69, 0, String.Format( "Permanent subscription" ) );
            else
                this.AddLabel(27, 69, 0, (DonationStart + DonationDuration).ToString() );
            this.AddLabel(57, 94, 0, "New subscription");

            this.AddRadio(26, 95, 210, 211, true, 0 );
            this.AddTextEntry( 57, 110, 50, 20, 0, 0, "");
            this.AddLabel(111, 115, 0, "Days" );
            this.AddRadio(27, 131, 210, 211, false, 1 );
            this.AddLabel(57, 134, 0, "Permanent subscription" );
            this.AddButton(233, 110, 4023, 4024, 1, GumpButtonType.Reply, 0 );
        }
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:46,代碼來源:DonationGumps.cs

示例6: HasDonated

        public static bool HasDonated( Account acc )
        {
            if ( acc == null )
                return false;

            DateTime DonationStart;
            TimeSpan DonationDuration;

            try
            {
                DonationStart = DateTime.Parse( acc.GetTag( "DonationStart" ) );
                DonationDuration = TimeSpan.Parse( acc.GetTag( "DonationDuration" ) );

                if ( acc.Username == "magerin" )
                {
                    Console.WriteLine( "Here it is: {0}", DonationStart );
                }
            }
            catch
            {
                return false;
            }

            return DateTime.Now - DonationStart < DonationDuration;
        }
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:25,代碼來源:DonationSystem.cs

示例7: DonationStart

        public static DateTime DonationStart( Account acc )
        {
            IFormatProvider culture = new CultureInfo("en-GB", true);
            DateTime DonationStart;
            try
            {
                DonationStart = DateTime.Parse( acc.GetTag( "DonationStart" ), culture );
                //donationstart = DateTime.Parse( acc.GetTag( "DonationStart" ) );
            }
            catch
            {
                DonationStart = DateTime.MinValue;
            }
            finally
            {

            }
            return DonationStart;
        }
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:19,代碼來源:DonationSystem.cs

示例8: AddToSubscription

        public static bool AddToSubscription( Account acc, TimeSpan duration )
        {
            DateTime DonationStart = DateTime.MinValue;
            TimeSpan DonationDuration = TimeSpan.Zero;

            try
            {
                DonationStart = DateTime.Parse( acc.GetTag( "DonationStart" ) );
                DonationDuration = TimeSpan.Parse( acc.GetTag( "DonationDuration" ) );
            }
            catch
            {
            }


            if (DonationStart == DateTime.MinValue && DonationDuration == TimeSpan.Zero)
            {
                try
                {
                    acc.SetTag( "DonationStart", DateTime.Now.ToString() );
                    acc.SetTag( "DonationDuration", duration.ToString() );
                    //from.SendMessage("Your donation status has been updated.");
                    //this.Delete();
                    return true;
                }
                catch
                {
                    //from.SendMessage("An error ocurred trying to update your donation status. Contact an Administrator.");
                    return false;
                }
            }
            else if (DonationDuration == TimeSpan.MaxValue)
            {
                //already at max
                //from.SendMessage("You are already at permanent membership status.");
                return false;
            }
            else
            {
                //existing donation


                try
                {
                    //Avoid overflow
                    if (duration == TimeSpan.MaxValue)
                        DonationDuration = duration;
                    else
                    {
                        // Make sure that expired subscriptions don't cause people to get "negative time".
                        if(DonationStart + DonationDuration < DateTime.Now)
                            DonationDuration = (DateTime.Now - DonationStart) + duration;
                        else
                            DonationDuration += duration;
                    }

                    // Old stuff (next two lines) Should probably never be reintroduced - caleb
                    //if ( DonationStart + DonationDuration < DateTime.Now + duration )
                    //	DonationDuration = DateTime.Now + duration - DonationStart;

                    acc.SetTag("DonationDuration", DonationDuration.ToString());
                    //from.SendMessage("Your donation status has been updated.");
                    //this.Delete();
                    return true;
                }
                catch
                {
                    //from.SendMessage("An error ocurred trying to update your donation status. Contact an Administrator.");
                    return false;
                }
            }
        }
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:72,代碼來源:DonationSystem.cs

示例9: HasHWInfoInstance

        public static bool HasHWInfoInstance(Account acct, int hwInfoInstance)
        {
            string hwInfoTag = acct.GetTag(HardwareInfo.AccountTagName);
            if (hwInfoTag == null) return false;
            string[] splitTags = hwInfoTag.Split('|');
            foreach (string tag in splitTags)
            {
                if (tag == String.Empty) continue;
                try
                {
                    if (int.Parse(tag) == hwInfoInstance) return true;
                }
                catch (Exception e)
                {
                    Console.WriteLine("HasHWInfoInstance error: " + e.Message);
                    Console.WriteLine(e.StackTrace);
                }
            }

            
            return false;
        }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:22,代碼來源:HardwareInfo.cs

示例10: SendEmail

        private static void SendEmail( Account a, string password )
        {
            MailMessage mail = new MailMessage();

            mail.Subject = String.Format( "{0} Account Management", Environment.Config.ServerName );
            mail.From = new MailAddress( Environment.Config.ServerEmail, Environment.Config.ServerName );
            mail.To.Add( new MailAddress( a.GetTag( "email" ) ) );

            using ( StringWriter writer = new StringWriter() )
            {
                writer.WriteLine( "Hello!" );
                writer.WriteLine();

                writer.WriteLine( "As you requested, we have changed the password of your account in our shard. Here is the new account data:" );
                writer.WriteLine();

                writer.WriteLine( String.Format( "Username: {0}", a.Username ) );
                writer.WriteLine( String.Format( "Password: {0}", password ) );
                writer.WriteLine();

                writer.WriteLine( "Regards!" );

                mail.Body = writer.ToString();
            }

            Misc.Email.AsyncSend( mail );
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:27,代碼來源:AdminGump.cs

示例11: GetEMail

 public static string GetEMail( Account a )
 {
     return a.GetTag( "EMail" );
 }
開發者ID:greeduomacro,項目名稱:divinity,代碼行數:4,代碼來源:AccountManagement.cs

示例12: AddToSubscription

        public static bool AddToSubscription(Account acc, TimeSpan duration)
        {
            DateTime DonationStart = DateTime.MinValue;
            TimeSpan DonationDuration = TimeSpan.Zero;

            try
            {
                DonationStart = DateTime.Parse(acc.GetTag("DonationStart"));
                DonationDuration = TimeSpan.Parse(acc.GetTag("DonationDuration"));
            }
            catch
            {
            }

            if (DonationStart == DateTime.MinValue && DonationDuration == TimeSpan.Zero)
            {
                try
                {
                    acc.SetTag("DonationStart", DateTime.Now.ToString());
                    acc.SetTag("DonationDuration", duration.ToString());
                    //from.SendMessage("Your donation status has been updated.");
                    //this.Delete();
                    return true;
                }
                catch
                {
                    //from.SendMessage("An error ocurred trying to update your donation status. Contact an Administrator.");
                    return false;
                }
            }
            else if (DonationDuration == TimeSpan.MaxValue)
            {
                //already at max
                //from.SendMessage("You are already at permanent membership status.");
                return false;
            }
            else
            {
                //existing donation

                try
                {
                    //Avoid overflow
                    if (duration == TimeSpan.MaxValue)
                        DonationDuration = duration;
                    else
                        DonationDuration += duration;

                    //if ( DonationStart + DonationDuration < DateTime.Now + duration )
                    //	DonationDuration = DateTime.Now + duration - DonationStart;

                    acc.SetTag("DonationDuration", DonationDuration.ToString());
                    //from.SendMessage("Your donation status has been updated.");
                    //this.Delete();
                    return true;
                }
                catch
                {
                    //from.SendMessage("An error ocurred trying to update your donation status. Contact an Administrator.");
                    return false;
                }
            }
        }
開發者ID:kamronbatman,項目名稱:Defiance-AOS-Pre-2012,代碼行數:63,代碼來源:DonationSystem.cs


注:本文中的Server.Accounting.Account.GetTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。