本文整理汇总了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);
}
示例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.");
}
示例3: send_plugin_list
private void send_plugin_list(Transceiver origin, PluginManager manager)
{
origin.Write(this.create_plugin_list(manager));
}
示例4: SendPluginListing
private void SendPluginListing(Transceiver connection)
{
connection.Write(this.create_plugin_list(this._controller.plugins));
}
示例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);
}
示例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);
}