From 860102b5d17e87eb210bb3eb47a7fdbdc42cf913 Mon Sep 17 00:00:00 2001 From: RainOrigami Date: Fri, 18 Aug 2023 12:27:34 +0200 Subject: [PATCH] Adds server IP and port to OnCreatingGameServerInstance --- BattleBitAPI/Server/ServerListener.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BattleBitAPI/Server/ServerListener.cs b/BattleBitAPI/Server/ServerListener.cs index 2c1773b..909c9ac 100644 --- a/BattleBitAPI/Server/ServerListener.cs +++ b/BattleBitAPI/Server/ServerListener.cs @@ -81,7 +81,7 @@ namespace BattleBitAPI.Server /// /// GameServer: Game server that has been just created.
///
- public Func OnCreatingGameServerInstance { get; set; } + public Func OnCreatingGameServerInstance { get; set; } /// /// Fired when a new instance of player instance created. @@ -382,7 +382,7 @@ namespace BattleBitAPI.Server } var hash = ((ulong)gamePort << 32) | (ulong)ip.ToUInt(); - server = this.mInstanceDatabase.GetServerInstance(hash, out resources, this.OnCreatingGameServerInstance); + server = this.mInstanceDatabase.GetServerInstance(hash, ip, gamePort, out resources, this.OnCreatingGameServerInstance); resources.Set( this.mExecutePackage, this.mGetPlayerInternals, @@ -1281,7 +1281,7 @@ namespace BattleBitAPI.Server this.mPlayerInstances = new Dictionary.Internal)>(1024 * 16); } - public TGameServer GetServerInstance(ulong hash, out GameServer.Internal @internal, Func createFunc) + public TGameServer GetServerInstance(ulong hash, IPAddress serverIp, int serverPort, out GameServer.Internal @internal, Func createFunc) { lock (mGameServerInstances) { @@ -1295,7 +1295,7 @@ namespace BattleBitAPI.Server GameServer server; if (createFunc != null) - server = createFunc(); + server = createFunc(serverIp, serverPort); else server = Activator.CreateInstance>();