diff --git a/.cargo/config b/.cargo/config index e4f3071f5c..51f84ab9e9 100644 --- a/.cargo/config +++ b/.cargo/config @@ -6,4 +6,5 @@ rustflags = [ [alias] generate = "run --package tools --" test-server = "run --bin veloren-server-cli --no-default-features" +server = "run --bin veloren-server-cli" diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index 11c6caabb0..f1f3f9da17 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -308,7 +308,7 @@ magischen Gegenstände ergattern?"#, "hud.settings.unbound": "-", "hud.settings.reset_keybinds": "Auf Standard zurücksetzen", - "hud.social": "Andere Spieler ", + "hud.social": "Andere Spieler", "hud.social.online": "Online", "hud.social.friends": "Freunde", "hud.social.not_yet_available": "Noch nicht verfügbar", diff --git a/client/src/lib.rs b/client/src/lib.rs index 98be27bd60..404c2a1686 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1045,6 +1045,14 @@ impl Client { "Type /g or /group to chat with your group members", ))); } + if let Some(player_info) = self.player_list.get(&uid) { + frontend_events.push(Event::Chat( + comp::ChatType::GroupMeta("Group".into()).chat_msg(format!( + "[{}] joined group", + player_info.player_alias + )), + )); + } if self.group_members.insert(uid, role) == Some(role) { warn!( "Received msg to add uid {} to the group members but they \ @@ -1054,6 +1062,14 @@ impl Client { } }, Removed(uid) => { + if let Some(player_info) = self.player_list.get(&uid) { + frontend_events.push(Event::Chat( + comp::ChatType::GroupMeta("Group".into()).chat_msg(format!( + "[{}] left group", + player_info.player_alias + )), + )); + } if self.group_members.remove(&uid).is_none() { warn!( "Received msg to remove uid {} from group members but by they \ diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 04ead5547d..6d8ed3af46 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -50,7 +50,6 @@ pub enum ChatCommand { Health, Help, JoinFaction, - //JoinGroup, Jump, Kill, KillNpcs, @@ -92,7 +91,6 @@ pub static CHAT_COMMANDS: &[ChatCommand] = &[ ChatCommand::Health, ChatCommand::Help, ChatCommand::JoinFaction, - //ChatCommand::JoinGroup, ChatCommand::Jump, ChatCommand::Kill, ChatCommand::KillNpcs, @@ -246,11 +244,6 @@ impl ChatCommand { "Join/leave the specified faction", NoAdmin, ), - //ChatCommand::JoinGroup => ChatCommandData::new( - // vec![Any("group", Optional)], - // "Join/leave the specified group", - // NoAdmin, - //), ChatCommand::Jump => cmd( vec![ Float("x", 0.0, Required), @@ -383,7 +376,6 @@ impl ChatCommand { ChatCommand::Group => "group", ChatCommand::Health => "health", ChatCommand::JoinFaction => "join_faction", - //ChatCommand::JoinGroup => "join_group", ChatCommand::Help => "help", ChatCommand::Jump => "jump", ChatCommand::Kill => "kill", diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 81a19a2a49..b580cfbd98 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -77,7 +77,6 @@ fn get_handler(cmd: &ChatCommand) -> CommandHandler { ChatCommand::Health => handle_health, ChatCommand::Help => handle_help, ChatCommand::JoinFaction => handle_join_faction, - //ChatCommand::JoinGroup => handle_join_group, ChatCommand::Jump => handle_jump, ChatCommand::Kill => handle_kill, ChatCommand::KillNpcs => handle_kill_npcs, @@ -588,7 +587,6 @@ fn handle_spawn( comp::Alignment::Npc | comp::Alignment::Tame => { Some(comp::group::NPC) }, - // TODO: handle comp::Alignment::Owned(_) => unreachable!(), } { let _ = @@ -1362,69 +1360,6 @@ fn handle_join_faction( } } -// TODO: it might be useful to copy the GroupMeta messages elsewhere -/*fn handle_join_group( - server: &mut Server, - client: EcsEntity, - target: EcsEntity, - args: String, - action: &ChatCommand, -) { - if client != target { - // This happens when [ab]using /sudo - server.notify_client( - client, - ChatType::CommandError.server_msg("It's rude to impersonate people"), - ); - return; - } - if let Some(alias) = server - .state - .ecs() - .read_storage::() - .get(target) - .map(|player| player.alias.clone()) - { - let group_leave = if let Ok(group) = scan_fmt!(&args, &action.arg_fmt(), String) { - let mode = comp::ChatMode::Group(group.clone()); - let _ = server.state.ecs().write_storage().insert(client, mode); - let group_leave = server - .state - .ecs() - .write_storage() - .insert(client, comp::ChatGroup(group.clone())) - .ok() - .flatten() - .map(|f| f.0); - server.state.send_chat( - ChatType::GroupMeta(group.clone()) - .chat_msg(format!("[{}] joined group ({})", alias, group)), - ); - group_leave - } else { - let mode = comp::ChatMode::default(); - let _ = server.state.ecs().write_storage().insert(client, mode); - server - .state - .ecs() - .write_storage() - .remove(client) - .map(|comp::ChatGroup(f)| f) - }; - if let Some(group) = group_leave { - server.state.send_chat( - ChatType::GroupMeta(group.clone()) - .chat_msg(format!("[{}] left group ({})", alias, group)), - ); - } - } else { - server.notify_client( - client, - ChatType::CommandError.server_msg("Could not find your player alias"), - ); - } -}*/ - #[cfg(not(feature = "worldgen"))] fn handle_debug_column( server: &mut Server, diff --git a/voxygen/src/hud/settings_window.rs b/voxygen/src/hud/settings_window.rs index 06c1b24e94..142b4d0984 100644 --- a/voxygen/src/hud/settings_window.rs +++ b/voxygen/src/hud/settings_window.rs @@ -1190,9 +1190,9 @@ impl<'a> Widget for SettingsWindow<'a> { .color(TEXT_COLOR) .set(state.ids.chat_char_name_text, ui); - // Show account name in chat + // TODO Show account name in chat - // Show account names in social window + // TODO Show account names in social window // Language select drop down Text::new(&self.localized_strings.get("common.languages"))