Fixed server interfaces

This commit is contained in:
Garry Newman 2020-02-23 08:57:25 +00:00
parent 011c596cb1
commit ffa48fb03c
4 changed files with 42 additions and 0 deletions

View File

@ -97,6 +97,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="FriendsTest.cs" />
<Compile Include="GameServerStatsTest.cs" />
<Compile Include="InputTest.cs" />
<Compile Include="NetworkingSockets.cs" />
<Compile Include="NetworkingSocketsTest.TestConnectionInterface.cs" />

View File

@ -107,6 +107,7 @@
<Compile Include="SteamNetworkingTest.cs" />
<Compile Include="UgcTest.cs" />
<Compile Include="UgcEditor.cs" />
<Compile Include="GameServerStatsTest.cs" />
<Compile Include="UserTest.cs" />
<Compile Include="UserStatsTest.cs" />
<Compile Include="UgcQuery.cs" />

View File

@ -0,0 +1,32 @@
using System;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Steamworks.Data;
namespace Steamworks
{
[TestClass]
[DeploymentItem( "steam_api64.dll" )]
[DeploymentItem( "steam_api.dll" )]
public class GameServerStatsTest
{
static SteamId Garry = 76561197960279927;
[TestMethod]
public async Task GetAchievement()
{
var result = await SteamServerStats.RequestUserStats( Garry );
Assert.AreEqual( result, Result.OK );
var value = SteamServerStats.GetAchievement( Garry, "COLLECT_100_WOOD" );
Assert.IsTrue( value );
value = SteamServerStats.GetAchievement( Garry, "ACHIVEMENT_THAT_DOESNT_EXIST" );
Assert.IsFalse( value );
}
}
}

View File

@ -93,6 +93,14 @@ namespace Steamworks
Dispatch.ServerPipe = SteamGameServer.GetHSteamPipe();
AddInterface<SteamServer>();
AddInterface<SteamUtils>();
AddInterface<SteamNetworking>();
AddInterface<SteamServerStats>();
//AddInterface<ISteamHTTP>();
AddInterface<SteamInventory>();
AddInterface<SteamUGC>();
AddInterface<SteamApps>();
AddInterface<SteamNetworkingUtils>();
AddInterface<SteamNetworkingSockets>();