新增了config.json实现
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// 一些杂七杂八的小东西可以放在这
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use rand::distributions::Alphanumeric;
|
||||
use rand::Rng;
|
||||
use crate::USERNAME_PREFIX;
|
||||
use crate::configuration::Configuration;
|
||||
|
||||
// 处理json组件(有些TextComponent里面一堆extra看的我头皮发麻,所以整个这个)
|
||||
pub fn parse_json_component(json: &str) -> String {
|
||||
@@ -53,6 +55,6 @@ fn generate_string() -> String {
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn generate_username() -> String {
|
||||
USERNAME_PREFIX.to_string() + &*generate_string().to_string()
|
||||
pub fn generate_username(config: &Arc<Configuration>) -> String {
|
||||
config.username_prefix().to_string() + generate_string().to_string().as_str()
|
||||
}
|
||||
Reference in New Issue
Block a user