Exemple #1
0
        private static void SendAnnoyGump(Mobile m)
        {
            if (m.NetState != null && m.NetState.Version < Required)
            {
                Gump g = new WarningGump(1060637, 30720,
                                         String.Format(
                                             "Your client is out of date. Please update your client.<br>This server recommends that your client version be at least {0}.<br> <br>You are currently using version {1}.<br> <br>To patch, run UOPatch.exe inside your Ultima Online folder.",
                                             Recommended, m.NetState.Version), 0xFFC000, 480, 360,
                                         delegate
                {
                    m.SendMessage("You will be reminded of this again.");

                    if (m_OldClientResponse == OldClientResponse.LenientKick)
                    {
                        m.SendMessage(
                            "Old clients will be kicked after {0} days of character age and {1} hours of play time",
                            m_AgeLeniency, m_GameTimeLeniency);
                    }

                    Timer.DelayCall(TimeSpan.FromMinutes(Utility.Random(5, 15)), () => SendAnnoyGump(m));
                }, null, false);

                g.Dragable  = false;
                g.Closable  = false;
                g.Resizable = false;

                m.SendGump(g);
            }
        }
        private static void SendAnnoyGump(Mobile m)
        {
            if (m.NetState != null && m.NetState.Version < Required)
            {
                // Scriptiz : on change UOPatch.exe en UO.exe et on traduit
                //Gump g = new WarningGump( 1060637, 30720, String.Format( "Your client is out of date. Please update your client.<br>This server recommends that your client version be at least {0}.<br> <br>You are currently using version {1}.<br> <br>To patch, run UO.exe inside your Ultima Online folder.", Required, m.NetState.Version ), 0xFFC000, 480, 360,
                Gump g = new WarningGump(1060637, 30720, String.Format("Votre client n'est pas à jour. Merci d'effectuer les mises à jour.<br>Ce serveur recommande que vous utilisiez au moins la version {0} du client.<br> <br>Votre version actuelle est la version {1}.<br> <br>Pour mettre à jour, lancez UO.exe à partir du dossier Ultima Online.", Required, m.NetState.Version), 0xFFC000, 480, 360,
                                         delegate(Mobile mob, bool selection, object o)
                {
                    //m.SendMessage( "You will be reminded of this again." );
                    m.SendMessage("Vous serez averti à nouveau.");

                    if (m_OldClientResponse == OldClientResponse.LenientKick)
                    {
                        m.SendMessage("Old clients will be kicked after {0} days of character age and {1} hours of play time", m_AgeLeniency, m_GameTimeLeniency);
                    }

                    // Scriptiz : une fois suffit :)
                    //Timer.DelayCall( TimeSpan.FromMinutes( Utility.Random( 5, 15 ) ), delegate { SendAnnoyGump( m ); } );
                }, null, false);

                g.Dragable  = false;
                g.Closable  = false;
                g.Resizable = false;

                m.SendGump(g);
            }
        }
        private static void SendAnnoyGump(Mobile m)
        {
            if (m.NetState != null && m.NetState.Version < Required)
            {
                Gump g = new WarningGump(1060637, 30720, String.Format("Your client is out of date. Please update your client.<br>This server recommends that your client version be at least {0}.<br> <br>You are currently using version {1}.<br> <br>To patch, run UOPatch.exe inside your Ultima Online folder.", Required, m.NetState.Version), 0xFFC000, 480, 360,
                                         delegate(Mobile mob, bool selection, object o)
                {
                    m.SendMessage("You will be reminded of this again.");
                    Timer.DelayCall(TimeSpan.FromMinutes(20), delegate { SendAnnoyGump(m); });
                }, null, false);

                g.Dragable  = false;
                g.Closable  = false;
                g.Resizable = false;

                m.SendGump(g);
            }
        }
        private static void SendAnnoyGump(Mobile m)
        {
            if (m.NetState != null)
            {
                Gump g = new WarningGump(
                    1060637,
                    30720,
                    $"Your client is invalid.<br>This server recommends that your client version is {GetVersionExpression()}.<br> <br>You are currently using version {m.NetState.Version}.",
                    0xFFC000,
                    480,
                    360,
                    okay => KickMessage(m, okay),
                    false
                    )
                {
                    Draggable = false,
                    Closable  = false,
                    Resizable = false,
                };

                m.SendGump(g);
            }
        }
Exemple #5
0
        public override void OnResponse(Network.NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 1)
            {
                int    price;
                string name;
                string desc;

                if ((String.IsNullOrWhiteSpace(info.GetTextEntry(0).Text)) || (String.IsNullOrEmpty(info.GetTextEntry(0).Text)) || (info.GetTextEntry(0).Text.Length < 3))
                {
                    sender.Mobile.SendMessage(StringList.InvalidName);
                    string[] param = { info.GetTextEntry(0).Text, info.GetTextEntry(1).Text, info.GetTextEntry(2).Text, info.GetTextEntry(3).Text };
                    sender.Mobile.SendGump(new AddAuctionGump(Mob, Cont, Item, param));
                    return;
                }

                if ((String.IsNullOrWhiteSpace(info.GetTextEntry(1).Text)) || (String.IsNullOrEmpty(info.GetTextEntry(1).Text)) || (info.GetTextEntry(1).Text.Length < 3))
                {
                    sender.Mobile.SendMessage(StringList.InvalidDesc);
                    string[] param = { info.GetTextEntry(0).Text, info.GetTextEntry(1).Text, info.GetTextEntry(2).Text, info.GetTextEntry(3).Text };
                    sender.Mobile.SendGump(new AddAuctionGump(Mob, Cont, Item, param));
                    return;
                }

                if ((!int.TryParse(info.GetTextEntry(2).Text, out price)) || (price < 0) || price >= int.MaxValue)
                {
                    sender.Mobile.SendMessage(StringList.InvalidPrice);
                    string[] param = { info.GetTextEntry(0).Text, info.GetTextEntry(1).Text, info.GetTextEntry(2).Text, info.GetTextEntry(3).Text };
                    sender.Mobile.SendGump(new AddAuctionGump(Mob, Cont, Item, param));
                    return;
                }
                int days = 0;
                if ((!int.TryParse(info.GetTextEntry(3).Text, out days)) || (days < 1) || days > 365)
                {
                    sender.Mobile.SendMessage(StringList.InvalidDuration);
                    string[] param = { info.GetTextEntry(0).Text, info.GetTextEntry(1).Text, info.GetTextEntry(2).Text, info.GetTextEntry(3).Text };
                    sender.Mobile.SendGump(new AddAuctionGump(Mob, Cont, Item, param));
                    return;
                }


                if (Item.ParentEntity != Mob.Backpack)
                {
                    Mob.SendMessage(StringList.MustBeOnPack);
                    string[] param = { info.GetTextEntry(0).Text, info.GetTextEntry(1).Text, info.GetTextEntry(2).Text, info.GetTextEntry(3).Text };
                    sender.Mobile.SendGump(new AddAuctionGump(Mob, Cont, Item, param));
                    return;
                }

                name = info.GetTextEntry(0).Text;
                desc = info.GetTextEntry(1).Text;

                WarningGump wg = new WarningGump(
                    1074862,
                    0xffffff,
                    String.Format(StringList.StartAuctWarnMessage, name, price > 0 ? price.ToString() + StringList.StartAuctGold : StringList.StartAuctDonation),
                    0xffffff,
                    340, 180,
                    new WarningGumpCallback(Accepted),
                    new ObjectHolder(name, desc, Mob, Item, Cont, days, price));
                sender.Mobile.SendGump(wg);
                return;
            }
            sender.Mobile.SendGump(new AuctionGump(Mob, Cont));
        }