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


C# Transceiver.Write方法代码示例

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


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

示例1: 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

示例2: SendRequest

 private void SendRequest(string username, Transceiver connection)
 {
     Message message = new Message();
     message.type = Message.Type.ServerToUserPlugin;
     message.creator_plugin_hash = this._hash_code;
     message.destination_plugin_hash = this._user_manager_hash;
     Command content = new Command();
     content.ctype = "information";
     content.AddContent("username", username);
     message.content = content;
     connection.Write(message);
     Logger.log("Messenger: Requesting information for chat.", Logger.Verbosity.moderate);
     this.SendUINotice("Requesting information.");
 }
开发者ID:spox,项目名称:irisim,代码行数:14,代码来源:Messenger.cs

示例3: send_plugin_list

 private void send_plugin_list(Transceiver origin, PluginManager manager)
 {
     origin.Write(this.create_plugin_list(manager));
 }
开发者ID:spox,项目名称:irisim,代码行数:4,代码来源:Greeter.cs

示例4: SendPluginListing

 private void SendPluginListing(Transceiver connection)
 {
     connection.Write(this.create_plugin_list(this._controller.plugins));
 }
开发者ID:spox,项目名称:irisim,代码行数:4,代码来源:Connector.cs

示例5: SendKeyInformation

 private void SendKeyInformation(Transceiver connection)
 {
     this.SendUINotice("Sending public key to server.");
     Message message = new Message();
     message.creator_plugin_hash = this._hash_code;
     message.destination_plugin_hash = this._server_cryptor_hash;
     message.type = Message.Type.UserToServerPlugin;
     Information content = new Information();
     content.type = BasicContent.Type.Information;
     content.AddContent("publickey", this._local_public_key);
     message.content = content;
     connection.Write(message);
 }
开发者ID:spox,项目名称:irisim,代码行数:13,代码来源:Cryptor.cs

示例6: SendKey

 private void SendKey(Transceiver connection, User request, string userPluginHash)
 {
     string publickey;
     string username;
     Message message = new Message();
     message.creator_plugin_hash = this._hash_code;
     message.type = Message.Type.ServerToUser;
     if(request == null)
     {
         publickey = this._server_public_key;
         username = "server";
     }
     else
     {
         publickey = (string)this._user_keys[request.connection];
         username = request.username;
     }
     Response content = new Response();
     message.content = content;
     content.type = BasicContent.Type.Response;
     content.rtype = "success";
     content.AddContent("command", "publickey");
     content.AddContent("username", username);
     content.AddContent("publickey", publickey);
     string mess = message.DumpMessage();
     connection.Write(mess);
 }
开发者ID:spox,项目名称:irisim,代码行数:27,代码来源:CryptManager.cs


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