Include next mora in greeting event
This commit is contained in:
parent
53fb1f3c4e
commit
f157c847bb
2 changed files with 14 additions and 5 deletions
|
@ -26,6 +26,7 @@ impl MessageResponse {
|
|||
enum MessageResponseData {
|
||||
Greeting {
|
||||
id: u64,
|
||||
next_mora: Option<String>,
|
||||
},
|
||||
Word {
|
||||
author: u64,
|
||||
|
@ -165,7 +166,8 @@ impl Server {
|
|||
fn handle_connection(&mut self, client_id: u64, responder: Responder) -> Result<(), ServerError> {
|
||||
println!("A client connected with id #{}", client_id);
|
||||
responder.send(MessageResponseData::Greeting {
|
||||
id: client_id
|
||||
id: client_id,
|
||||
next_mora: self.next_mora.clone(),
|
||||
}.into_message());
|
||||
responder.send(MessageResponseData::History {
|
||||
words: self.database.load_words_before(self.database.last_word_id + 1)?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue