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


C# ClientMessage.Get方法代码示例

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


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

示例1: process

 public override void process(ClientMessage message, Transceiver connection)
 {
     if(message.type == "newUser")
     {
         this.RequestKey(message.Get("username"));
     }
 }
开发者ID:spox,项目名称:irisim,代码行数:7,代码来源:Cryptor.cs

示例2: process

 public override void process(ClientMessage message, Transceiver connection)
 {
     if(message.type == "userRequest")
     {
         if(this._user_cache.ContainsKey(message.Get("username")))
         {
             this.StartChat(message.Get("username"), (string)this._user_cache[message.Get("username")]);
         }
         else
         {
             this.SendRequest(message.Get("username"), connection);
         }
     }
     else if(message.type == "userMessage")
     {
         this.SendUserMessage(message, connection);
     }
 }
开发者ID:spox,项目名称:irisim,代码行数:18,代码来源:Messenger.cs

示例3: SendUserMessage

 private void SendUserMessage(ClientMessage cmessage, Transceiver connection)
 {
     Message message = new Message();
     message.type = Message.Type.UserToUser;
     message.destination_plugin_hash = cmessage.Get("destination");
     Chat content = new Chat();
     content.AddContent("message", cmessage.Get("message"));
     content.AddContent("time", cmessage.Get("time"));
     message.content = content;
     connection.Write(message);
     Logger.log("Messenger: Chat message sent.", Logger.Verbosity.moderate);
 }
开发者ID:spox,项目名称:irisim,代码行数:12,代码来源:Messenger.cs

示例4: process

 public override void process(ClientMessage message, Transceiver connection)
 {
     Logger.log("Processing connection message.", Logger.Verbosity.moderate);
     if(message.type == "connect")
     {
         string server = message.Get("server");
         string port_s = message.Get("port");
         this._username = message.Get("username");
         this._password = message.Get("password");
         int port = Convert.ToInt32(port_s);
         Logger.log("Making connection.", Logger.Verbosity.moderate);
         if(this.EstablishConnection(server, port))
         {
             Message notice = new Message();
             notice.type = Message.Type.Loop;
             notice.creator_plugin_hash = this._hash_code;
             notice.origin = connection;
             Event connected = new Event();
             connected.etype = "connection";
             connected.AddContent("status", "connected");
             connected.type = BasicContent.Type.Event;
             notice.content = connected;
             this._controller.message_pump.process_message(notice);
             this.SendUINotice("Connected");
             Logger.log("Client now connected to server.", Logger.Verbosity.moderate);
             this.SendPluginListing(connection);
             Logger.log("Connection steps are now complete.", Logger.Verbosity.moderate);
         }
         else
         {
             this.SendUINotice("Failed");
             Logger.log("Failed to establish connection to server.", Logger.Verbosity.moderate);
         }
     }
 }
开发者ID:spox,项目名称:irisim,代码行数:35,代码来源:Connector.cs


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