diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs
index 3bbb75f..09d6eac 100644
--- a/Facepunch.Steamworks/Client.cs
+++ b/Facepunch.Steamworks/Client.cs
@@ -52,6 +52,8 @@ public Client( uint appId )
//
Voice = new Voice( this );
+ Workshop.friends = Friends;
+
//
// Cache common, unchanging info
diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.csproj
index 5491fc7..ffc8d8b 100644
--- a/Facepunch.Steamworks/Facepunch.Steamworks.csproj
+++ b/Facepunch.Steamworks/Facepunch.Steamworks.csproj
@@ -30,8 +30,7 @@
TRACE
prompt
4
-
-
+ bin\Release\Facepunch.Steamworks.XML
true
diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Item.cs b/Facepunch.Steamworks/Interfaces/Workshop.Item.cs
index ebe6ea7..bc023c6 100644
--- a/Facepunch.Steamworks/Interfaces/Workshop.Item.cs
+++ b/Facepunch.Steamworks/Interfaces/Workshop.Item.cs
@@ -151,14 +151,27 @@ internal void UpdateState()
}
+ private int YourVote = 0;
+
+
public void VoteUp()
{
+ if ( YourVote == 1 ) return;
+ if ( YourVote == -1 ) VotesDown--;
+
+ VotesUp++;
workshop.ugc.SetUserItemVote( Id, true );
+ YourVote = 1;
}
public void VoteDown()
{
+ if ( YourVote == -1 ) return;
+ if ( YourVote == 1 ) VotesUp--;
+
+ VotesDown++;
workshop.ugc.SetUserItemVote( Id, false );
+ YourVote = -1;
}
public Editor Edit()
@@ -186,6 +199,29 @@ public Editor Edit()
public int WebsiteViews { get; internal set; }
public int ReportScore { get; internal set; }
public string PreviewImageUrl { get; internal set; }
+
+ string _ownerName = null;
+
+ public string OwnerName
+ {
+ get
+ {
+ if ( _ownerName == null && workshop.friends != null )
+ {
+ _ownerName = workshop.friends.GetName( OwnerId );
+ if ( _ownerName == "[unknown]" )
+ {
+ _ownerName = null;
+ return string.Empty;
+ }
+ }
+
+ if ( _ownerName == null )
+ return string.Empty;
+
+ return _ownerName;
+ }
+ }
}
}
}
diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs
index 482ee05..5c93487 100644
--- a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs
+++ b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs
@@ -46,6 +46,7 @@ public class Query : IDisposable
public int PerPage { get; set; } = SteamResponseSize;
internal Workshop workshop;
+ internal Friends friends;
private int _resultPage = 0;
private int _resultsRemain = 0;
diff --git a/Facepunch.Steamworks/Interfaces/Workshop.cs b/Facepunch.Steamworks/Interfaces/Workshop.cs
index 9b0946b..4238dcb 100644
--- a/Facepunch.Steamworks/Interfaces/Workshop.cs
+++ b/Facepunch.Steamworks/Interfaces/Workshop.cs
@@ -9,6 +9,7 @@ public partial class Workshop : IDisposable
internal const ulong InvalidHandle = 0xffffffffffffffff;
internal SteamNative.SteamUGC ugc;
+ internal SteamNative.Friends friends;
internal BaseSteamworks steamworks;
internal SteamNative.SteamRemoteStorage remoteStorage;
@@ -30,6 +31,7 @@ public void Dispose()
ugc = null;
steamworks = null;
remoteStorage = null;
+ friends = null;
OnFileDownloaded = null;
OnItemInstalled = null;
@@ -52,7 +54,8 @@ public Query CreateQuery()
return new Query()
{
AppId = steamworks.AppId,
- workshop = this
+ workshop = this,
+ friends = friends
};
}
diff --git a/Facepunch.Steamworks/Properties/AssemblyInfo.cs b/Facepunch.Steamworks/Properties/AssemblyInfo.cs
index 2229fc4..2988e93 100644
--- a/Facepunch.Steamworks/Properties/AssemblyInfo.cs
+++ b/Facepunch.Steamworks/Properties/AssemblyInfo.cs
@@ -8,9 +8,9 @@
[assembly: AssemblyTitle("Facepunch.Steamworks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Facepunch Studios Ltd")]
[assembly: AssemblyProduct("Facepunch.Steamworks")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]