mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Use emitter.emit() in server/sys/msg/register
This commit is contained in:
parent
229e7b9cec
commit
9300353c98
@ -75,6 +75,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
mut login_provider,
|
mut login_provider,
|
||||||
): Self::SystemData,
|
): Self::SystemData,
|
||||||
) {
|
) {
|
||||||
|
let mut server_emitter = read_data.server_event_bus.emitter();
|
||||||
// Player list to send new players.
|
// Player list to send new players.
|
||||||
let player_list = (
|
let player_list = (
|
||||||
&read_data.uids,
|
&read_data.uids,
|
||||||
@ -138,9 +139,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
trace!(?r, "pending login returned");
|
trace!(?r, "pending login returned");
|
||||||
match r {
|
match r {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
read_data
|
server_emitter.emit(ServerEvent::ClientDisconnect(
|
||||||
.server_event_bus
|
|
||||||
.emit_now(ServerEvent::ClientDisconnect(
|
|
||||||
entity,
|
entity,
|
||||||
common::comp::DisconnectReason::Kicked,
|
common::comp::DisconnectReason::Kicked,
|
||||||
));
|
));
|
||||||
@ -159,9 +158,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
.find(|(_, _, old_player)| old_player.uuid() == uuid)
|
.find(|(_, _, old_player)| old_player.uuid() == uuid)
|
||||||
{
|
{
|
||||||
// Remove old client
|
// Remove old client
|
||||||
read_data
|
server_emitter.emit(ServerEvent::ClientDisconnect(
|
||||||
.server_event_bus
|
|
||||||
.emit_now(ServerEvent::ClientDisconnect(
|
|
||||||
old_entity,
|
old_entity,
|
||||||
common::comp::DisconnectReason::NewerLogin,
|
common::comp::DisconnectReason::NewerLogin,
|
||||||
));
|
));
|
||||||
|
Loading…
Reference in New Issue
Block a user