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


C# Client.SendChatText方法代码示例

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


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

示例1: CommandHelp

 public override void CommandHelp(Client client)
 {
     client.SendChatText("Usage: /command shopspawn hash");
     client.SendChatText("For a list of available templates: /command shopspawn list [filter1,filter2...]");
     client.SendChatText("Filter will be applied to vendor name");
     return;
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:7,代码来源:ShopSpawn.cs

示例2: ExecuteCommand

        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            Client mClient = null;

            if (target.Type != 50000)
            {
                client.SendChatText("Target must be player");
                return;
            }
            if ((mClient = FindClient.FindClientById(target.Instance)) != null)
            {
                mClient.Character.LastName = "";
                mClient.Character.FirstName = "";
                mClient.Character.WriteNames();
                client.SendChatText(mClient.Character.Name + "'s names have been reset.");
            }
        }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:17,代码来源:RemoveName.cs

示例3: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     client.SendChatText(
         client.Character.Coordinates + " " + client.Character.PlayField + " "
         + client.Character.Heading.x.ToString() + " " + client.Character.Heading.y.ToString() + " "
         + client.Character.Heading.z.ToString() + " " + client.Character.Heading.w.ToString() + " "
         + client.Character.Heading.VectorRepresentation());
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:8,代码来源:Coorddebug.cs

示例4: ExecuteCommand

        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            // Fallback to self if no target is selected
            if (target.Instance == 0)
            {
                target.Type = client.Character.Type;
                target.Instance = client.Character.Id;
            }

            int statId = StatsList.GetStatId(args[1]);
            if (statId == 1234567890)
            {
                client.SendChatText("Unknown Stat name " + args[1]);
                return;
            }
            uint statNewValue = 1234567890;
            try
            {
                statNewValue = uint.Parse(args[2]);
            }
            catch
            {
                try
                {
                    // For values >= 2^31
                    statNewValue = (uint.Parse(args[2]));
                }
                catch (FormatException)
                {
                }
                catch (OverflowException)
                {
                }
            }
            Character tempch = (Character)FindDynel.FindDynelById(target.Type, target.Instance);
            uint statOldValue;
            try
            {
                statOldValue = tempch.Stats.GetBaseValue(statId);
                tempch.Stats.SetStatValueByName(statId, statNewValue);
                if (tempch.Client != null)
                {
                    tempch.Stats.Send(tempch.Client, statId);
                }
            }
            catch
            {
                client.SendChatText("Unknown StatId " + statId);
                return;
            }

            string response = "Character " + tempch.Name + " (" + target.Instance + "): Stat "
                              + StatsList.GetStatName(statId) + " (" + statId + ") =";
            response += " Old: " + statOldValue;
            response += " New: " + statNewValue;
            client.SendChatText(response);
        }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:57,代码来源:Set.cs

示例5: ExecuteCommand

        /// <summary>
        /// The execute command.
        /// </summary>
        /// <param name="client">
        /// The client.
        /// </param>
        /// <param name="target">
        /// The target.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            if (args.Length >= 2)
            {
                if (args[1].ToLower() == "list")
                {
                    string filter = string.Empty;
                    if (args.Length > 2)
                    {
                        for (int i = 2; i < args.Length; i++)
                        {
                            if (filter.Length > 0)
                            {
                                filter = filter + " AND ";
                            }

                            if (filter.Length == 0)
                            {
                                filter = "WHERE ";
                            }

                            filter = filter + "name like '%" + args[i] + "%' ";
                        }
                    }

                    SqlWrapper sql = new SqlWrapper();
                    DataTable dt =
                        sql.ReadDatatable("SELECT Hash, Name FROM mobtemplate " + filter + " order by Name ASC");
                    client.SendChatText("List of mobtemplates: ");
                    foreach (DataRow row in dt.Rows)
                    {
                        client.SendChatText(row[0] + " " + row[1]);
                    }
                    return;
                }
            }

            if (args.Length == 3)
            {
                NonPlayerCharacterHandler.SpawnMonster(client, args[1], uint.Parse(args[2]));
                return;
            }
            this.CommandHelp(client);
        }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:56,代码来源:Spawn.cs

示例6: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     Client targetClient = null;
     if ((targetClient = FindClient.FindClientByName(args[1])) != null)
     {
         targetClient.Server.DisconnectClient(targetClient);
         return;
     }
     client.SendChatText("Character '" + args[1] + "' not found.");
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:10,代码来源:Ghost.cs

示例7: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     Client targetClient = null;
     if ((targetClient = FindClient.FindClientByName(args[1])) != null)
     {
         targetClient.Teleport(
             client.Character.Coordinates, client.Character.Heading, client.Character.PlayField);
         return;
     }
     client.SendChatText("Character '" + args[1] + "' not found.");
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:11,代码来源:Summon.cs

