mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-05 10:10:46 +03:00
TestSocketInterface fix
This commit is contained in:
parent
5fd6de76d7
commit
ea1408392b
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using Steamworks.Data;
|
using Steamworks.Data;
|
||||||
@ -13,6 +14,8 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
public bool HasFinished = false;
|
public bool HasFinished = false;
|
||||||
|
|
||||||
|
public List<Connection> Connected = new List<Connection>();
|
||||||
|
|
||||||
public override void OnConnectionChanged( Connection connection, ConnectionInfo data )
|
public override void OnConnectionChanged( Connection connection, ConnectionInfo data )
|
||||||
{
|
{
|
||||||
Console.WriteLine( $"[Socket{Socket}][connection:{connection}][data.Identity:{data.Identity}] [data.State:{data.State}]" );
|
Console.WriteLine( $"[Socket{Socket}][connection:{connection}][data.Identity:{data.Identity}] [data.State:{data.State}]" );
|
||||||
@ -31,6 +34,8 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override void OnConnected( Connection connection, ConnectionInfo data )
|
public override void OnConnected( Connection connection, ConnectionInfo data )
|
||||||
{
|
{
|
||||||
|
Connected.Add( connection );
|
||||||
|
|
||||||
Console.WriteLine( $"" );
|
Console.WriteLine( $"" );
|
||||||
Console.WriteLine( $"Socket -> OnConnected:" );
|
Console.WriteLine( $"Socket -> OnConnected:" );
|
||||||
Console.WriteLine( $" data.Address: {data.Address}" );
|
Console.WriteLine( $" data.Address: {data.Address}" );
|
||||||
@ -52,7 +57,10 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override void OnDisconnected( Connection connection, ConnectionInfo data )
|
public override void OnDisconnected( Connection connection, ConnectionInfo data )
|
||||||
{
|
{
|
||||||
|
Connected.Remove( connection );
|
||||||
|
|
||||||
Console.WriteLine( $" - OnDisconnected" );
|
Console.WriteLine( $" - OnDisconnected" );
|
||||||
|
|
||||||
base.OnDisconnected( connection, data );
|
base.OnDisconnected( connection, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user