Removing the new networking stuff (for now)

This commit is contained in:
Garry Newman 2020-02-11 10:16:23 +00:00
parent eb9a45bbe0
commit 5d2b8a0ade
13 changed files with 79 additions and 41 deletions

View File

@ -7,6 +7,8 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Steamworks.Data; using Steamworks.Data;
#if false
namespace Steamworks namespace Steamworks
{ {
[TestClass] [TestClass]
@ -285,3 +287,5 @@ public override unsafe void OnMessage( Connection connection, NetIdentity identi
} }
} }
#endif

View File

@ -5,6 +5,8 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
#if false
namespace Steamworks namespace Steamworks
{ {
[TestClass] [TestClass]
@ -60,3 +62,5 @@ public async Task GetEstimatedPing()
} }
} }
#endif

View File

@ -2,6 +2,8 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
#if false
namespace Steamworks namespace Steamworks
{ {
public class ConnectionInterface public class ConnectionInterface
@ -118,3 +120,5 @@ public virtual void OnMessage( IntPtr data, int size, long messageNum, long recv
} }
} }
} }
#endif

View File

@ -3,6 +3,8 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Steamworks.Data; using Steamworks.Data;
#if false
namespace Steamworks namespace Steamworks
{ {
public class SocketInterface public class SocketInterface
@ -110,3 +112,5 @@ public virtual void OnMessage( Connection connection, NetIdentity identity, IntP
} }
} }
} }
#endif

View File

@ -11,27 +11,7 @@ public abstract class Base : IDisposable
{ {
#region ISteamMatchmakingServers #region ISteamMatchmakingServers
internal static ISteamMatchmakingServers Internal => SteamMatchmakingServers.Internal;
static ISteamMatchmakingServers _internal;
internal static ISteamMatchmakingServers Internal
{
get
{
if ( _internal == null )
{
_internal = new ISteamMatchmakingServers();
_internal.Init();
}
return _internal;
}
}
internal static void Shutdown()
{
_internal = null;
}
#endregion #endregion

View File

@ -34,10 +34,11 @@ public static void Init( uint appid, bool asyncCallbacks = true )
AddInterface<SteamInput>(); AddInterface<SteamInput>();
AddInterface<SteamInventory>(); AddInterface<SteamInventory>();
AddInterface<SteamMatchmaking>(); AddInterface<SteamMatchmaking>();
AddInterface<SteamMatchmakingServers>();
AddInterface<SteamMusic>(); AddInterface<SteamMusic>();
AddInterface<SteamNetworking>(); AddInterface<SteamNetworking>();
AddInterface<SteamNetworkingSockets>(); //AddInterface<SteamNetworkingSockets>();
AddInterface<SteamNetworkingUtils>(); //AddInterface<SteamNetworkingUtils>();
AddInterface<SteamParental>(); AddInterface<SteamParental>();
AddInterface<SteamParties>(); AddInterface<SteamParties>();
AddInterface<SteamRemoteStorage>(); AddInterface<SteamRemoteStorage>();
@ -115,8 +116,6 @@ internal static void Cleanup()
Event.DisposeAllClient(); Event.DisposeAllClient();
ShutdownInterfaces(); ShutdownInterfaces();
ServerList.Base.Shutdown();
} }
internal static void RegisterCallback( IntPtr intPtr, int callbackId ) internal static void RegisterCallback( IntPtr intPtr, int callbackId )

View File

@ -6,6 +6,8 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Steamworks.Data; using Steamworks.Data;
#if false
namespace Steamworks namespace Steamworks
{ {
public class SteamNetworkingSockets : SteamClass public class SteamNetworkingSockets : SteamClass
@ -143,3 +145,5 @@ private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCall
} }
} }
} }
#endif

View File

@ -5,6 +5,8 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Steamworks.Data; using Steamworks.Data;
#if false
namespace Steamworks namespace Steamworks
{ {
/// <summary> /// <summary>
@ -202,3 +204,5 @@ internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, strin
#endregion #endregion
} }
} }
#endif

View File

@ -29,7 +29,7 @@ internal override void InitializeInterface()
internal static void InstallEvents() internal static void InstallEvents()
{ {
SteamInventory.InstallEvents(); SteamInventory.InstallEvents();
SteamNetworkingSockets.InstallEvents(true); //SteamNetworkingSockets.InstallEvents(true);
ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true );
SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke(), true ); SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke(), true );
@ -85,6 +85,8 @@ public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks
throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" ); throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" );
} }
Install
// //
// Initial settings // Initial settings
// //

View File

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if false
namespace Steamworks.Data namespace Steamworks.Data
{ {
public struct Connection public struct Connection
@ -115,3 +117,12 @@ public IEnumerable<SteamNetworkingMessage_t> Messages
} }
} }
#else
namespace Steamworks.Data
{
public struct Connection
{
public uint Id { get; }
}
}
#endif

View File

@ -1,5 +1,7 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
#if false
namespace Steamworks.Data namespace Steamworks.Data
{ {
/// <summary> /// <summary>
@ -65,3 +67,5 @@ public int EstimatePingTo( PingLocation target )
} }
} }
} }
#endif

View File

@ -1,4 +1,5 @@
namespace Steamworks.Data #if false
namespace Steamworks.Data
{ {
public struct Socket public struct Socket
{ {
@ -21,3 +22,12 @@ public SocketInterface Interface
} }
} }
} }
#else
namespace Steamworks.Data
{
public struct Socket
{
public uint Id { get; }
}
}
#endif

View File

@ -71,5 +71,13 @@ internal static class GetApi
internal static extern IntPtr SteamGameServer(); internal static extern IntPtr SteamGameServer();
[DllImport( Platform.LibraryName, EntryPoint = "SteamGameServerStats" )] [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServerStats" )]
internal static extern IntPtr SteamGameServerStats(); internal static extern IntPtr SteamGameServerStats();
//
// NOTE: Stubs - these don't exist
//
[DllImport( Platform.LibraryName, EntryPoint = "SteamNetworkingSockets" )]
internal static extern IntPtr SteamNetworkingSockets();
[DllImport( Platform.LibraryName, EntryPoint = "SteamNetworkingUtils" )]
internal static extern IntPtr SteamNetworkingUtils();
} }
} }