From NINA Wiki
Jump to navigation Jump to search

Convert from markdown:

Here is some information on the inner workings of MSN Messenger Activities.

## How it works

The `MsgrConfig` XML that is retrieved from the Escargot server contains 3 Activity-related URLs:


The App Directory Service is a SOAP service. It's mainly used for loading Activity info and starting with MSN 7.0, loading featured Activities. Along with that, its WSDL (the XML interface definition XML that describes the SOAP service's requests and responses) is available to read at this archived link from the Wayback Machine:

There is also some information regarding the `Entry` node defined by the WSDL here:

Here's part of the Activity documentation from the "Windows Live Messenger Activity SDK" MSDN page:

The SDK itself is available here, archived on the Wayback Machine too:

## The App Directory

### MSN 6

The App Directory page (The pane that was loaded when you clicked on the "Activities" button in 6.0 - 6.2) is archived on the Wayback Machine as well:

Speaking of which, it needs 5 images it uses for its layout:<br/><br/><br/><br/>

Our understanding of how this page worked is when a user clicked on the "Activities" menu:

1. Because the `Activities` menu is actually an HTML page, a JavaScript function would transmit the Activity ID to MSN Messenger (via `window.external`). 

2. MSN Messenger would query the App Directory SOAP Service using the `GetAppEntry` method with the requested Activity ID as a parameter.

3. The App Directory SOAP Service will reply with info from the `Entry` node, which also includes the URL field which should be the URL tied to the Activity ID.

4. MSN Messenger enlarges the chat window and loads the URL as a web page to the right of the chat pane.

### MSN 7

Starting with MSN 7.0, application entries are `POST`ed from the App Directory service using the SOAP service `GetFilteredDataSet2`. Before it does that however, it queries an App Directory page named `GetAppdirVersion.aspx` which contains random data. This is then cached and treated as a flag that determines whether MSN will query the SOAP service or not. If MSN queries the page and finds out its data is the same as the copy it's cached before, it will refuse to call the SOAP service directly and show the entry results it obtained last time unless you clear IE's cache. 

The `GetFilteredDataSet2` service doesn't have clear documentation anywhere online, but a few people from our development team have been able to piece together what the response is probably supposed to be. The response is a DiffGram with a `DataInstance` named `NewDataSet` that contains numerous `Entry` and `Category` nodes. An example `Category` node is shown below:

<Category diffgr:id="Category1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
  <CategoryIconURL>ICON_URL</CategoryIconURL> <!-- Optional -->
  <CategoryDescription>Description</CategoryDescription> <!-- Optional -->

MSN will then organize the entries by application type (Activity or Game) and then by category to display to the user. When a user clicks on an item, the client will query and load the activity with the `GetAppEntry` SOAP method on the same App Directory service in the same manner MSN 6 does.

### WLM 8+

The services WLM 8+ use for the App Directory aren't dissimilar to the ones MSN 7 uses and use the same App Directory service. However, there are three differences to how WLM carries out the calls. First, it doesn't query the `GetAppdirVersion.aspx` page before calling the SOAP service anymore, so no more caching. Second, instead of using `POST`, it uses `GET`, and arguments are passed as query string parameters in the URL. The response this version of the service returns is different in that the root node (the name of this varies on the service called) has two attributes, `code` and `ver`. `code` is the bitwise code of the operation's status, and has to AND with `2` (or `3`?) in order for WLM to consider the response successful. `ver` is just the `ver` query parameter passed through when calling the service.

`GetFilteredDataSet2`'s response has a root node named `AppDir` that contains the `Entry` and `Category` nodes like the DiffGram. `GetAppEntry`'s response has a root node named `Entry` that contains the entry info. Other than that, there aren't many differences with the WLM version of the App Directory service.

### WLM 2009+

The Activities tab and webservices for WLM 2009 and onward haven't changed at all. However, a new MsgrConfig setting is introduced named `GamesBrowserURL` that when present, makes the Games tab in a conversation window open a pane to the right side of it (as if it were loading an Activity) with the URL specified in the setting. This is supposed to be a page with all the MSN games listed on it, and a screenshot of how it looked in '09 is shown below:


