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 System.Threading.Tasks;
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 @@ namespace Steamworks
} }
} }
#endif

View File

@ -5,6 +5,8 @@ using System.Threading;
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 @@ namespace Steamworks
} }
} }
#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 @@ namespace Steamworks
} }
} }
} }
#endif

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
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 @@ namespace Steamworks
} }
} }
} }
#endif

View File

@ -11,27 +11,7 @@ namespace Steamworks.ServerList
{ {
#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 @@ namespace Steamworks
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 @@ namespace Steamworks
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.Text;
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
@ -23,7 +25,7 @@ namespace Steamworks
InstallEvents(); InstallEvents();
} }
#region SocketInterface #region SocketInterface
static Dictionary<uint, SocketInterface> SocketInterfaces; static Dictionary<uint, SocketInterface> SocketInterfaces;
@ -45,9 +47,9 @@ namespace Steamworks
Console.WriteLine( $"Installing Socket For {id}" ); Console.WriteLine( $"Installing Socket For {id}" );
SocketInterfaces[id] = iface; SocketInterfaces[id] = iface;
} }
#endregion #endregion
#region ConnectionInterface #region ConnectionInterface
static Dictionary<uint, ConnectionInterface> ConnectionInterfaces; static Dictionary<uint, ConnectionInterface> ConnectionInterfaces;
@ -67,7 +69,7 @@ namespace Steamworks
if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" ); if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" );
ConnectionInterfaces[id] = iface; ConnectionInterfaces[id] = iface;
} }
#endregion #endregion
internal static void InstallEvents( bool server = false ) internal static void InstallEvents( bool server = false )
{ {
@ -143,3 +145,5 @@ namespace Steamworks
} }
} }
} }
#endif

View File

@ -5,6 +5,8 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Steamworks.Data; using Steamworks.Data;
#if false
namespace Steamworks namespace Steamworks
{ {
/// <summary> /// <summary>
@ -106,7 +108,7 @@ namespace Steamworks
set => SetConfigFloat( NetConfig.FakePacketLag_Recv, value ); set => SetConfigFloat( NetConfig.FakePacketLag_Recv, value );
} }
#region Config Internals #region Config Internals
internal unsafe static bool GetConfigInt( NetConfig type, int value ) internal unsafe static bool GetConfigInt( NetConfig type, int value )
{ {
@ -199,6 +201,8 @@ namespace Steamworks
} }
}*/ }*/
#endregion #endregion
} }
} }
#endif

View File

@ -29,7 +29,7 @@ namespace Steamworks
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 @@ namespace Steamworks
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 @@ namespace Steamworks.Data
} }
} }
#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 @@ namespace Steamworks.Data
} }
} }
} }
#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 @@
} }
} }
} }
#else
namespace Steamworks.Data
{
public struct Socket
{
public uint Id { get; }
}
}
#endif

View File

@ -71,5 +71,13 @@ namespace Steamworks
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();
} }
} }