From 6a186635b52ea000cc19f2bb2d20516734c198f3 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:39:25 +0200 Subject: [PATCH] fix connect logs --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 1 + ReallifeGamemode.Server/Events/Connect.cs | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index f210b420..6d8e1438 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -280,6 +280,7 @@ namespace ReallifeGamemode.Server.Commands player.SetData("toglc", true); player.SendNotification("~g~[Info]~w~ Leaderchat wird nun angezeigt."); } + break; case "connect": if (player.HasData("togconnect")) { diff --git a/ReallifeGamemode.Server/Events/Connect.cs b/ReallifeGamemode.Server/Events/Connect.cs index bfb5dd3e..7852a425 100644 --- a/ReallifeGamemode.Server/Events/Connect.cs +++ b/ReallifeGamemode.Server/Events/Connect.cs @@ -80,11 +80,16 @@ namespace ReallifeGamemode.Server.Events bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo; player.TriggerEvent("SERVER:Login_ShowBrowser", registered, disableLightMode); - string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")"; - if(player.HasData("togconnect")) - { - ChatService.SendMessage(player, msg); - } + string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "]"; + string ipMsg = " (" + player.Address + ")"; + ChatService.BroadcastAdmin(msg, AdminLevel.SUPPORTER, getAddInfoMessage: admin => + { + return admin.HasData("togip") ? ipMsg : string.Empty; + }, + shouldSendMessage: admin => + { + return admin.HasData("togconnect"); + }); } private bool IsPlayerBanned(Player player)