@ -229,8 +229,7 @@ async fn create_character(conn: &mut sqlx::PgConnection, char: NewCharacterEntit
hair , hair_r , hair_g , hair_b , prop_x ,
hair , hair_r , hair_g , hair_b , prop_x ,
prop_y , techs , config , infoboard , guildcard ,
prop_y , techs , config , infoboard , guildcard ,
power , mind , def , evade , luck ,
power , mind , def , evade , luck ,
hp , tp , tech_menu , option_flags , keyboard_config ,
gamepad_config , playtime )
hp , tp , tech_menu , option_flags , playtime )
values
values
( $ 1 , $ 2 , $ 3 , $ 4 , $ 5 ,
( $ 1 , $ 2 , $ 3 , $ 4 , $ 5 ,
$ 6 , $ 7 , $ 8 , $ 9 , $ 10 ,
$ 6 , $ 7 , $ 8 , $ 9 , $ 10 ,
@ -270,8 +269,6 @@ async fn create_character(conn: &mut sqlx::PgConnection, char: NewCharacterEntit
. bind ( char . materials . tp as i16 )
. bind ( char . materials . tp as i16 )
. bind ( char . tech_menu . tech_menu . to_vec ( ) )
. bind ( char . tech_menu . tech_menu . to_vec ( ) )
. bind ( char . option_flags as i32 )
. bind ( char . option_flags as i32 )
. bind ( & char . keyboard_config . keyboard_config . to_vec ( ) )
. bind ( & char . gamepad_config . gamepad_config . to_vec ( ) )
. bind ( 0 )
. bind ( 0 )
. fetch_one ( conn ) . await ? ;
. fetch_one ( conn ) . await ? ;
@ -298,8 +295,8 @@ async fn save_character(conn: &mut sqlx::PgConnection, char: &CharacterEntity) -
let q = r # " update player_character set
let q = r # " update player_character set
user_account = $ 1 , slot = $ 2 , name = $ 3 , exp = $ 4 , class = $ 5 , section_id = $ 6 , costume = $ 7 , skin = $ 8 , face = $ 9 , head = $ 10 , hair = $ 11 , hair_r = $ 12 ,
user_account = $ 1 , slot = $ 2 , name = $ 3 , exp = $ 4 , class = $ 5 , section_id = $ 6 , costume = $ 7 , skin = $ 8 , face = $ 9 , head = $ 10 , hair = $ 11 , hair_r = $ 12 ,
hair_g = $ 13 , hair_b = $ 14 , prop_x = $ 15 , prop_y = $ 16 , techs = $ 17 , config = $ 18 , infoboard = $ 19 , guildcard = $ 20 , power = $ 21 , mind = $ 22 , def = $ 23 ,
hair_g = $ 13 , hair_b = $ 14 , prop_x = $ 15 , prop_y = $ 16 , techs = $ 17 , config = $ 18 , infoboard = $ 19 , guildcard = $ 20 , power = $ 21 , mind = $ 22 , def = $ 23 ,
evade = $ 24 , luck = $ 25 , hp = $ 26 , tp = $ 27 , tech_menu = $ 28 , option_flags = $ 29 , keyboard_config = $ 30 , gamepad_config = $ 31 , playtime = $ 32
where id = $ 33 ; " # ;
evade = $ 24 , luck = $ 25 , hp = $ 26 , tp = $ 27 , tech_menu = $ 28 , option_flags = $ 29 , playtime = $ 30
where id = $ 31 ; " # ;
sqlx ::query ( q )
sqlx ::query ( q )
. bind ( char . user_id . 0 ) // $1
. bind ( char . user_id . 0 ) // $1
. bind ( char . slot as i16 ) // $2
. bind ( char . slot as i16 ) // $2
@ -330,10 +327,8 @@ async fn save_character(conn: &mut sqlx::PgConnection, char: &CharacterEntity) -
. bind ( char . materials . tp as i16 ) // $27
. bind ( char . materials . tp as i16 ) // $27
. bind ( char . tech_menu . tech_menu . to_vec ( ) ) // $28
. bind ( char . tech_menu . tech_menu . to_vec ( ) ) // $28
. bind ( char . option_flags as i32 ) // $29
. bind ( char . option_flags as i32 ) // $29
. bind ( & char . keyboard_config . keyboard_config . to_vec ( ) ) // $30
. bind ( & char . gamepad_config . gamepad_config . to_vec ( ) ) // $31
. bind ( char . playtime as i32 ) // $32
. bind ( char . id . 0 as i32 ) // $33
. bind ( char . playtime as i32 ) // $30
. bind ( char . id . 0 as i32 ) // $31
. execute ( conn ) . await ? ;
. execute ( conn ) . await ? ;
Ok ( ( ) )
Ok ( ( ) )
}
}