mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-04 01:30:30 +03:00
Struct name consistency
This commit is contained in:
parent
b171e22861
commit
9bb5b5178e
@ -30,7 +30,7 @@ namespace Steamworks
|
||||
[TestMethod]
|
||||
public async Task CreateNormalServer()
|
||||
{
|
||||
var si = SteamNetworkingSockets.CreateNormalSocket<TestSocketInterface>( Data.NetworkAddress.AnyIp( 21893 ) );
|
||||
var si = SteamNetworkingSockets.CreateNormalSocket<TestSocketInterface>( Data.NetAddress.AnyIp( 21893 ) );
|
||||
|
||||
Console.WriteLine( $"Created Socket: {si}" );
|
||||
|
||||
@ -153,14 +153,14 @@ namespace Steamworks
|
||||
{
|
||||
public bool HasFinished = false;
|
||||
|
||||
public override void OnConnectionChanged( NetConnection connection, ConnectionInfo data )
|
||||
public override void OnConnectionChanged( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
Console.WriteLine( $"[Socket{Socket}][{connection}] [{data.State}]" );
|
||||
|
||||
base.OnConnectionChanged( connection, data );
|
||||
}
|
||||
|
||||
public override void OnConnecting( NetConnection connection, ConnectionInfo data )
|
||||
public override void OnConnecting( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
Console.WriteLine( $" - OnConnecting" );
|
||||
base.OnConnecting( connection, data );
|
||||
@ -169,7 +169,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Client is connected. They move from connecting to Connections
|
||||
/// </summary>
|
||||
public override void OnConnected( NetConnection connection, ConnectionInfo data )
|
||||
public override void OnConnected( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
Console.WriteLine( $" - OnConnected" );
|
||||
base.OnConnected( connection, data );
|
||||
@ -178,7 +178,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// The connection has been closed remotely or disconnected locally. Check data.State for details.
|
||||
/// </summary>
|
||||
public override void OnDisconnected( NetConnection connection, ConnectionInfo data )
|
||||
public override void OnDisconnected( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
Console.WriteLine( $" - OnDisconnected" );
|
||||
base.OnDisconnected( connection, data );
|
||||
@ -224,7 +224,7 @@ namespace Steamworks
|
||||
Close();
|
||||
}
|
||||
|
||||
public override unsafe void OnMessage( NetConnection connection, NetworkIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
|
||||
public override unsafe void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
|
||||
{
|
||||
// We're only sending strings, so it's fine to read this like this
|
||||
var str = UTF8Encoding.UTF8.GetString( (byte*)data, size );
|
||||
|
@ -6,7 +6,7 @@ namespace Steamworks
|
||||
{
|
||||
public class ConnectionInterface
|
||||
{
|
||||
public NetConnection Connection;
|
||||
public Connection Connection;
|
||||
public bool Connected = false;
|
||||
|
||||
public string ConnectionName
|
||||
|
@ -7,15 +7,15 @@ namespace Steamworks
|
||||
{
|
||||
public class SocketInterface
|
||||
{
|
||||
public List<NetConnection> Connecting = new List<NetConnection>();
|
||||
public List<NetConnection> Connected = new List<NetConnection>();
|
||||
public List<Connection> Connecting = new List<Connection>();
|
||||
public List<Connection> Connected = new List<Connection>();
|
||||
public Socket Socket { get; internal set; }
|
||||
|
||||
public bool Close() => Socket.Close();
|
||||
|
||||
public override string ToString() => Socket.ToString();
|
||||
|
||||
public virtual void OnConnectionChanged( NetConnection connection, ConnectionInfo data )
|
||||
public virtual void OnConnectionChanged( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
switch ( data.State )
|
||||
{
|
||||
@ -36,7 +36,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Default behaviour is to accept every connection
|
||||
/// </summary>
|
||||
public virtual void OnConnecting( NetConnection connection, ConnectionInfo data )
|
||||
public virtual void OnConnecting( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
connection.Accept();
|
||||
Connecting.Add( connection );
|
||||
@ -45,7 +45,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Client is connected. They move from connecting to Connections
|
||||
/// </summary>
|
||||
public virtual void OnConnected( NetConnection connection, ConnectionInfo data )
|
||||
public virtual void OnConnected( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
Connecting.Remove( connection );
|
||||
Connected.Add( connection );
|
||||
@ -54,7 +54,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// The connection has been closed remotely or disconnected locally. Check data.State for details.
|
||||
/// </summary>
|
||||
public virtual void OnDisconnected( NetConnection connection, ConnectionInfo data )
|
||||
public virtual void OnDisconnected( Connection connection, ConnectionInfo data )
|
||||
{
|
||||
connection.Close();
|
||||
|
||||
@ -106,7 +106,7 @@ namespace Steamworks
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnMessage( NetConnection connection, NetworkIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
|
||||
public virtual void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -46,22 +46,22 @@ namespace Steamworks
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate Socket FCreateListenSocketIP( IntPtr self, ref NetworkAddress localAddress );
|
||||
private delegate Socket FCreateListenSocketIP( IntPtr self, ref NetAddress localAddress );
|
||||
private FCreateListenSocketIP _CreateListenSocketIP;
|
||||
|
||||
#endregion
|
||||
internal Socket CreateListenSocketIP( ref NetworkAddress localAddress )
|
||||
internal Socket CreateListenSocketIP( ref NetAddress localAddress )
|
||||
{
|
||||
return _CreateListenSocketIP( Self, ref localAddress );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate NetConnection FConnectByIPAddress( IntPtr self, ref NetworkAddress address );
|
||||
private delegate Connection FConnectByIPAddress( IntPtr self, ref NetAddress address );
|
||||
private FConnectByIPAddress _ConnectByIPAddress;
|
||||
|
||||
#endregion
|
||||
internal NetConnection ConnectByIPAddress( ref NetworkAddress address )
|
||||
internal Connection ConnectByIPAddress( ref NetAddress address )
|
||||
{
|
||||
return _ConnectByIPAddress( Self, ref address );
|
||||
}
|
||||
@ -79,22 +79,22 @@ namespace Steamworks
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate NetConnection FConnectP2P( IntPtr self, ref NetworkIdentity identityRemote, int nVirtualPort );
|
||||
private delegate Connection FConnectP2P( IntPtr self, ref NetIdentity identityRemote, int nVirtualPort );
|
||||
private FConnectP2P _ConnectP2P;
|
||||
|
||||
#endregion
|
||||
internal NetConnection ConnectP2P( ref NetworkIdentity identityRemote, int nVirtualPort )
|
||||
internal Connection ConnectP2P( ref NetIdentity identityRemote, int nVirtualPort )
|
||||
{
|
||||
return _ConnectP2P( Self, ref identityRemote, nVirtualPort );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate Result FAcceptConnection( IntPtr self, NetConnection hConn );
|
||||
private delegate Result FAcceptConnection( IntPtr self, Connection hConn );
|
||||
private FAcceptConnection _AcceptConnection;
|
||||
|
||||
#endregion
|
||||
internal Result AcceptConnection( NetConnection hConn )
|
||||
internal Result AcceptConnection( Connection hConn )
|
||||
{
|
||||
return _AcceptConnection( Self, hConn );
|
||||
}
|
||||
@ -102,11 +102,11 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FCloseConnection( IntPtr self, NetConnection hPeer, int nReason, string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger );
|
||||
private delegate bool FCloseConnection( IntPtr self, Connection hPeer, int nReason, string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger );
|
||||
private FCloseConnection _CloseConnection;
|
||||
|
||||
#endregion
|
||||
internal bool CloseConnection( NetConnection hPeer, int nReason, string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger )
|
||||
internal bool CloseConnection( Connection hPeer, int nReason, string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger )
|
||||
{
|
||||
return _CloseConnection( Self, hPeer, nReason, pszDebug, bEnableLinger );
|
||||
}
|
||||
@ -126,33 +126,33 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FSetConnectionUserData( IntPtr self, NetConnection hPeer, long nUserData );
|
||||
private delegate bool FSetConnectionUserData( IntPtr self, Connection hPeer, long nUserData );
|
||||
private FSetConnectionUserData _SetConnectionUserData;
|
||||
|
||||
#endregion
|
||||
internal bool SetConnectionUserData( NetConnection hPeer, long nUserData )
|
||||
internal bool SetConnectionUserData( Connection hPeer, long nUserData )
|
||||
{
|
||||
return _SetConnectionUserData( Self, hPeer, nUserData );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate long FGetConnectionUserData( IntPtr self, NetConnection hPeer );
|
||||
private delegate long FGetConnectionUserData( IntPtr self, Connection hPeer );
|
||||
private FGetConnectionUserData _GetConnectionUserData;
|
||||
|
||||
#endregion
|
||||
internal long GetConnectionUserData( NetConnection hPeer )
|
||||
internal long GetConnectionUserData( Connection hPeer )
|
||||
{
|
||||
return _GetConnectionUserData( Self, hPeer );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate void FSetConnectionName( IntPtr self, NetConnection hPeer, string pszName );
|
||||
private delegate void FSetConnectionName( IntPtr self, Connection hPeer, string pszName );
|
||||
private FSetConnectionName _SetConnectionName;
|
||||
|
||||
#endregion
|
||||
internal void SetConnectionName( NetConnection hPeer, string pszName )
|
||||
internal void SetConnectionName( Connection hPeer, string pszName )
|
||||
{
|
||||
_SetConnectionName( Self, hPeer, pszName );
|
||||
}
|
||||
@ -160,44 +160,44 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FGetConnectionName( IntPtr self, NetConnection hPeer, StringBuilder pszName, int nMaxLen );
|
||||
private delegate bool FGetConnectionName( IntPtr self, Connection hPeer, StringBuilder pszName, int nMaxLen );
|
||||
private FGetConnectionName _GetConnectionName;
|
||||
|
||||
#endregion
|
||||
internal bool GetConnectionName( NetConnection hPeer, StringBuilder pszName, int nMaxLen )
|
||||
internal bool GetConnectionName( Connection hPeer, StringBuilder pszName, int nMaxLen )
|
||||
{
|
||||
return _GetConnectionName( Self, hPeer, pszName, nMaxLen );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate Result FSendMessageToConnection( IntPtr self, NetConnection hConn, IntPtr pData, uint cbData, int nSendFlags );
|
||||
private delegate Result FSendMessageToConnection( IntPtr self, Connection hConn, IntPtr pData, uint cbData, int nSendFlags );
|
||||
private FSendMessageToConnection _SendMessageToConnection;
|
||||
|
||||
#endregion
|
||||
internal Result SendMessageToConnection( NetConnection hConn, IntPtr pData, uint cbData, int nSendFlags )
|
||||
internal Result SendMessageToConnection( Connection hConn, IntPtr pData, uint cbData, int nSendFlags )
|
||||
{
|
||||
return _SendMessageToConnection( Self, hConn, pData, cbData, nSendFlags );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate Result FFlushMessagesOnConnection( IntPtr self, NetConnection hConn );
|
||||
private delegate Result FFlushMessagesOnConnection( IntPtr self, Connection hConn );
|
||||
private FFlushMessagesOnConnection _FlushMessagesOnConnection;
|
||||
|
||||
#endregion
|
||||
internal Result FlushMessagesOnConnection( NetConnection hConn )
|
||||
internal Result FlushMessagesOnConnection( Connection hConn )
|
||||
{
|
||||
return _FlushMessagesOnConnection( Self, hConn );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate int FReceiveMessagesOnConnection( IntPtr self, NetConnection hConn, IntPtr ppOutMessages, int nMaxMessages );
|
||||
private delegate int FReceiveMessagesOnConnection( IntPtr self, Connection hConn, IntPtr ppOutMessages, int nMaxMessages );
|
||||
private FReceiveMessagesOnConnection _ReceiveMessagesOnConnection;
|
||||
|
||||
#endregion
|
||||
internal int ReceiveMessagesOnConnection( NetConnection hConn, IntPtr ppOutMessages, int nMaxMessages )
|
||||
internal int ReceiveMessagesOnConnection( Connection hConn, IntPtr ppOutMessages, int nMaxMessages )
|
||||
{
|
||||
return _ReceiveMessagesOnConnection( Self, hConn, ppOutMessages, nMaxMessages );
|
||||
}
|
||||
@ -216,11 +216,11 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FGetConnectionInfo( IntPtr self, NetConnection hConn, ref ConnectionInfo pInfo );
|
||||
private delegate bool FGetConnectionInfo( IntPtr self, Connection hConn, ref ConnectionInfo pInfo );
|
||||
private FGetConnectionInfo _GetConnectionInfo;
|
||||
|
||||
#endregion
|
||||
internal bool GetConnectionInfo( NetConnection hConn, ref ConnectionInfo pInfo )
|
||||
internal bool GetConnectionInfo( Connection hConn, ref ConnectionInfo pInfo )
|
||||
{
|
||||
return _GetConnectionInfo( Self, hConn, ref pInfo );
|
||||
}
|
||||
@ -228,22 +228,22 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FGetQuickConnectionStatus( IntPtr self, NetConnection hConn, ref SteamNetworkingQuickConnectionStatus pStats );
|
||||
private delegate bool FGetQuickConnectionStatus( IntPtr self, Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats );
|
||||
private FGetQuickConnectionStatus _GetQuickConnectionStatus;
|
||||
|
||||
#endregion
|
||||
internal bool GetQuickConnectionStatus( NetConnection hConn, ref SteamNetworkingQuickConnectionStatus pStats )
|
||||
internal bool GetQuickConnectionStatus( Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats )
|
||||
{
|
||||
return _GetQuickConnectionStatus( Self, hConn, ref pStats );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate int FGetDetailedConnectionStatus( IntPtr self, NetConnection hConn, StringBuilder pszBuf, int cbBuf );
|
||||
private delegate int FGetDetailedConnectionStatus( IntPtr self, Connection hConn, StringBuilder pszBuf, int cbBuf );
|
||||
private FGetDetailedConnectionStatus _GetDetailedConnectionStatus;
|
||||
|
||||
#endregion
|
||||
internal int GetDetailedConnectionStatus( NetConnection hConn, StringBuilder pszBuf, int cbBuf )
|
||||
internal int GetDetailedConnectionStatus( Connection hConn, StringBuilder pszBuf, int cbBuf )
|
||||
{
|
||||
return _GetDetailedConnectionStatus( Self, hConn, pszBuf, cbBuf );
|
||||
}
|
||||
@ -251,11 +251,11 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FGetListenSocketAddress( IntPtr self, Socket hSocket, ref NetworkAddress address );
|
||||
private delegate bool FGetListenSocketAddress( IntPtr self, Socket hSocket, ref NetAddress address );
|
||||
private FGetListenSocketAddress _GetListenSocketAddress;
|
||||
|
||||
#endregion
|
||||
internal bool GetListenSocketAddress( Socket hSocket, ref NetworkAddress address )
|
||||
internal bool GetListenSocketAddress( Socket hSocket, ref NetAddress address )
|
||||
{
|
||||
return _GetListenSocketAddress( Self, hSocket, ref address );
|
||||
}
|
||||
@ -263,11 +263,11 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FCreateSocketPair( IntPtr self, [In,Out] NetConnection[] pOutConnection1, [In,Out] NetConnection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetworkIdentity pIdentity1, ref NetworkIdentity pIdentity2 );
|
||||
private delegate bool FCreateSocketPair( IntPtr self, [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 );
|
||||
private FCreateSocketPair _CreateSocketPair;
|
||||
|
||||
#endregion
|
||||
internal bool CreateSocketPair( [In,Out] NetConnection[] pOutConnection1, [In,Out] NetConnection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetworkIdentity pIdentity1, ref NetworkIdentity pIdentity2 )
|
||||
internal bool CreateSocketPair( [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 )
|
||||
{
|
||||
return _CreateSocketPair( Self, pOutConnection1, pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2 );
|
||||
}
|
||||
@ -275,11 +275,11 @@ namespace Steamworks
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
[return: MarshalAs( UnmanagedType.I1 )]
|
||||
private delegate bool FGetIdentity( IntPtr self, ref NetworkIdentity pIdentity );
|
||||
private delegate bool FGetIdentity( IntPtr self, ref NetIdentity pIdentity );
|
||||
private FGetIdentity _GetIdentity;
|
||||
|
||||
#endregion
|
||||
internal bool GetIdentity( ref NetworkIdentity pIdentity )
|
||||
internal bool GetIdentity( ref NetIdentity pIdentity )
|
||||
{
|
||||
return _GetIdentity( Self, ref pIdentity );
|
||||
}
|
||||
@ -298,22 +298,22 @@ namespace Steamworks
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate int FFindRelayAuthTicketForServer( IntPtr self, ref NetworkIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket );
|
||||
private delegate int FFindRelayAuthTicketForServer( IntPtr self, ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket );
|
||||
private FFindRelayAuthTicketForServer _FindRelayAuthTicketForServer;
|
||||
|
||||
#endregion
|
||||
internal int FindRelayAuthTicketForServer( ref NetworkIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket )
|
||||
internal int FindRelayAuthTicketForServer( ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket )
|
||||
{
|
||||
return _FindRelayAuthTicketForServer( Self, ref identityGameServer, nVirtualPort, pOutParsedTicket );
|
||||
}
|
||||
|
||||
#region FunctionMeta
|
||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||
private delegate NetConnection FConnectToHostedDedicatedServer( IntPtr self, ref NetworkIdentity identityTarget, int nVirtualPort );
|
||||
private delegate Connection FConnectToHostedDedicatedServer( IntPtr self, ref NetIdentity identityTarget, int nVirtualPort );
|
||||
private FConnectToHostedDedicatedServer _ConnectToHostedDedicatedServer;
|
||||
|
||||
#endregion
|
||||
internal NetConnection ConnectToHostedDedicatedServer( ref NetworkIdentity identityTarget, int nVirtualPort )
|
||||
internal Connection ConnectToHostedDedicatedServer( ref NetIdentity identityTarget, int nVirtualPort )
|
||||
{
|
||||
return _ConnectToHostedDedicatedServer( Self, ref identityTarget, nVirtualPort );
|
||||
}
|
||||
|
@ -12135,7 +12135,7 @@ namespace Steamworks.Data
|
||||
[StructLayout( LayoutKind.Sequential, Pack = 4 )]
|
||||
internal struct SteamNetConnectionStatusChangedCallback_t
|
||||
{
|
||||
internal NetConnection Conn; // m_hConn HSteamNetConnection
|
||||
internal Connection Conn; // m_hConn HSteamNetConnection
|
||||
internal ConnectionInfo Nfo; // m_info SteamNetConnectionInfo_t
|
||||
internal ConnectionState OldState; // m_eOldState ESteamNetworkingConnectionState
|
||||
|
||||
@ -12190,7 +12190,7 @@ namespace Steamworks.Data
|
||||
[StructLayout( LayoutKind.Sequential, Pack = 8 )]
|
||||
public struct Pack8
|
||||
{
|
||||
internal NetConnection Conn; // m_hConn HSteamNetConnection
|
||||
internal Connection Conn; // m_hConn HSteamNetConnection
|
||||
internal ConnectionInfo Nfo; // m_info SteamNetConnectionInfo_t
|
||||
internal ConnectionState OldState; // m_eOldState ESteamNetworkingConnectionState
|
||||
|
||||
|
@ -101,14 +101,14 @@ namespace Steamworks
|
||||
OnConnectionStatusChanged?.Invoke( data.Conn, data.Nfo );
|
||||
}
|
||||
|
||||
public static event Action<NetConnection, ConnectionInfo> OnConnectionStatusChanged;
|
||||
public static event Action<Connection, ConnectionInfo> OnConnectionStatusChanged;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a "server" socket that listens for clients to connect to by calling
|
||||
/// Connect, over ordinary UDP (IPv4 or IPv6)
|
||||
/// </summary>
|
||||
public static T CreateNormalSocket<T>( NetworkAddress address ) where T : SocketInterface, new()
|
||||
public static T CreateNormalSocket<T>( NetAddress address ) where T : SocketInterface, new()
|
||||
{
|
||||
var t = new T();
|
||||
t.Socket = Internal.CreateListenSocketIP( ref address );
|
||||
@ -119,7 +119,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Connect to a socket created via <method>CreateListenSocketIP</method>
|
||||
/// </summary>
|
||||
public static T ConnectNormal<T>( NetworkAddress address ) where T : ConnectionInterface, new()
|
||||
public static T ConnectNormal<T>( NetAddress address ) where T : ConnectionInterface, new()
|
||||
{
|
||||
var t = new T();
|
||||
t.Connection = Internal.ConnectByIPAddress( ref address );
|
||||
@ -144,7 +144,7 @@ namespace Steamworks
|
||||
public static T ConnectRelay<T>( SteamId serverId, int virtualport = 0 ) where T : ConnectionInterface, new()
|
||||
{
|
||||
var t = new T();
|
||||
NetworkIdentity identity = serverId;
|
||||
NetIdentity identity = serverId;
|
||||
t.Connection = Internal.ConnectP2P( ref identity, virtualport );
|
||||
SetConnectionInterface( t.Connection.Id, t );
|
||||
return t;
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Steamworks.Data
|
||||
{
|
||||
public struct NetConnection
|
||||
public struct Connection
|
||||
{
|
||||
internal uint Id;
|
||||
|
@ -5,10 +5,10 @@ namespace Steamworks.Data
|
||||
[StructLayout( LayoutKind.Sequential, Size = 696 )]
|
||||
public struct ConnectionInfo
|
||||
{
|
||||
internal NetworkIdentity identity;
|
||||
internal NetIdentity identity;
|
||||
internal long userData;
|
||||
internal Socket listenSocket;
|
||||
internal NetworkAddress address;
|
||||
internal NetAddress address;
|
||||
internal ushort pad;
|
||||
internal SteamNetworkingPOPID popRemote;
|
||||
internal SteamNetworkingPOPID popRelay;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace Steamworks.Data
|
||||
{
|
||||
[StructLayout( LayoutKind.Explicit, Size = 18, Pack = 1 )]
|
||||
public struct NetworkAddress
|
||||
public struct NetAddress
|
||||
{
|
||||
[FieldOffset( 0 )]
|
||||
internal IPV4 ip;
|
||||
@ -25,9 +25,9 @@ namespace Steamworks.Data
|
||||
/// <summary>
|
||||
/// Any IP, specific port
|
||||
/// </summary>
|
||||
public static NetworkAddress AnyIp( ushort port )
|
||||
public static NetAddress AnyIp( ushort port )
|
||||
{
|
||||
return new NetworkAddress
|
||||
return new NetAddress
|
||||
{
|
||||
ip = new IPV4
|
||||
{
|
@ -3,7 +3,7 @@
|
||||
namespace Steamworks.Data
|
||||
{
|
||||
[StructLayout( LayoutKind.Explicit, Size = 136, Pack = 1 )]
|
||||
public struct NetworkIdentity
|
||||
public struct NetIdentity
|
||||
{
|
||||
[FieldOffset( 0 )]
|
||||
internal IdentityType type;
|
||||
@ -14,12 +14,12 @@ namespace Steamworks.Data
|
||||
[FieldOffset( 8 )]
|
||||
internal SteamId steamID;
|
||||
|
||||
public static implicit operator NetworkIdentity( SteamId value )
|
||||
public static implicit operator NetIdentity( SteamId value )
|
||||
{
|
||||
return new NetworkIdentity { steamID = value, type = IdentityType.SteamID, m_cbSize = 8 };
|
||||
return new NetIdentity { steamID = value, type = IdentityType.SteamID, m_cbSize = 8 };
|
||||
}
|
||||
|
||||
public static implicit operator SteamId( NetworkIdentity value )
|
||||
public static implicit operator SteamId( NetIdentity value )
|
||||
{
|
||||
return value.steamID;
|
||||
}
|
@ -9,8 +9,8 @@ namespace Steamworks.Data
|
||||
{
|
||||
internal IntPtr DataPtr;
|
||||
internal int DataSize;
|
||||
internal NetConnection Connection;
|
||||
internal NetworkIdentity Identity;
|
||||
internal Connection Connection;
|
||||
internal NetIdentity Identity;
|
||||
internal long ConnectionUserData;
|
||||
internal long RecvTime;
|
||||
internal long MessageNumber;
|
||||
|
@ -30,10 +30,10 @@ public static class Cleanup
|
||||
type = type.Replace( "SteamNetworkingConfigValue", "NetConfig" );
|
||||
type = type.Replace( "SteamNetworkingConfigScope", "NetScope" );
|
||||
type = type.Replace( "SteamNetworkingConfigDataType", "NetConfigType" );
|
||||
type = type.Replace( "HSteamNetConnection", "NetConnection" );
|
||||
type = type.Replace( "HSteamNetConnection", "Connection" );
|
||||
type = type.Replace( "HSteamListenSocket", "Socket" );
|
||||
type = type.Replace( "SteamNetworkingIPAddr", "NetworkAddress" );
|
||||
type = type.Replace( "SteamNetworkingIdentity", "NetworkIdentity" );
|
||||
type = type.Replace( "SteamNetworkingIPAddr", "NetAddress" );
|
||||
type = type.Replace( "SteamNetworkingIdentity", "NetIdentity" );
|
||||
type = type.Replace( "SteamNetConnectionInfo_t", "ConnectionInfo" );
|
||||
type = type.Replace( "SteamNetworkingConnectionState", "ConnectionState" );
|
||||
type = type.Replace( "SteamNetworkingMicroseconds", "long" );
|
||||
|
@ -50,8 +50,8 @@ internal class BaseType
|
||||
if ( basicType == "InventoryItemId" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "InventoryDefId" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "PingLocation" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "NetworkIdentity" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "NetworkAddress" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "NetIdentity" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "NetAddress" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType == "ConnectionInfo" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType };
|
||||
if ( basicType.StartsWith( "E" ) && char.IsUpper( basicType[1] ) ) return new EnumType { NativeType = type.Substring( 1 ), VarName = varname };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user