private bool SendAuthentication(string username, string password) { this.SendUINotice("Sending authentication information."); Message message = new Message(); message.type = Message.Type.UserToServer; message.creator_plugin_hash = this._hash_code; message.destination_plugin_hash = this._user_manager_hash; Command contents = new Command(); contents.ctype = "login"; contents.type = MessageContent.Type.Command; contents.AddContent("username", username); contents.AddContent("password", password); message.content = contents; this._controller.connection.Write(message.DumpMessage()); return true; }
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."); }
private void RequestKey(string username) { Message message = new Message(); message.type = Message.Type.UserToServerPlugin; message.creator_plugin_hash = this._hash_code; message.destination_plugin_hash = this._server_cryptor_hash; Command content = new Command(); content.ctype = "publickey"; content.AddContent("username", username); message.content = content; this._controller.connection.Write(message); Logger.log("Sent request for "+username+"'s publickey.", Logger.Verbosity.moderate); }