示例8: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     int id = int.Parse(args[1]);
     Dynel d = FindDynel.FindDynelById(50000, id);
     if (d == null)
     {
         client.SendChatText("Couldn't find Dynel " + id);
     }
     else
     {
         client.Teleport(d.Coordinates, d.Heading, d.PlayField);
     }
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:13,代码来源:TeleportToNPC.cs

示例9: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     client.SendChatText("Looking up for statel in playfield " + client.Character.PlayField.ToString());
     Statels.Statel o = null;
     foreach (Statels.Statel s in Statels.Statelppf[client.Character.PlayField])
     {
         if (o == null)
         {
             o = s;
         }
         else
         {
             if (AOCoord.Distance2D(client.Character.Coordinates, s.Coordinates)
                 < AOCoord.Distance2D(client.Character.Coordinates, o.Coordinates))
             {
                 o = s;
             }
         }
     }
     if (o == null)
     {
         client.SendChatText("No statel on this playfield... Very odd, where exactly are you???");
         return;
     }
     client.SendChatText(o.Type + ":" + o.Instance);
     foreach (Statels.StatelEvent se in o.Events)
     {
         client.SendChatText(
             "Event: " + se.EventNumber.ToString() + " # of Functions: " + se.Functions.Count.ToString());
         foreach (Statels.Statel_Function sf in se.Functions)
         {
             string Fargs = "";
             foreach (string arg in sf.Arguments)
             {
                 if (Fargs.Length > 0)
                 {
                     Fargs = Fargs + ", ";
                 }
                 Fargs = Fargs + arg;
             }
             client.SendChatText(
                 "    Fn: " + sf.FunctionNumber.ToString() + ", # of Args: " + sf.Arguments.Count.ToString());
             client.SendChatText("    Args: " + Fargs);
             foreach (Statels.Statel_Function_Requirement sfr in sf.Requirements)
             {
                 string req;
                 req = "Attr: " + sfr.AttributeNumber.ToString() + " Value: " + sfr.AttributeValue.ToString()
                       + " Target: " + sfr.Target.ToString() + " Op: " + sfr.Operator.ToString();
                 client.SendChatText("    Req: " + req);
             }
         }
     }
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:53,代码来源:ShowStatel.cs

示例10: ExecuteCommand

        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            lock (client.Character.Timers)
            {
                client.SendChatText("--------------------------------------------------");
                client.SendChatText(
                    "Timer Debug output  Startup: " + client.Character.Starting.ToString() + " NOW: "
                    + DateTime.Now.ToString());
                foreach (AOTimers at in client.Character.Timers)
                {
                    string func = " Function " + at.Function.FunctionType.ToString() + " Args: ";
                    foreach (object d in at.Function.Arguments)
                    {
                        func = func + d + ", ";
                    }
                    func = func.Substring(0, func.Length - 2);

                    client.SendChatText(
                        "Strain:" + at.Strain.ToString() + " TI: " + at.Function.TickInterval.ToString() + " TC: "
                        + at.Function.TickCount.ToString() + " NT: " + at.Timestamp.ToString() + func);
                }
            }
        }
开发者ID:semirs,项目名称:CellAO,代码行数:23,代码来源:ListTimers.cs

示例11: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     if ((args.Length == 2) && (args[1].ToLower() != "list"))
     {
         VendorHandler.SpawnVendor(client, args[1]);
     }
     else
     {
         if (args.Length >= 2)
         {
             string filter = "";
             if (args.Length > 2)
             {
                 for (int i = 2; i < args.Length; i++)
                 {
                     if (filter.Length > 0)
                     {
                         filter = filter + " AND ";
                     }
                     if (filter.Length == 0)
                     {
                         filter = "WHERE ";
                     }
                     filter = filter + "name like '%" + args[i] + "%' ";
                 }
             }
             SqlWrapper sql = new SqlWrapper();
             DataTable dt =
                 sql.ReadDatatable("SELECT Hash, Name FROM vendortemplate " + filter + " order by Name ASC");
             client.SendChatText("List of vendortemplates: ");
             foreach (DataRow row in dt.Rows)
             {
                 client.SendChatText(row[0] + " " + row[1]);
             }
         }
     }
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:37,代码来源:ShopSpawn.cs

