<commit_before>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Facepunch.Steamworks.Test
{
    [DeploymentItem( "steam_api.dll" )]
    [DeploymentItem( "steam_api64.dll" )]
    [DeploymentItem( "steam_appid.txt" )]
    [DeploymentItem( "tier0_s.dll" )]
    [DeploymentItem( "vstdlib_s.dll" )]
    [DeploymentItem( "steamclient.dll" )]
    [DeploymentItem( "tier0_s64.dll" )]
    [DeploymentItem( "vstdlib_s64.dll" )]
    [DeploymentItem( "steamclient64.dll" )]
    [TestClass]
    public partial class Server
    {
        [TestMethod]
        public void Init()
        {
            using ( var server = new Facepunch.Steamworks.Server( 252490, 30002, 30003, false, "VersionString" ) )
            {
                Assert.IsTrue( server.IsValid );
            }
        }

        [TestMethod]
        public void PublicIp()
        {
            using ( var server = new Facepunch.Steamworks.Server( 252490, 30002, 30003, false, "VersionString" ) )
            {
                server.LogOnAnonymous();

                Assert.IsTrue( server.IsValid );

                while ( true )
                {
                    var ip = server.PublicIp;

                    if ( ip == null )
                    {
                        System.Threading.Thread.Sleep( 100 );
                        server.Update();
                        continue;
                    }

                    Assert.IsNotNull( ip );
                    Console.WriteLine( ip.ToString() );
                    break;
                }

            }
        }

        [TestMethod]
        public void AuthCallback()
        {
            using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
            {
                Assert.IsTrue( client.IsValid );
                var ticket = client.Auth.GetAuthSessionTicket();
                var ticketBinary = ticket.Data;

                using ( var server = new Facepunch.Steamworks.Server( 252490, 30002, 30003, true, "VersionString" ) )
                {
                    server.LogOnAnonymous();
<commit_msg>Fixed server tests not binding to a proper ip<commit_after>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Facepunch.Steamworks.Test
{
    [DeploymentItem( "steam_api.dll" )]
    [DeploymentItem( "steam_api64.dll" )]
    [DeploymentItem( "steam_appid.txt" )]
    [DeploymentItem( "tier0_s.dll" )]
    [DeploymentItem( "vstdlib_s.dll" )]
    [DeploymentItem( "steamclient.dll" )]
    [DeploymentItem( "tier0_s64.dll" )]
    [DeploymentItem( "vstdlib_s64.dll" )]
    [DeploymentItem( "steamclient64.dll" )]
    [TestClass]
    public partial class Server
    {
        [TestMethod]
        public void Init()
        {
            using ( var server = new Facepunch.Steamworks.Server( 252490, 0, 30003, 30004, 30005, false, "VersionString" ) )
            {
                Assert.IsTrue( server.IsValid );
            }
        }

        [TestMethod]
        public void PublicIp()
        {
            using ( var server = new Facepunch.Steamworks.Server( 252490, 0, 30003, 30004, 30005, false, "VersionString" ) )
            {
                server.LogOnAnonymous();

                Assert.IsTrue( server.IsValid );

                while ( true )
                {
                    var ip = server.PublicIp;

                    if ( ip == null )
                    {
                        System.Threading.Thread.Sleep( 100 );
                        server.Update();
                        continue;
                    }

                    Assert.IsNotNull( ip );
                    Console.WriteLine( ip.ToString() );
                    break;
                }

            }
        }

        [TestMethod]
        public void AuthCallback()
        {
            using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
            {
                Assert.IsTrue( client.IsValid );
                var ticket = client.Auth.GetAuthSessionTicket();
                var ticketBinary = ticket.Data;

                using ( var server = new Facepunch.Steamworks.Server( 252490, 0, 30002, 30003, 30004, true, "VersionString" ) )
                {
                    server.LogOnAnonymous();

{'fraction_non_alphanumeric': 0.10283018867924529, 'fraction_numerical': 0.035849056603773584, 'mean_word_length': 1.461404526987812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4543074', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1169, 'n_words': 230}