From 025dee4203019db798c4a4075cdee812ac623781 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 13 Jan 2020 20:59:29 -0400 Subject: [PATCH 1/2] add guildcard values and some additional accounts for testing --- src/main.rs | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 373b5cc..8e0396e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ fn main() { id: 1, username: "hi".to_string(), password: bcrypt::hash("qwer", 5).unwrap(), - guildcard: None, + guildcard: Some(1u32), team_id: None, banned: false, muted_until: SystemTime::now(), @@ -82,6 +82,69 @@ fn main() { character.character.name = utf8_to_utf16_array!("Test Char 2", 0x10); entity_gateway.set_character(&character); + let fake_user2 = UserAccount { + id: 2, + username: "hi2".to_string(), + password: bcrypt::hash("qwer", 5).unwrap(), + guildcard: Some(2u32), + team_id: None, + banned: false, + muted_until: SystemTime::now(), + created_at: SystemTime::now(), + flags: 0, + }; + entity_gateway.set_user(&fake_user2); + entity_gateway.create_user_settings_by_user(&fake_user2); + let mut character = entity_gateway.new_character_by_user(&fake_user2); + character.character.name = utf8_to_utf16_array!("Test Char 3", 0x10); + entity_gateway.set_character(&character); + let mut character = entity_gateway.new_character_by_user(&fake_user2); + character.slot = 2; + character.character.name = utf8_to_utf16_array!("Test Char 4", 0x10); + entity_gateway.set_character(&character); + + let fake_user3 = UserAccount { + id: 3, + username: "hi3".to_string(), + password: bcrypt::hash("qwer", 5).unwrap(), + guildcard: Some(3u32), + team_id: None, + banned: false, + muted_until: SystemTime::now(), + created_at: SystemTime::now(), + flags: 0, + }; + entity_gateway.set_user(&fake_user3); + entity_gateway.create_user_settings_by_user(&fake_user3); + let mut character = entity_gateway.new_character_by_user(&fake_user3); + character.character.name = utf8_to_utf16_array!("Test Char 5", 0x10); + entity_gateway.set_character(&character); + let mut character = entity_gateway.new_character_by_user(&fake_user3); + character.slot = 2; + character.character.name = utf8_to_utf16_array!("Test Char 6", 0x10); + entity_gateway.set_character(&character); + + let fake_user4 = UserAccount { + id: 4, + username: "hi4".to_string(), + password: bcrypt::hash("qwer", 5).unwrap(), + guildcard: Some(4u32), + team_id: None, + banned: false, + muted_until: SystemTime::now(), + created_at: SystemTime::now(), + flags: 0, + }; + entity_gateway.set_user(&fake_user4); + entity_gateway.create_user_settings_by_user(&fake_user4); + let mut character = entity_gateway.new_character_by_user(&fake_user4); + character.character.name = utf8_to_utf16_array!("Test Char 7", 0x10); + entity_gateway.set_character(&character); + let mut character = entity_gateway.new_character_by_user(&fake_user4); + character.slot = 2; + character.character.name = utf8_to_utf16_array!("Test Char 8", 0x10); + entity_gateway.set_character(&character); + let patch_thread = thread::spawn(|| { info!("[patch] starting server"); let patch_config = load_config(); From 4a21adae36d4f7083e86a564afac075fdabc1040 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 13 Jan 2020 21:42:05 -0400 Subject: [PATCH 2/2] fixed Some() --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8e0396e..00535f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ fn main() { id: 1, username: "hi".to_string(), password: bcrypt::hash("qwer", 5).unwrap(), - guildcard: Some(1u32), + guildcard: Some(1), team_id: None, banned: false, muted_until: SystemTime::now(), @@ -86,7 +86,7 @@ fn main() { id: 2, username: "hi2".to_string(), password: bcrypt::hash("qwer", 5).unwrap(), - guildcard: Some(2u32), + guildcard: Some(2), team_id: None, banned: false, muted_until: SystemTime::now(), @@ -107,7 +107,7 @@ fn main() { id: 3, username: "hi3".to_string(), password: bcrypt::hash("qwer", 5).unwrap(), - guildcard: Some(3u32), + guildcard: Some(3), team_id: None, banned: false, muted_until: SystemTime::now(), @@ -128,7 +128,7 @@ fn main() { id: 4, username: "hi4".to_string(), password: bcrypt::hash("qwer", 5).unwrap(), - guildcard: Some(4u32), + guildcard: Some(4), team_id: None, banned: false, muted_until: SystemTime::now(),