• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ChatType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ChatType的典型用法代码示例。如果您正苦于以下问题:C# ChatType类的具体用法?C# ChatType怎么用?C# ChatType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ChatType类属于命名空间,在下文中一共展示了ChatType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SpChat

 public SpChat(string message, int sessionId, string characterName, ChatType chatType)
 {
     _message = message;
     _sessionId = sessionId;
     _characterName = characterName;
     _chatType = chatType;
 }
开发者ID:Everlight,项目名称:DesertProject,代码行数:7,代码来源:SpChat.cs


示例2: OnSay3

        public override EventEat OnSay3(Entity player, ChatType type, string name, ref string message)
        {
            string[] splitmsg = message.ToLower().Split(' ');

            foreach (string word in splitmsg)
            {
                if (BadWordsList.Contains(word))
                {
                    if (!player.HasField("warnsbadwords")) player.SetField("warnsbadwords", new Parameter(0));
                    if (player.GetField<int>("warnsbadwords") >= 2)
                    {
                        Utilities.RawSayAll("^1BAD^2WORDS^3: " + player.Name + " got kicked for ^1Bad^2words");
                        Utilities.ExecuteCommand("dropclient " + player.EntRef + " \"" + "^3Bad ^2words ^1DETECTED" + "\"");
                        return EventEat.EatGame;
                    }
                    else
                    {
                        Utilities.RawSayTo(player, "Don't use any ^1offensive ^2language");
                        player.SetField("warnsbadwords",player.GetField<int>("warnsbadwords") + 1);
                        return EventEat.EatGame;
                    }
                }
            }
            return EventEat.EatNone;
        }
开发者ID:Boboo99,项目名称:Infinity-Script,代码行数:25,代码来源:BadWords.cs


示例3: ConsoleMessage

 /// <summary>
 /// Creates a ConsoleMessage from a native instance's attributes
 /// </summary>
 internal ConsoleMessage(IntPtr pointer)
     : base(pointer)
 {
     Color   = new Color(pointer);
     Type    = (ChatType)       Functions.vp_int(pointer, IntAttributes.ChatType);
     Effect  = (ChatEffect) Functions.vp_int(pointer, IntAttributes.ChatType);
 }
开发者ID:edwinr,项目名称:VPNet,代码行数:10,代码来源:Chat.cs


示例4: SpChatMessage

 public SpChatMessage(Player player, string message, ChatType type, bool sysmsg = false)
 {
     Player = player;
     Message = message;
     Type = type;
     IsSystemMessage = sysmsg;
 }
开发者ID:mMellowz,项目名称:revcore,代码行数:7,代码来源:SpChatMessage.cs


示例5: ChatMessage

 public ChatMessage(Character sender, ChatType type, int dest, string message)
 {
     this.Sender = sender;
     this.Type = type;
     this.Destination = dest;
     this.Message = message;
 }
开发者ID:KtBkkr,项目名称:Asteria,代码行数:7,代码来源:ChatProcessor.cs


示例6: SendMessage

        public void SendMessage(ChatType type, string message)
        {
            if (type == ChatType.Private)
                return;

            SendMessage(type, new Character(), message);
        }
开发者ID:neo1106,项目名称:l2script,代码行数:7,代码来源:Commands.cs


示例7: ChatModel

 protected ChatModel(string id, string name, ChatType chatType, IProtocolManager networkManager)
 {
     _ID = id;
     _Name = name;
     _ChatType = chatType;
     _ProtocolManager = networkManager;
 }
开发者ID:RoninBG,项目名称:smuxi,代码行数:7,代码来源:ChatModel.cs


示例8: ChatOut

        public void ChatOut(string chat, ChatType type, int channel)
        {
            if (!loggedIn) return;

            client.Self.Chat(chat, channel, type);
            OnChatSent(new ChatSentEventArgs(chat, type, channel));
        }
开发者ID:SObS,项目名称:SLeek,代码行数:7,代码来源:SLNetCom.cs


示例9: Read

 public override void Read()
 {
     Type = (ChatType)ReadC();
     RecvName = ReadSN();
     ReadB(7);
     Message = ReadS();
 }
