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 Steamworks.Data;
#if false
namespace Steamworks
{
[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 Microsoft.VisualStudio.TestTools.UnitTesting;
#if false
namespace Steamworks
{
[TestClass]
@ -60,3 +62,5 @@ public async Task GetEstimatedPing()
}
}
#endif

View File

@ -2,6 +2,8 @@
using System;
using System.Runtime.InteropServices;
#if false
namespace Steamworks
{
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 Steamworks.Data;
#if false
namespace Steamworks
{
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
static ISteamMatchmakingServers _internal;
internal static ISteamMatchmakingServers Internal
{
get
{
if ( _internal == null )
{
_internal = new ISteamMatchmakingServers();
_internal.Init();
}
return _internal;
}
}
internal static void Shutdown()
{
_internal = null;
}
internal static ISteamMatchmakingServers Internal => SteamMatchmakingServers.Internal;
#endregion

View File

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

View File

@ -6,6 +6,8 @@
using System.Threading.Tasks;
using Steamworks.Data;
#if false
namespace Steamworks
{
public class SteamNetworkingSockets : SteamClass
@ -23,7 +25,7 @@ internal override void InitializeInterface()
InstallEvents();
}
#region SocketInterface
#region SocketInterface
static Dictionary<uint, SocketInterface> SocketInterfaces;
@ -45,9 +47,9 @@ internal static void SetSocketInterface( uint id, SocketInterface iface )
Console.WriteLine( $"Installing Socket For {id}" );
SocketInterfaces[id] = iface;
}
#endregion
#endregion
#region ConnectionInterface
#region ConnectionInterface
static Dictionary<uint, ConnectionInterface> ConnectionInterfaces;
@ -67,7 +69,7 @@ internal static void SetConnectionInterface( uint id, ConnectionInterface iface
if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" );
ConnectionInterfaces[id] = iface;
}
#endregion
#endregion
internal static void InstallEvents( bool server = false )
{
@ -143,3 +145,5 @@ private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCall
}
}
}
#endif

View File

@ -5,6 +5,8 @@
using System.Threading.Tasks;
using Steamworks.Data;
#if false
namespace Steamworks
{
/// <summary>
@ -106,7 +108,7 @@ public static float FakeRecvPacketLag
set => SetConfigFloat( NetConfig.FakePacketLag_Recv, value );
}
#region Config Internals
#region Config Internals
internal unsafe static bool GetConfigInt( NetConfig type, int value )
{
@ -199,6 +201,8 @@ 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()
{
SteamInventory.InstallEvents();
SteamNetworkingSockets.InstallEvents(true);
//SteamNetworkingSockets.InstallEvents(true);
ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), 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}\")" );
}
Install
//
// Initial settings
//

View File

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
#if false
namespace Steamworks.Data
{
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;
#if false
namespace Steamworks.Data
{
/// <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
{
@ -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();
[DllImport( Platform.LibraryName, EntryPoint = "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();
}
}