2016-07-18 18:01:52 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
|
|
|
|
|
namespace Facepunch.Steamworks.Test
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
2016-10-04 13:24:55 +03:00
|
|
|
|
[DeploymentItem( Config.LibraryName + ".dll" )]
|
2016-07-18 18:01:52 +03:00
|
|
|
|
[DeploymentItem( "steam_appid.txt" )]
|
|
|
|
|
public class Stats
|
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void UpdateStats()
|
|
|
|
|
{
|
|
|
|
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
|
|
|
|
{
|
|
|
|
|
client.Stats.UpdateStats();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void UpdateSUpdateGlobalStatstats()
|
|
|
|
|
{
|
|
|
|
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
|
|
|
|
{
|
|
|
|
|
client.Stats.UpdateGlobalStats( 1 );
|
|
|
|
|
client.Stats.UpdateGlobalStats( 3 );
|
|
|
|
|
client.Stats.UpdateGlobalStats( 7 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetClientFloat()
|
|
|
|
|
{
|
|
|
|
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
|
|
|
|
{
|
|
|
|
|
var v = client.Stats.GetFloat( "deaths" );
|
|
|
|
|
Console.WriteLine( v );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetClientInt()
|
|
|
|
|
{
|
|
|
|
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
|
|
|
|
{
|
|
|
|
|
var v = client.Stats.GetInt( "deaths" );
|
|
|
|
|
Console.WriteLine( v );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetGlobalFloat()
|
|
|
|
|
{
|
|
|
|
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
|
|
|
|
{
|
|
|
|
|
var v = client.Stats.GetGlobalFloat( "deaths" );
|
|
|
|
|
Console.WriteLine( v );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void GetGlobalInt()
|
|
|
|
|
{
|
|
|
|
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
|
|
|
|
{
|
|
|
|
|
var v = client.Stats.GetGlobalInt( "deaths" );
|
|
|
|
|
Console.WriteLine( v );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|