开发者ID:mMellowz,项目名称:revcore,代码行数:7,代码来源:RpChatMessage.cs


示例10: BaseChat

 public BaseChat(ChatType chatType, string message)
 {
     packet.Type(1006);
     packet.WriteShort((short)chatType);
     packet.WriteString(message);
     packet.WriteByte(0);
 }
开发者ID:TonGIZa,项目名称:Digital-World,代码行数:7,代码来源:Chat.cs


示例11: frmSpelling

        public frmSpelling(METAboltInstance instance, string sentence, string[] swords, ChatType type)
        {
            InitializeComponent();

            this.instance = instance;

            afffile = this.instance.AffFile;   // "en_GB.aff";
            dicfile = this.instance.DictionaryFile;   // "en_GB.dic";

            string[] idic = dicfile.Split('.');
            dic = dir + idic[0];

            if (!System.IO.File.Exists(dic + ".csv"))
            {
                System.IO.File.Create(dic + ".csv");
            }

            try
            {
                hunspell.Load(dir + afffile, dir + dicfile);   //("en_us.aff", "en_us.dic");
                ReadWords();
            }
            catch
            {
                //string exp = ex.Message;
            }

            //words = sentence;
            richTextBox1.Text = sentence;
            this.swords = swords;
            this.ctype = type;

            ischat = true;
        }
开发者ID:NullProjects,项目名称:METAbolt,代码行数:34,代码来源:frmSpelling.cs


示例12: ChatPacket

 /// <summary>
 /// Initializes a new instance of the ChatPacket class.
 /// This overload should be used by the server because
 /// the client needs to know who sent the message.
 /// </summary>
 /// <param name="chat">The text of the chat message.</param>
 /// <param name="sender">The player who sent the chat message.</param>
 /// <param name="chatType">The type of chat.</param>
 public ChatPacket(string chat, string sender, ChatType chatType)
     : base()
 {
     this.Chat = chat;
     this.Sender = sender;
     this.ChatType = chatType;
 }
开发者ID:jakepetroules,项目名称:jakes-3d-mmo,代码行数:15,代码来源:ChatPacket.cs


示例13: Compose

        public static ServerMessage Compose(uint ActorId, string MessageText, int EmotionId, ChatType ChatType)
        {
            StringBuilder TextBuilder = new StringBuilder();
            Dictionary<int, string> LinkRefs = new Dictionary<int, string>();
            string[] Bits = MessageText.Split(' ');

            int i = 0;
            int j = 0;

            foreach (string Bit in Bits)
            {
                if (j > 0)
                {
                    TextBuilder.Append(' ');
                }

                if (Bit.StartsWith("http://"))
                {
                    LinkRefs.Add(i, Bit);
                    TextBuilder.Append("{" + i++ + "}");
                }
                else if (Bit.StartsWith("www."))
                {
                    LinkRefs.Add(i, Bit);
                    TextBuilder.Append("{" + i++ + "}");
                }
                else
                {
                    TextBuilder.Append(Bit);
                }

                j++;
            }

            ServerMessage Message = new ServerMessage(ChatType == ChatType.Say ? OpcodesOut.ROOM_CHAT_SAY : (ChatType ==
                ChatType.Whisper ? OpcodesOut.ROOM_CHAT_WHISPER : OpcodesOut.ROOM_CHAT_SHOUT));
            Message.AppendUInt32(ActorId);
            Message.AppendStringWithBreak(TextBuilder.ToString());
            Message.AppendInt32(EmotionId);
            Message.AppendInt32(LinkRefs.Count);

            foreach (KeyValuePair<int, string> LinkedRef in LinkRefs)
            {
                string Url = LinkedRef.Value;

                if (!Url.StartsWith("http://"))
                {
                    Url = "http://" + Url;
                }

                Message.AppendStringWithBreak("/link_to.php?url=" + HttpUtility.UrlEncode(Url) + "&hash=xx");
                Message.AppendStringWithBreak(LinkedRef.Value);
                Message.AppendBoolean(false); // Trusted URL (instaopen)
            }

            Message.AppendInt32(0); // No idea
            Message.AppendBoolean(true);
            return Message;
        }
