Steam Community Viewer – Update 1

I released the first update to the Steam Community Viewer Windows 8 application.

Search for it in the Windows 8 Store or view it here.

Changes include:
- Pressing “Enter” will now submit searches on the main page
- Added link to Steam Store for specific deals in the Deals section
- Added ability to subscribe to Windows 8 Toast Notifications when friends come online or start playing a game (Settings Flyout -> Notifications)
- Added ability to subscribe to Windows 8 Live Tile Updates for the latest 5 deals based on SteamGameSales.com (Settings Flyout -> Notifications, US only right now)
- Various other bug fixes

Resolving the problem where “WADLogsTable” is not created in Windows Azure Diagnostics

I’ve been using Windows Azure to host a Worker Role in a Cloud Service for an in-development version of my new app, Steam Community Viewer. This service will allow users to be notified of when their friends come online or start playing a game through Windows 8 Toast Notifications. Additionally, it will push updates to Live Tiles for new Steam deals.

During my tests, I tried to turn diagnostics on, but failed to save them to a permanent storage because the table that gets created when you enable basic logging wasn’t actually being created! Windows Azure Basic Logs will be saved in Azure Storage Tables under “WADLogsTable” based on a logging level (error, critical, verbose, etc…). This table is supposed to be automatically created when the service is uploaded and deployed with tracing enabled. If you find that the official Windows Azure documentation on using diagnostics is not helping you with this task, try the code below in your service OnStart() overload.

// instantiate and add a new diagnostic monitor trace listener
// before doing this, you should make sure no listeners are defined in your web.config or app.config
var tempListener = new DiagnosticMonitorTraceListener();
Trace.Listeners.Add(tempListener);

// creates a diagnostic manager instance based on an azure storage account
// before doing this, setup a storage account using the azure web portal
string connectionStringName = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
var storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(connectionStringName));
var roleInstanceDiagnosticManager = storageAccount.CreateRoleInstanceDiagnosticManager(RoleEnvironment.DeploymentId,
RoleEnvironment.CurrentRoleInstance.Role.Name, RoleEnvironment.CurrentRoleInstance.Id);

// setup the basic logging configuration options
// ScheduledTransferPeriod is how often the trace log is copied to the storage account tables
// ScheduledTransferLogLevelFilter is the filter on the messages to copy
// BufferQuotaInMB is how much space is available to the local buffer (when limit is reached, old data is purged)
var config = roleInstanceDiagnosticManager.GetCurrentConfiguration();
config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);
config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Undefined;
config.Logs.BufferQuotaInMB = 5;

// setup the windows event log configuration options
// adds the System and Application level windows event logs to the sources
// other options are the same as the basic logging
config.WindowsEventLog.DataSources.Add("System!*");
config.WindowsEventLog.DataSources.Add("Application!*");
config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1.0);
config.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Undefined;
roleInstanceDiagnosticManager.SetCurrentConfiguration(config);

Some Useful git Commands

git status
shows pending changes that can be added to repo

git add -A
adds all pending changed files to pending commit list

git commit -a -m “Message”
commits all pending additions to the current branch with a message of “Message”

git push
pushes current branch to default remote

git push {branch name} {remote repo name}
pushes {branch name} changes to {remote repo name}

git reset {file name}
resets a file back to previous state after adding to pending commit list

git branch {branch name}
creates a branch named {branch name}

git checkout {branch name}
switches to a branch named {branch name}

git checkout -b {branch name}
creates and switches to a branch named {branch name}

git remote add {remote repo name} {remote repo uri}
adds a reference to a remote repo that can be pushed to

Introducing the Steam Community Viewer

In my free time, I’ve been developing a Windows 8 app to view Steam-related information (news, deals, community profiles). I just got notification that my new app was approved and listed on the Windows 8 store.

You can search for it directly in the Windows Store or see it online.

A brief description of the app is below:

The Steam Community Viewer allows users to search for Steam Community profiles to view profile details, game lists, game statistics, achievements, friend lists, group lists, and more. All data is obtained through public and Valve supplied methods. This application is not associated with Valve Software.

This is just a first release, but I’m hoping to add a lot more functionality as I continue to develop it.

Make sure to use the support email address listed in the store if you need any assistance. Additionally, you can tweet me @babelshift.

Steam Community Viewer Privacy Policy

