- add: select character now actually sends the character data to the client

- add: character data response when a character is requested from the service
This commit is contained in:
2025-01-08 03:46:08 -05:00
parent 6d35d15ac3
commit 32fe2d65a7
6 changed files with 209 additions and 53 deletions

View File

@@ -12,12 +12,15 @@ pub struct CharacterDbClient {
struct Item {
item_id: i32,
item_type: i32,
count: i32,
durability: f32,
slot: i32,
is_created: i32,
gem_option: i32,
durability: f32,
life: f32,
socket: i8,
is_appraised: i8,
grade: u32,
count: i32,
slot: i32,
}
#[derive(Debug, Deserialize, Serialize)]
@@ -25,6 +28,7 @@ struct Looks {
race: i32,
face: i32,
hair: i32,
stone: i32,
}
#[derive(Debug, Deserialize, Serialize)]
@@ -33,6 +37,7 @@ struct Position {
x: f64,
y: f64,
z: f64,
spawn_id: i32,
}
#[derive(Debug, Deserialize, Serialize)]
@@ -48,7 +53,7 @@ struct Stats {
hp: i32,
max_mp: i32,
mp: i32,
xp: u32,
xp: u64,
level: u16,
head_size: u8,
body_size: u8,
@@ -93,32 +98,41 @@ impl CharacterDbClient {
Item {
item_id: 30,
item_type: 3,
count: 1,
slot: 3,
durability: 45.0,
is_created: 0,
gem_option: 0,
durability: 45.0,
life: 100.0,
socket: 0,
grade: 0,
is_appraised: 0,
count: 1,
slot: 3,
},
Item {
item_id: 1,
item_type: 8,
count: 1,
slot: 7,
durability: 45.0,
is_created: 0,
gem_option: 0,
durability: 45.0,
life: 100.0,
socket: 0,
grade: 0,
is_appraised: 0,
count: 1,
slot: 7,
},
Item {
item_id: hatid,
item_type: 2,
count: 1,
slot: 12,
durability: 45.0,
is_created: 0,
gem_option: 0,
durability: 45.0,
life: 100.0,
socket: 0,
grade: 0,
is_appraised: 0,
count: 1,
slot: 12,
},
];
@@ -146,8 +160,8 @@ impl CharacterDbClient {
pat_cooldown_time: 0,
};
let looks = Looks {race, face, hair};
let position = Position {map_id: 20, x: 5200.00, y: 5200.00, z: 1.0};
let looks = Looks {race, face, hair, stone};
let position = Position {map_id: 20, x: 5200.00, y: 5200.00, z: 1.0, spawn_id: 1};
let request = tonic::Request::new(CreateCharacterRequest {
user_id: user_id.parse().unwrap(),