示例12: ExecuteCommand

        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            List<Type> check = new List<Type>();
            check.Add(typeof(float));
            check.Add(typeof(float));
            check.Add(typeof(int));

            AOCoord coord = new AOCoord();
            int pf = client.Character.PlayField;
            if (CheckArgumentHelper(check, args))
            {
                coord = new AOCoord(
                    float.Parse(args[1], NumberStyles.Any, CultureInfo.InvariantCulture),
                    client.Character.Coordinates.y,
                    float.Parse(args[2], NumberStyles.Any, CultureInfo.InvariantCulture));
                pf = int.Parse(args[3]);
            }

            check.Clear();
            check.Add(typeof(float));
            check.Add(typeof(float));
            check.Add(typeof(string));
            check.Add(typeof(float));
            check.Add(typeof(int));

            if (CheckArgumentHelper(check, args))
            {
                coord = new AOCoord(
                    float.Parse(args[1], NumberStyles.Any, CultureInfo.InvariantCulture),
                    float.Parse(args[4], NumberStyles.Any, CultureInfo.InvariantCulture),
                    float.Parse(args[2], NumberStyles.Any, CultureInfo.InvariantCulture));
                pf = int.Parse(args[5]);
            }

            if (!Playfields.ValidPlayfield(pf))
            {
                client.SendFeedback(110, 188845972);
                return;
            }

            Client mClient = null;
            if ((mClient = FindClient.FindClientById(target.Instance)) == null)
            {
                client.SendChatText("Target not found");
                return;
            }

            mClient.Teleport(coord, mClient.Character.Heading, pf);
        }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:49,代码来源:TeleportDynel.cs

示例13: ExecuteCommand

        public override void ExecuteCommand(Client client, Identity target, string[] args)
        {
            client.SendChatText("Equipment page:");
            List<AOMeshs> meshs = client.Character.MeshLayer.GetMeshs();
            foreach (AOMeshs am in meshs)
            {
                int ov = am.OverrideTexture;
                int me = am.Mesh;
                int position = am.Position;
                int layer = am.Layer;
                client.SendChatText(position + ":" + me + ":" + ov + ":" + layer);
            }

            client.SendChatText("");
            client.SendChatText("Social page:");
            meshs = client.Character.SocialMeshLayer.GetMeshs();
            foreach (AOMeshs am in meshs)
            {
                int ov = am.OverrideTexture;
                int me = am.Mesh;
                int position = am.Position;
                int layer = am.Layer;
                client.SendChatText(position + ":" + me + ":" + ov + ":" + layer);
            }

            client.SendChatText("Actual Output:");
            bool socialonly = ((client.Character.Stats.VisualFlags.Value & 0x40) > 0);
            bool showsocial = ((client.Character.Stats.VisualFlags.Value & 0x20) > 0);

            meshs = MeshLayers.GetMeshs(client.Character, showsocial, socialonly);
            foreach (AOMeshs am in meshs)
            {
                int ov = am.OverrideTexture;
                int me = am.Mesh;
                int position = am.Position;
                int layer = am.Layer;
                client.SendChatText(position + ":" + me + ":" + ov + ":" + layer);
            }
        }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:39,代码来源:DebugMeshs.cs

示例14: CommandHelp

 public override void CommandHelp(Client client)
 {
     client.SendChatText("Usage: /command summon &lt;name&gt;");
     return;
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:5,代码来源:Summon.cs

示例15: ExecuteCommand

 public override void ExecuteCommand(Client client, Identity target, string[] args)
 {
     Client targetClient = null;
     if ((targetClient = FindClient.FindClientByName(args[1])) != null)
     {
         int firstfree = 64;
         firstfree = targetClient.Character.GetNextFreeInventory(104);
         if (firstfree <= 93)
         {
             InventoryEntries mi = new InventoryEntries();
             AOItem it = ItemHandler.GetItemTemplate(Convert.ToInt32(args[2]));
             mi.Placement = firstfree;
             mi.Container = 104;
             mi.Item.LowID = Convert.ToInt32(args[2]);
             mi.Item.HighID = Convert.ToInt32(args[3]);
             mi.Item.Quality = Convert.ToInt32(args[4]);
             if (it.ItemType != 1)
             {
                 mi.Item.MultipleCount = Math.Max(1, it.getItemAttribute(212));
             }
             else
             {
                 bool found = false;
                 foreach (AOItemAttribute a in mi.Item.Stats)
                 {
                     if (a.Stat != 212)
                     {
                         continue;
                     }
                     found = true;
                     a.Value = Math.Max(1, it.getItemAttribute(212));
                     break;
                 }
                 if (!found)
                 {
                     AOItemAttribute aoi = new AOItemAttribute();
                     aoi.Stat = 212;
                     aoi.Value = Math.Max(1, it.getItemAttribute(212));
                     mi.Item.Stats.Add(aoi);
                 }
             }
             targetClient.Character.Inventory.Add(mi);
             AddTemplate.Send(targetClient, mi);
         }
         else
         {
             client.SendChatText("Your Inventory is full");
         }
     }
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:50,代码来源:GiveItem.cs


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