1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

small tweak for preconnect events

This commit is contained in:
RaidMax
2020-04-26 12:32:41 -05:00
parent 1f7f40f296
commit 6c52e4346b
2 changed files with 9 additions and 2 deletions

View File

@ -312,6 +312,7 @@ namespace IW4MAdmin
// this happens for some reason rarely where the client spots get out of order
// possible a connect/reconnect game event before we get to process it here
// it appears that new games decide to switch client slots between maps (even if the clients aren't disconnecting)
else if (existingClient != null && existingClient.ClientNumber != E.Origin.ClientNumber)
{
Logger.WriteWarning($"client {E.Origin} is trying to connect in client slot {E.Origin.ClientNumber}, but they are already registed in client slot {existingClient.ClientNumber}, swapping...");
@ -764,6 +765,7 @@ namespace IW4MAdmin
foreach (var disconnectingClient in polledClients[1])
{
disconnectingClient.CurrentServer = this;
var e = new GameEvent()
{
Type = GameEvent.EventType.PreDisconnect,
@ -784,6 +786,7 @@ namespace IW4MAdmin
continue;
}
client.CurrentServer = this;
var e = new GameEvent()
{
Type = GameEvent.EventType.PreConnect,
@ -799,6 +802,7 @@ namespace IW4MAdmin
// these are the clients that have updated
foreach (var client in polledClients[2])
{
client.CurrentServer = this;
var e = new GameEvent()
{
Type = GameEvent.EventType.Update,