Fix ability to DM every user

This commit is contained in:
Bluzume 2021-11-06 22:01:21 -04:00
parent 947a23f613
commit 1cb158f7b0
2 changed files with 13 additions and 1 deletions

View file

@ -439,15 +439,23 @@ namespace HISP.Game.Chat
if(channel == ChatChannel.Dm)
{
if (to != null)
if (to != null && to != "")
{
List<GameClient> recipiants = new List<GameClient>();
foreach (GameClient client in GameClient.ConnectedClients)
{
if (client.LoggedIn)
{
if (!client.LoggedinUser.MutePrivateMessage && !client.LoggedinUser.MuteAll)
{
if (client.LoggedinUser.Username.ToLower().StartsWith(to.ToLower()))
{
recipiants.Add(client);
break;
}
}
}
}
return recipiants.ToArray();
}

View file

@ -7553,11 +7553,13 @@ namespace HISP.Server
List<User> usersNearby = new List<User>();
foreach (GameClient client in GameClient.ConnectedClients)
{
if (client.LoggedIn)
{
if (startX <= client.LoggedinUser.X && endX >= client.LoggedinUser.X && startY <= client.LoggedinUser.Y && endY >= client.LoggedinUser.Y)
usersNearby.Add(client.LoggedinUser);
}
}
return usersNearby.ToArray();
}
@ -7602,6 +7604,7 @@ namespace HISP.Server
List<User> usersNearby = new List<User>();
foreach (GameClient client in GameClient.ConnectedClients)
{
if (client.LoggedIn)
{
if (!includeStealth && client.LoggedinUser.Stealth)
@ -7611,6 +7614,7 @@ namespace HISP.Server
if (startX <= client.LoggedinUser.X && endX >= client.LoggedinUser.X && startY <= client.LoggedinUser.Y && endY >= client.LoggedinUser.Y)
usersNearby.Add(client.LoggedinUser);
}
}
return usersNearby.ToArray();
}