From 09256aa4a3ecdb3f30e792aef42b1351dd0a864c Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 27 Feb 2020 12:54:23 +0000 Subject: [PATCH] Rename SocketInterface to SocketManager, ConnectionInterface to ConnectionManager --- ...kingSocketsTest.TestConnectionInterface.cs | 2 +- ...tworkingSocketsTest.TestSocketInterface.cs | 2 +- .../Facepunch.Steamworks.Win64.csproj | 5 ++++ ...ctionInterface.cs => ConnectionManager.cs} | 2 +- Facepunch.Steamworks/Networking/Socket.cs | 2 +- .../{SocketInterface.cs => SocketManager.cs} | 2 +- .../SteamNetworkingSockets.cs | 24 +++++++++---------- 7 files changed, 22 insertions(+), 17 deletions(-) rename Facepunch.Steamworks/Networking/{ConnectionInterface.cs => ConnectionManager.cs} (98%) rename Facepunch.Steamworks/Networking/{SocketInterface.cs => SocketManager.cs} (99%) diff --git a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs index eeafe9b..9f6df14 100644 --- a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs +++ b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestConnectionInterface.cs @@ -8,7 +8,7 @@ namespace Steamworks { public partial class NetworkingSocketsTest { - private class TestConnectionInterface : ConnectionInterface + private class TestConnectionInterface : ConnectionManager { public override void OnConnectionChanged( ConnectionInfo data ) { diff --git a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs index b92e294..b3ef545 100644 --- a/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs +++ b/Facepunch.Steamworks.Test/NetworkingSocketsTest.TestSocketInterface.cs @@ -9,7 +9,7 @@ namespace Steamworks { public partial class NetworkingSocketsTest { - private class TestSocketInterface : SocketInterface + private class TestSocketInterface : SocketManager { public bool HasFinished = false; diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj index dd653a7..744991a 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj @@ -34,4 +34,9 @@ + + + + + diff --git a/Facepunch.Steamworks/Networking/ConnectionInterface.cs b/Facepunch.Steamworks/Networking/ConnectionManager.cs similarity index 98% rename from Facepunch.Steamworks/Networking/ConnectionInterface.cs rename to Facepunch.Steamworks/Networking/ConnectionManager.cs index 877ff88..e2f024f 100644 --- a/Facepunch.Steamworks/Networking/ConnectionInterface.cs +++ b/Facepunch.Steamworks/Networking/ConnectionManager.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; namespace Steamworks { - public class ConnectionInterface + public class ConnectionManager { public Connection Connection; public bool Connected = false; diff --git a/Facepunch.Steamworks/Networking/Socket.cs b/Facepunch.Steamworks/Networking/Socket.cs index 24cbc71..21e5695 100644 --- a/Facepunch.Steamworks/Networking/Socket.cs +++ b/Facepunch.Steamworks/Networking/Socket.cs @@ -20,7 +20,7 @@ namespace Steamworks.Data return SteamNetworkingSockets.Internal.CloseListenSocket( Id ); } - public SocketInterface Interface + public SocketManager Interface { get => SteamNetworkingSockets.GetSocketInterface( Id ); set => SteamNetworkingSockets.SetSocketInterface( Id, value ); diff --git a/Facepunch.Steamworks/Networking/SocketInterface.cs b/Facepunch.Steamworks/Networking/SocketManager.cs similarity index 99% rename from Facepunch.Steamworks/Networking/SocketInterface.cs rename to Facepunch.Steamworks/Networking/SocketManager.cs index 649d693..ff7addd 100644 --- a/Facepunch.Steamworks/Networking/SocketInterface.cs +++ b/Facepunch.Steamworks/Networking/SocketManager.cs @@ -12,7 +12,7 @@ namespace Steamworks /// You can override all the virtual functions to turn it into what you /// want it to do. /// - public class SocketInterface + public class SocketManager { public List Connecting = new List(); public List Connected = new List(); diff --git a/Facepunch.Steamworks/SteamNetworkingSockets.cs b/Facepunch.Steamworks/SteamNetworkingSockets.cs index 21d592a..4c56240 100644 --- a/Facepunch.Steamworks/SteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/SteamNetworkingSockets.cs @@ -16,17 +16,17 @@ namespace Steamworks { SetInterface( server, new ISteamNetworkingSockets( server ) ); - SocketInterfaces = new Dictionary(); - ConnectionInterfaces = new Dictionary(); + SocketInterfaces = new Dictionary(); + ConnectionInterfaces = new Dictionary(); InstallEvents( server ); } #region SocketInterface - static Dictionary SocketInterfaces; + static Dictionary SocketInterfaces; - internal static SocketInterface GetSocketInterface( uint id ) + internal static SocketManager GetSocketInterface( uint id ) { if ( SocketInterfaces == null ) return null; if ( id == 0 ) throw new System.ArgumentException( "Invalid Socket" ); @@ -37,7 +37,7 @@ namespace Steamworks return null; } - internal static void SetSocketInterface( uint id, SocketInterface iface ) + internal static void SetSocketInterface( uint id, SocketManager iface ) { if ( id == 0 ) throw new System.ArgumentException( "Invalid Socket" ); SocketInterfaces[id] = iface; @@ -45,10 +45,10 @@ namespace Steamworks #endregion #region ConnectionInterface - static Dictionary ConnectionInterfaces; + static Dictionary ConnectionInterfaces; - internal static ConnectionInterface GetConnectionInterface( uint id ) + internal static ConnectionManager GetConnectionInterface( uint id ) { if ( ConnectionInterfaces == null ) return null; if ( id == 0 ) return null; @@ -59,7 +59,7 @@ namespace Steamworks return null; } - internal static void SetConnectionInterface( uint id, ConnectionInterface iface ) + internal static void SetConnectionInterface( uint id, ConnectionManager iface ) { if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" ); ConnectionInterfaces[id] = iface; @@ -100,7 +100,7 @@ namespace Steamworks /// Creates a "server" socket that listens for clients to connect to by calling /// Connect, over ordinary UDP (IPv4 or IPv6) /// - public static T CreateNormalSocket( NetAddress address ) where T : SocketInterface, new() + public static T CreateNormalSocket( NetAddress address ) where T : SocketManager, new() { var t = new T(); var options = Array.Empty(); @@ -114,7 +114,7 @@ namespace Steamworks /// /// Connect to a socket created via CreateListenSocketIP /// - public static T ConnectNormal( NetAddress address ) where T : ConnectionInterface, new() + public static T ConnectNormal( NetAddress address ) where T : ConnectionManager, new() { var t = new T(); var options = Array.Empty(); @@ -126,7 +126,7 @@ namespace Steamworks /// /// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping) /// - public static T CreateRelaySocket( int virtualport = 0 ) where T : SocketInterface, new() + public static T CreateRelaySocket( int virtualport = 0 ) where T : SocketManager, new() { var t = new T(); var options = Array.Empty(); @@ -138,7 +138,7 @@ namespace Steamworks /// /// Connect to a relay server /// - public static T ConnectRelay( SteamId serverId, int virtualport = 0 ) where T : ConnectionInterface, new() + public static T ConnectRelay( SteamId serverId, int virtualport = 0 ) where T : ConnectionManager, new() { var t = new T(); NetIdentity identity = serverId;