开发者ID:fuding,项目名称:Snowlight,代码行数:59,代码来源:RoomChatComposer.cs


示例14: Self_OnChat

 static void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type, ChatSourceType sourceType, string fromName, UUID id, UUID ownerid, Vector3 position)
 {
     if (fromName != _Client.Self.Name &&  type == ChatType.Normal && audible == ChatAudibleLevel.Fully)
     {
         string str = "<" + fromName + "> " + message;
         _IRC.SendMessage(_AutoJoinChannel, str);
         Console.WriteLine("[SL->IRC] " + str);
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:Program.cs


示例15: ChatViewAddedEventArgs

 public ChatViewAddedEventArgs(ChatModel chatModel, string chatId,
                               ChatType chatType, int chatPosition,
                               Type protocolManagerType)
 {
     ChatModel = chatModel;
     ChatID = chatId;
     ChatType = chatType;
     ChatPosition = chatPosition;
     ProtocolManagerType = protocolManagerType;
 }
开发者ID:grendello,项目名称:smuxi,代码行数:10,代码来源:ChatViewSyncManager.cs


示例16: ChatEventArgs

 public ChatEventArgs(string message, ChatAudibleLevel audible, ChatType type, ChatSourceType sourceType, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
 {
     this.message = message;
     this.audible = audible;
     this.type = type;
     this.sourceType = sourceType;
     this.fromName = fromName;
     this.id = id;
     this.ownerid = ownerid;
     this.position = position;
 }
开发者ID:SObS,项目名称:SLeek,代码行数:11,代码来源:ChatEventArgs.cs


示例17: ChatToDebug

        public void ChatToDebug(ChatType type, Character sender, string message, GameReader packet, GameData gameData, ExtensionHandler extensions)
        {
            if (type == ChatType.Announcement)
                sender.Name = "";
            Debug.Information(type.ToString() + ":" + sender.Name + ": " + message);

            if (type == ChatType.Private && sender.Name == "Reporter")
            {
                gameData.commands.SendMessage(ChatType.Private, sender, "ECHO: " + message);
            }
        }
开发者ID:neo1106,项目名称:l2script,代码行数:11,代码来源:R4000.cs


示例18: CreateChatMessage

        public static void CreateChatMessage(ChatType type, string message, ServerToClientMessage wm)
        {
            if (wm.Sender == null)
                throw (new Exception("wm.Sender can't be NULL on outgoing messages."));

            wm.MessageType = MessageType.S2C_ChatMessage;
            wm.Code = (int)type;
            wm.DeliveryMethod = NetDeliveryMethod.ReliableOrdered;
            wm.DeliveryChannel = 0;
            wm.Data = message;
        }
开发者ID:KtBkkr,项目名称:Asteria,代码行数:11,代码来源:MessageFormatter.cs


示例19: ChatModel

 protected ChatModel(string id, string name, ChatType chatType, IProtocolManager networkManager)
 {
     _ID = id;
     _Name = name;
     _ChatType = chatType;
     _ProtocolManager = networkManager;
     Position = -1;
     if (ProtocolManager == null) {
         InitMessageBuffer(MessageBufferPersistencyType.Volatile);
     }
 }
开发者ID:grendello,项目名称:smuxi,代码行数:11,代码来源:ChatModel.cs


示例20: GetChats

 public List<Message> GetChats(ChatType chatType)
 {
     try
     {
         return messages.Where(x => x.ChatType == chatType).ToList();
     }
     catch (Exception errormessage)
     {
         File.AppendAllText(path, "Message: " + errormessage.Message + "InnerException: " + errormessage.InnerException + "Date and Time: " + DateTime.Now);
         throw new FaultException("Error while trying to retrieve messages");
     }
 }
开发者ID:bazizten,项目名称:WCF_Chat,代码行数:12,代码来源:ChatService.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ChatTypeEnum类代码示例发布时间:2022-05-24
下一篇:
C# ChatSourceType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap