Renamed var ConnectionInfo from data to info

This commit is contained in:
Garry Newman 2020-02-26 14:55:13 +00:00
parent 49b55c74b8
commit 13feee328d
2 changed files with 16 additions and 16 deletions

View File

@ -26,20 +26,20 @@ namespace Steamworks
public override string ToString() => Connection.ToString(); public override string ToString() => Connection.ToString();
public virtual void OnConnectionChanged( ConnectionInfo data ) public virtual void OnConnectionChanged( ConnectionInfo info )
{ {
switch ( data.State ) switch ( info.State )
{ {
case ConnectionState.Connecting: case ConnectionState.Connecting:
OnConnecting( data ); OnConnecting( info );
break; break;
case ConnectionState.Connected: case ConnectionState.Connected:
OnConnected( data ); OnConnected( info );
break; break;
case ConnectionState.ClosedByPeer: case ConnectionState.ClosedByPeer:
case ConnectionState.ProblemDetectedLocally: case ConnectionState.ProblemDetectedLocally:
case ConnectionState.None: case ConnectionState.None:
OnDisconnected( data ); OnDisconnected( info );
break; break;
} }
} }
@ -47,7 +47,7 @@ namespace Steamworks
/// <summary> /// <summary>
/// We're trying to connect! /// We're trying to connect!
/// </summary> /// </summary>
public virtual void OnConnecting( ConnectionInfo data ) public virtual void OnConnecting( ConnectionInfo info )
{ {
Connecting = true; Connecting = true;
} }
@ -55,7 +55,7 @@ namespace Steamworks
/// <summary> /// <summary>
/// Client is connected. They move from connecting to Connections /// Client is connected. They move from connecting to Connections
/// </summary> /// </summary>
public virtual void OnConnected( ConnectionInfo data ) public virtual void OnConnected( ConnectionInfo info )
{ {
Connected = true; Connected = true;
Connecting = false; Connecting = false;
@ -64,7 +64,7 @@ namespace Steamworks
/// <summary> /// <summary>
/// The connection has been closed remotely or disconnected locally. Check data.State for details. /// The connection has been closed remotely or disconnected locally. Check data.State for details.
/// </summary> /// </summary>
public virtual void OnDisconnected( ConnectionInfo data ) public virtual void OnDisconnected( ConnectionInfo info )
{ {
Connected = false; Connected = false;
Connecting = false; Connecting = false;

View File

@ -40,20 +40,20 @@ namespace Steamworks
return true; return true;
} }
public virtual void OnConnectionChanged( Connection connection, ConnectionInfo data ) public virtual void OnConnectionChanged( Connection connection, ConnectionInfo info )
{ {
switch ( data.State ) switch ( info.State )
{ {
case ConnectionState.Connecting: case ConnectionState.Connecting:
if ( !Connecting.Contains( connection ) ) if ( !Connecting.Contains( connection ) )
{ {
OnConnecting( connection, data ); OnConnecting( connection, info );
} }
break; break;
case ConnectionState.Connected: case ConnectionState.Connected:
if ( !Connected.Contains( connection ) ) if ( !Connected.Contains( connection ) )
{ {
OnConnected( connection, data ); OnConnected( connection, info );
} }
break; break;
case ConnectionState.ClosedByPeer: case ConnectionState.ClosedByPeer:
@ -61,7 +61,7 @@ namespace Steamworks
case ConnectionState.None: case ConnectionState.None:
if ( Connecting.Contains( connection ) || Connected.Contains( connection ) ) if ( Connecting.Contains( connection ) || Connected.Contains( connection ) )
{ {
OnDisconnected( connection, data ); OnDisconnected( connection, info );
} }
break; break;
} }
@ -70,7 +70,7 @@ namespace Steamworks
/// <summary> /// <summary>
/// Default behaviour is to accept every connection /// Default behaviour is to accept every connection
/// </summary> /// </summary>
public virtual void OnConnecting( Connection connection, ConnectionInfo data ) public virtual void OnConnecting( Connection connection, ConnectionInfo info )
{ {
connection.Accept(); connection.Accept();
Connecting.Add( connection ); Connecting.Add( connection );
@ -79,7 +79,7 @@ namespace Steamworks
/// <summary> /// <summary>
/// Client is connected. They move from connecting to Connections /// Client is connected. They move from connecting to Connections
/// </summary> /// </summary>
public virtual void OnConnected( Connection connection, ConnectionInfo data ) public virtual void OnConnected( Connection connection, ConnectionInfo info )
{ {
Connecting.Remove( connection ); Connecting.Remove( connection );
Connected.Add( connection ); Connected.Add( connection );
@ -89,7 +89,7 @@ namespace Steamworks
/// <summary> /// <summary>
/// The connection has been closed remotely or disconnected locally. Check data.State for details. /// The connection has been closed remotely or disconnected locally. Check data.State for details.
/// </summary> /// </summary>
public virtual void OnDisconnected( Connection connection, ConnectionInfo data ) public virtual void OnDisconnected( Connection connection, ConnectionInfo info )
{ {
SteamNetworkingSockets.Internal.SetConnectionPollGroup( connection, 0 ); SteamNetworkingSockets.Internal.SetConnectionPollGroup( connection, 0 );