This Games window also persisted in 2011/2012 with little changes:


(There was also an unrelated Games tab in 2011/2012 that essentially acted as a bigger portal for games and activity related to them, but that is possibly a more complicated topic that we won't touch here)

For the page set by `GamesBrowserURL`, the designated browser that loads the page doesn't contain any internal functions to aid in loading any Activities, and it's most likely the original page utilized a separate ActiveX control (`MSNMessenger.P4QuickLaunch`) to do this. Regardless, we believe this works in a similar manner to the App Directory page loaded in MSN 6: ActiveX control has a function that triggers WLM to query info about an Activity -> WLM calls App Directory service to get Activity info -> WLM loads Activity

## Activities

### File Sharing

Funnily enough, this activity is also archived on the Wayback Machine:

It requires an ActiveX control, which is the meat of the Activity: The HTML page also references a background image named `background.jpg`, but it is unknown what this image was or if it was important to the interface of the activity.

(If you want to test this Activity, just know that this page loads on Internet Explorer only, as it requires an ActiveX control, as stated before. One of the Escargot devs, tristanleboss, tested it with IE 11 under Windows 7, and works without fail. If you load it on Firefox or Chrome, the page will be blank due to their obvious lack of ActiveX support)

Unfortunately, with this activity, it crashes WLM 8+ clients, so it only works with peers using versions up to 7.5. Not that it makes much of a difference as Sharing Folders were introduced by WLM 8 anyway.

### Tic-Tac-Toe

This Activity, out of all the Activities we've found, is an interesting find, as it's actually an HTML/JavaScript game. No ActiveX! This can be a good start for debugging Activities.

Here is the Activity's HTML page, along with (almost all of) its components:<br/><br/><br/><br/><br/>

It's only missing both the `redoanim.gif` image in the `images` directory and the `grid.gif` image in the main directory.

`redoanim.gif` was a 65x70 GIF file and `grid.gif` was a 210x210 GIF file. Both files luckily exist in an MSN Activity sandbox program as part of a sample Tic Tac Toe game, which is available for download [here](

In terms of other activities, we've found Bankshot, Chess, Minesweeper, Solitaire Showdown, Upwords, and WoF so far, which are all MSN Games Activites (more on that in a second). Those all use ActiveX controls that load the game components and code needed to allow communication between the game and the Activity API. We also found Media Player and Photo Swap, along with some other Activities, but they lack some crucial files.

### MSN Games Activities

The typical URL that was used to host these Activities was ` code)/(game code)/`

At least 2 ActiveX controls are involved, with those controls being:
- ``: Preloads other ActiveX controls
- ``: Links the MSN Games game and MSN Messenger together so that they can interface with each other.

These 2 ActiveX controls will install, but they won't start if the domain name they are activated from doesn't end with ``.

Sometimes, a game will require an additional ActiveX control for its game logic, but they mainly used a Flash file, usually  named `(game code).swf` for their user interface. This Flash file is loaded by another Flash file named `AdLoader.swf`.

Some games try to load additional XML files, but with the help of SWF decompilers, like Sothink, you can read the ActionScript embedded inside to closely emulate their node structures.

Here is the loading order for a typical MSN Games game:

    - outerframe.aspx
    --- gateway.aspx
    ----- main.aspx
    ------- buddylist.aspx
    ------- help.aspx
    ------- about.aspx
    ------- LoadAd.aspx
    ------- preloader.aspx?Version=2
    ------- msngame.aspx (THE GAME)
    --------- AdLoader.swf
    ------------ (game code).swf
    --------- GameEndTVProxy.aspx
    ------- IntermissionAd.aspx
    ----- PremiumAccessStatus.aspx

Globally, these files are the same for each game (if you skip language strings and small things like game code, etc.), except for `msngame.aspx`, which is the main game file that contains game-specific code.

Unfortunately, this specific `msngame.aspx` file has been poorly preserved on the Wayback Machine, and only 10 copies of it are available, covering only 5 games:

Solitaire Showdown:<br/>


"MJS2" (don't know the official name for this):<br/>

Minesweeper Flags:<br/>