The Steam Community Viewer allows users to search for Steam Community profiles to view profile details, game lists, game statistics, achievements, friend lists, group lists, and more. All data is obtained through public and Valve supplied methods. This application is not associated with Valve Software.

All data is made available through Valve provided interfaces. I do not own any of the data provided through this application. Except for your Steam ID, this application does not store, collect, or share any data that you enter or retrieve through its use. Data is not tampered with between retrieval and display except for formatting purposes. Your Steam ID is only stored if you enable “Friend Notifications” in the “Notifications” tab of the “Settings Flyout”. When you disable “Friend Notifications”, your Steam ID is immediately removed from storage.

This application does not provide any means of managing the your profile data because your profile data is not owned by the developers of this application. The only way to modify your profile data presented in this application is to modify your profile through the official Steam application or website.

Porting a Game from XNA 4.0 to MonoGame 3.0 for Windows 8 Store

It’s fairly certain that Microsoft won’t be supporting XNA for non-Windows Phone platforms, so I decided to take some time to port my game to MonoGame. Just recently, the MonoGame team has released MonoGame 3.0 which includes full support for the Windows 8 Store. Follow these meager instructions to get yourself started with doing that. If you’re lucky like I was, there’s a chance that your code is almost a 100% carry-over to the MonoGame libraries.

  1. Download MonoGame 3.0 Installer
  2. Create New MonoGame Project for Windows 8 Store
    • Using Visual Studio 2012, create a new MonoGame project under Visual C# –> MonoGame –> MonoGame Game
  3. Manually Copy Code and Change References
    • Make sure MonoGame is referenced using the Windows 8 lib at C:\Program Files (x86)\MonoGame\v3.0\Assemblies\Windows8\MonoGame.Framework.Windows8.dll
    • Copy classes and files to the new project so that it mirrors the hierarchy of your XNA 4.0 project
    • Any libraries that are referenced which were compiled against the full .NET Framework will need to be recompiled against the .NET Core Framework (a subset of the .NET Framework that Windows Store Apps will reference)
    • Compile and fix any errors generated because of references to things that are no longer supported by Windows Store
    • Copy serialized .xnb files manually to the output directories of your MonoGame project (this is required because the Content Pipeline is not supported in Visual Studio 2012)

Some of the errors that I got were references to Close() method calls on streams (removed in .NET Core) and setting DTD validation on XmlStreams (also removed in .NET Core). See the link in the references section for an overview of the changes in .NET Core. Also, MSDN will have little green bag icons next to anything that is supported in the Window Store.

References:

http://msdn.microsoft.com/en-us/library/windows/apps/br230302.aspx

How to get supported display modes using SharpDX

Below is a short bit of code that will use SharpDX to enumerate the valid display modes on all adapters (video cards) and all outputs (monitors) for the computer that is hosting the application.

There are a few caveats with this:

  • Do not run this if you are using the Windows RT device simulator from Visual Studio 2012 or you will get exceptions (remote/virtualized instances aren’t supported by some of the DirectX used here)
  • This only shows interlaced and scaling display modes (there are Stereo and StereoDisabled modes for some outputs)
  • Keep in mind that this is every adapter and output on your computer, so if you want just the default adapter, you’ll have to make some changes
  • Windows Store Apps are always in full screen, so any display mode that you apply to the active device where the resolution is less than the desktop resolution is going to look stretched (there are reasons to do this, however)
SharpDX.DXGI.Factory1 dxgiFactory = new SharpDX.DXGI.Factory1();
foreach (var dxgiAdapter in dxgiFactory.Adapters)
{
    foreach (var output in dxgiAdapter.Outputs)
    {
        foreach (var format in Enum.GetValues(typeof(SharpDX.DXGI.Format)))
        {
            var displayModes = output.GetDisplayModeList(
                (SharpDX.DXGI.Format)format,
                SharpDX.DXGI.DisplayModeEnumerationFlags.Interlaced
                | SharpDX.DXGI.DisplayModeEnumerationFlags.Scaling
            );

            foreach (var displayMode in displayModes)
            {
                if (displayMode.Scaling == SharpDX.DXGI.DisplayModeScaling.Unspecified)
                {
                    int displayWidth = displayMode.Width;
                    int displayHeight = displayMode.Height;
                    Rational displayRefresh = displayMode.RefreshRate;
                }
            }
        }
    }
}

References: