コード例 #1
0
        protected internal override void OnPurchase(Player p, string msg)
        {
            if (msg.Length == 0)
            {
                PlayerDB.SetLoginMessage(p.name, "");
                p.Message("&aYour login message was removed for free.");
                return;
            }

            if (!CheckPrice(p))
            {
                return;
            }
            if (msg == PlayerDB.GetLoginMessage(p))
            {
                p.Message("&WYou already have that login message."); return;
            }
            if (msg.Length > NetUtils.StringSize)
            {
                p.Message("&WLogin message must be 64 characters or less."); return;
            }

            UseCommand(p, "LoginMessage", "-own " + msg);
            Economy.MakePurchase(p, Price, "%3LoginMessage: %f" + msg);
        }
コード例 #2
0
ファイル: CmdLoginMessage.cs プロジェクト: Peteys93/MCGalaxy
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Help(p); return;
            }
            string[] args = message.Split(trimChars, 2);
            if (args.Length < 2)
            {
                Help(p); return;
            }

            Player target = PlayerInfo.Find(args[0]);
            string name   = target != null ? target.name : args[0];

            if (target == null && PlayerInfo.FindOfflineName(name) == null)
            {
                Player.SendMessage(p, "There is no player with the given name."); return;
            }
            PlayerDB.SetLoginMessage(name, args[1]);

            string fullName = target != null ? target.ColoredName : name;

            Player.SendMessage(p, "The login message of " + fullName + " %Shas been changed to: " + args[1]);
            string changer = p == null ? "(console)" : p.name;

            Server.s.Log(changer + " changed " + name + "'s login message to: " + args[1]);
        }
コード例 #3
0
 protected override void SetPlayerData(Player p, string target, string msg)
 {
     PlayerDB.SetLoginMessage(target, msg);
     if (msg.Length == 0)
     {
         p.Message("Login message of {0} %Swas removed.", p.FormatNick(target));
     }
     else
     {
         p.Message("Login message of {0} %Swas changed to: {1}", p.FormatNick(target), msg);
     }
 }
コード例 #4
0
 protected override void SetPlayerData(Player p, Player who, string msg)
 {
     PlayerDB.SetLoginMessage(who.name, msg);
     if (msg.Length == 0)
     {
         p.Message("Login message of {0} %Swas removed.",
                   who.ColoredName);
     }
     else
     {
         p.Message("Login message of {0} %Swas changed to: {1}",
                   who.ColoredName, msg);
     }
 }
コード例 #5
0
ファイル: CmdLoginMessage.cs プロジェクト: Benedani/MCGalaxy
 protected override void SetPlayerData(Player p, Player who, string[] args)
 {
     if (args.Length == 1)
     {
         string path = PlayerDB.LoginPath(who.name);
         if (File.Exists(path))
         {
             File.Delete(path);
         }
         Player.Message(p, "The login message of {0} %Shas been removed.",
                        who.ColoredName);
     }
     else
     {
         PlayerDB.SetLoginMessage(who.name, args[1]);
         Player.Message(p, "The login message of {0} %Shas been changed to: {1}",
                        who.ColoredName, args[1]);
     }
 }
コード例 #6
0
        protected override void DoPurchase(Player p, string message, string[] args)
        {
            if (args.Length == 1)
            {
                PlayerDB.SetLoginMessage(p.name, "");
                p.Message("&aYour login message was removed for free.");
                return;
            }

            string msg = message.SplitSpaces(2)[1]; // keep spaces this way

            if (msg == PlayerDB.GetLoginMessage(p))
            {
                p.Message("%WYou already have that login message."); return;
            }
            if (msg.Length > NetUtils.StringSize)
            {
                p.Message("%WLogin message must be 64 characters or less."); return;
            }

            UseCommand(p, "LoginMessage", "-own " + msg);
            Economy.MakePurchase(p, Price, "%3LoginMessage: %f" + msg);
        }