SendHelp() public method

public SendHelp ( string text ) : void
text string
return void
コード例 #1
0
        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            if (!player.Guild.IsDefault)
            {
                try
                {
                    var saytext = string.Join(" ", args);

                    if (String.IsNullOrWhiteSpace(saytext))
                    {
                        player.SendHelp("Usage: /guild <text>");
                        return false;
                    }
                    else
                    {
                        player.Guild.Chat(player, saytext.ToSafeText());
                        return true;
                    }
                }
                catch
                {
                    player.SendInfo("Cannot guild chat!");
                    return false;
                }
            }
            else
                player.SendInfo("You need to be in a guild to use guild chat!");
            return false;
        }
コード例 #2
0
        public void Execute(Player player, string[] args)
        {
            if (player.Guild != "")
            {
                try
                {
                    var saytext = string.Join(" ", args);

                    foreach (var w in RealmManager.Worlds)
                    {
                        var world = w.Value;
                        if (w.Key == 0)
                            continue;
                        foreach (var i in world.Players.Where(i => i.Value.Guild == player.Guild))
                        {
                            if (string.IsNullOrEmpty(saytext))
                                player.SendHelp("Usage: /g <text>");
                            else
                            {
                                var tp = new TextPacket
                                {
                                    BubbleTime = 10,
                                    Stars = player.Stars,
                                    Name = player.ResolveGuildChatName(),
                                    Recipient = "*Guild*",
                                    Text = saytext
                                };
                                if (world.Id == player.Owner.Id) tp.ObjectId = player.Id;
                                i.Value.Client.SendPacket(tp);
                            }
                        }
                    }
                }
                catch
                {
                    player.SendInfo("Cannot guild chat!");
                }
            }
            else
                player.SendInfo("You need to be in a guild to use guild chat!");
        }