11use feather_core:: prelude:: * ;
2+ use serde:: Deserializer ;
3+ use serde:: Serializer ;
4+ use serde:: { Deserialize , Serialize } ;
25use std:: fs:: read_to_string;
3- use serde:: { Serialize , Deserialize } ;
46
5- #[ derive( Serialize , Deserialize , Debug ) ]
7+ #[ derive( Deserialize , Debug ) ]
68pub struct Config {
79 pub io : IO ,
810 pub proxy : Proxy ,
@@ -11,45 +13,40 @@ pub struct Config {
1113 pub log : Log ,
1214}
1315
14- #[ derive( Serialize , Deserialize , Debug ) ]
16+ #[ derive( Deserialize , Debug ) ]
1517pub struct IO {
1618 pub compression_threshold : i32 ,
1719 pub io_worker_threads : u16 ,
1820}
1921
20- #[ derive( Serialize , Deserialize , Debug ) ]
21- pub struct Proxy {
22- pub proxy_mode : ProxyMode ,
23- }
22+ #[ derive( Deserialize , Debug ) ]
23+ pub struct Proxy { }
2424
25- #[ derive( Serialize , Deserialize , Debug ) ]
25+ #[ derive( Deserialize , Debug ) ]
2626pub struct Server {
2727 pub online_mode : bool ,
2828 pub motd : String ,
2929 pub max_players : i32 ,
30- pub default_gamemode : Gamemode ,
31- pub difficulty : Difficulty ,
3230 pub view_distance : u8 ,
3331 pub address : String ,
3432 pub port : u16 ,
3533}
3634
37- #[ derive( Serialize , Deserialize , Debug ) ]
35+ #[ derive( Deserialize , Debug ) ]
3836pub struct Gameplay {
3937 pub monster_spawning : bool ,
4038 pub animal_spawning : bool ,
4139 pub pvp : bool ,
4240 pub nerf_spawner_mobs : bool ,
43- pub pvp_style : PvpStyle ,
4441}
4542
46- #[ derive( Serialize , Deserialize , Debug ) ]
43+ #[ derive( Deserialize , Debug ) ]
4744pub struct Log {
48- pub log_level : String ,
45+ pub level : String ,
4946}
5047
5148pub fn load ( ) -> Result < Config , ( ) > {
52- let config_content = read_to_string ( "config .toml" ) . expect ( "Could not load configuration file" ) ;
49+ let config_content = read_to_string ( "feather .toml" ) . expect ( "Could not load configuration file" ) ;
5350
5451 let config: Config = toml:: from_str ( & config_content) . expect ( "Invalid configuration file" ) ;
5552
0 commit comments