当前位置: 首页>>代码示例>>C#>>正文


C# Player.SendInfo方法代码示例

本文整理汇总了C#中Player.SendInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendInfo方法的具体用法?C# Player.SendInfo怎么用?C# Player.SendInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.SendInfo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Process

 protected override bool Process(Player player, RealmTime time, string args)
 {
     if (player.HasConditionEffect(ConditionEffects.Paused))
     {
         player.ApplyConditionEffect(new ConditionEffect()
         {
             Effect = ConditionEffectIndex.Paused,
             DurationMS = 0
         });
         player.SendInfo("Game resumed.");
         return true;
     }
     else
     {
         if (player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>().Any())
         {
             player.SendError("Not safe to pause.");
             return false;
         }
         else
         {
             player.ApplyConditionEffect(new ConditionEffect()
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = -1
             });
             player.SendInfo("Game paused.");
             return true;
         }
     }
 }
开发者ID:patrick323,项目名称:rotmg_svr,代码行数:31,代码来源:WorldCommand.cs

示例2: Process

        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;
        }
开发者ID:SirAnuse,项目名称:fabiano-swagger-of-doom,代码行数:29,代码来源:GuildCommands.cs

示例3: Process

 protected override bool Process(Player player, RealmTime time, string[] args)
 {
     if (player.HasConditionEffect(ConditionEffectIndex.Paused))
     {
         player.ApplyConditionEffect(new ConditionEffect
         {
             Effect = ConditionEffectIndex.Paused,
             DurationMS = 0
         });
         player.SendInfo("Game resumed.");
     }
     else
     {
         foreach (Enemy i in player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>())
         {
             if (i.ObjectDesc.Enemy)
             {
                 player.SendInfo("Not safe to pause.");
                 return false;
             }
         }
         player.ApplyConditionEffect(new ConditionEffect
         {
             Effect = ConditionEffectIndex.Paused,
             DurationMS = -1
         });
         player.SendInfo("Game paused.");
     }
     return true;
 }
开发者ID:SirAnuse,项目名称:fabiano-swagger-of-doom,代码行数:30,代码来源:WorldCommand.cs

示例4: Execute

 public void Execute(Player player, string[] args)
 {
     if (player.Owner.Name != "Battle Arena" && player.Owner.Name != "Free Battle Arena")
     {
         if (player.HasConditionEffect(ConditionEffects.Paused))
         {
             foreach (var i in RealmManager.Clients.Values)
                 i.SendPacket(new NotificationPacket
                 {
                     Color = new ARGB(0xff00ff00),
                     ObjectId = player.Id,
                     Text = "Active"
                 });
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = 0
             });
             player.SendInfo("Active!");
         }
         else
         {
             foreach (var i in player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 8).OfType<Enemy>())
             {
                 if (i.ObjectDesc.Enemy)
                 {
                     player.SendInfo("Not safe to go AFK.");
                     return;
                 }
             }
             foreach (var i in RealmManager.Clients.Values)
                 i.SendPacket(new NotificationPacket
                 {
                     Color = new ARGB(0xff00ff00),
                     ObjectId = player.Id,
                     Text = "AFK"
                 });
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = -1
             });
             player.SendInfo("AFK!");
         }
     }
     else
     {
         player.SendInfo("You cannot pause in the arena");
     }
 }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:50,代码来源:WorldCommand.cs

示例5: Execute

 public void Execute(Player player, string[] args)
 {
     if (args.Length == 0)
     {
         player.SendHelp("Usage: /addeff <effect name or effect number>");
     }
     else
     {
         try
         {
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = (ConditionEffectIndex) Enum.Parse(typeof (ConditionEffectIndex), args[0].Trim(), true),
                 DurationMS = -1
             });
             {
                 player.SendInfo("Success!");
             }
         }
         catch
         {
             player.SendError("Invalid effect!");
         }
     }
 }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:25,代码来源:AdminCommands.cs

示例6: Process

 protected override bool Process(Player player, RealmTime time, string[] args)
 {
     if (args.Length == 0)
     {
         player.SendHelp("Usage: /addeff <Effectname or Effectnumber>");
         return false;
     }
     try
     {
         player.ApplyConditionEffect(new ConditionEffect
         {
             Effect = (ConditionEffectIndex)Enum.Parse(typeof(ConditionEffectIndex), args[0].Trim(), true),
             DurationMS = -1
         });
         {
             player.SendInfo("Success!");
         }
     }
     catch
     {
         player.SendError("Invalid effect!");
         return false;
     }
     return true;
 }
开发者ID:SirAnuse,项目名称:fabiano-swagger-of-doom,代码行数:25,代码来源:AdminCommands.cs

示例7: Execute

 public void Execute(Player player, string[] args)
 {
     if (player.Owner.Name != "Battle Arena" && player.Owner.Name != "Free Battle Arena")
         if (player.HasConditionEffect(ConditionEffects.Paused))
         {
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = 0
             });
             player.SendInfo("Game resumed.");
         }
         else
         {
             if (
                 player.Owner.EnemiesCollision.HitTest(player.X, player.Y, 6)
                     .OfType<Enemy>()
                     .Any(i => i.ObjectDesc.Enemy))
             {
                 player.SendInfo("Not safe to pause.");
                 return;
             }
             player.ApplyConditionEffect(new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paused,
                 DurationMS = -1
             });
             player.SendInfo("Game paused.");
         }
     else
         player.SendError("You cannot pause in the arena");
 }
开发者ID:BlackRayquaza,项目名称:PhoenixRealms,代码行数:32,代码来源:WorldCommand.cs

示例8: Execute

        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) // 0 is limbo??
                        {
                            foreach (var i in world.Players)
                            {
                                if (i.Value.Guild == player.Guild)
                                {
                                    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!");
        }
开发者ID:RiiggedMPGH,项目名称:Owl-Realms-Source,代码行数:40,代码来源:GuildCommands.cs

示例9: Execute

 public void Execute(Player player, string[] args)
 {
     if (player.GuildRank == 40)
     {
         foreach (var i in RealmManager.Worlds)
         {
             if (i.Key != 0)
             {
                 foreach (var e in i.Value.Players)
                 {
                     if (e.Value.Client.Account.Name.ToLower() == args[0].ToLower())
                     {
                         if (e.Value.Client.Account.Guild.Rank == 40)
                         {
                             player.SendInfo(e.Value.Client.Account.Name + " has been invited to ally with your guild!");
                             e.Value.Client.SendPacket(new GuildAllyRequestPacket
                             {
                                 Name = player.Client.Account.Name,
                                 Guild = player.Client.Account.Guild.Name
                             });
                         }
                         else
                         {
                             player.SendError(e.Value.Client.Account.Guild.Name + " is already one of your allys!");
                         }
                     }
                 }
             }
         }
     }
     else
     {
         {
             player.SendInfo("Only founders can ally with other guilds!");
         }
     }
 }
开发者ID:RoxyLalonde,项目名称:Phoenix-Realms,代码行数:37,代码来源:GuildCommands.cs

示例10: Process

        protected override bool Process(Player player, RealmTime time, string args)
        {
            StringBuilder sb = new StringBuilder("Users online: \r\n");
            foreach (var i in player.Manager.Clients.Values)
            {
                if (i.Stage == ProtocalStage.Disconnected) continue;
                sb.AppendFormat("{0}#{1}@{2}\r\n",
                    i.Account.Name,
                    i.Player.Owner.Name,
                    i.Socket.RemoteEndPoint.ToString());
            }

            player.SendInfo(sb.ToString());
            return true;
        }
开发者ID:patrick323,项目名称:rotmg_svr,代码行数:15,代码来源:AdminCommands.cs

示例11: Buy

 public override void Buy(Player player)
 {
     if (!player.Guild.IsDefault)
     {
         if (player.Guild[player.AccountId].Rank >= 30)
         {
             using (var db = new Database())
             {
                 if (db.GetGuild(db.GetGuildId(player.Guild[player.AccountId].Name)).GuildFame >= Price)
                 {
                     var cmd = db.CreateQuery();
                     cmd.CommandText = "UPDATE guilds SET level=level+1, [email protected] WHERE [email protected]";
                     cmd.Parameters.AddWithValue("@guildName", player.Guild.Name);
                     cmd.Parameters.AddWithValue("@price", Price);
                     if (cmd.ExecuteNonQuery() == 1)
                     {
                         player.Client.SendPacket(new BuyResultPacket
                         {
                             Message = "{\"key\":\"server.sale_succeeds\"}",
                             Result = -1
                         });
                         player.SendInfo("Please leave the Guild Hall, we need some minutes to update the Guild Hall.");
                         player.Guild.UpdateGuildHall();
                     }
                 }
                 else
                 {
                     player.SendHelp("FUCK");
                     player.Client.SendPacket(new BuyResultPacket
                     {
                         Message = "{\"key\":\"server.not_enough_fame\"}",
                         Result = 9
                     });
                 }
             }
         }
         else
         {
             player.Client.SendPacket(new BuyResultPacket
             {
                 Message = "Founder or Leader rank required.",
                 Result = 0
             });
         }
     }
 }
开发者ID:OryxAwakening,项目名称:Fabiano_Swagger_of_Doom,代码行数:46,代码来源:GuildMerchant.cs


注:本文中的Player.SendInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。