Protocols/MSNP/Activities/Sandbox

From NINA Wiki
Jump to navigation Jump to search

The user "TheBlasphemer" posted, on the Social MSDN website, an Activity Sandbox tester.

This Activity Sandbox allows the developer to test their activity without using Messenger itself.

Download

You can get the Sandbox compressed file here: https://storage.nina.chat/nina/wiki/msnp/Sandbox.rar

How It Works

To make it work, replace "window.external" with the following method:

1 function GetExternal() {
2     if (typeof(window.external.Channel) != "undefined") {
3         return window.external;
4     } else {
5         return window.parent.control.GetExternal(window.name);
6     }	
7 }

What it does is check if we have a "window.external.Channel" type. If we do (aka is not "undefined"), use that window.external, if not, we are using the Sandbox, and use the faux-Sandbox one.

Notes

You should really really use Internet Explorer to test this. The Messenger ieframe emulates IE7-9, depending on the meta tags, and you should use that too.

Original Post

Hi,
I didn't want to send out xml files, bugger my friends to play, or do polygamy, so I decided to create a Sandbox for multiplayer testing :)
Currently it supports almost everything, except filetransfer, and the _NewEnum method of Users (how does it work anyway?)
To test your app in the sandbox youu will have to do some minor modifications:
First, do a simple search&replace replacing "window.external" with "GetExternal()"
Next, add the function GetExternal to your script, steal it from one of the added test-games.
Lastly, remove any unnecesarry headers, like doctype and meta stuff, somehow this f*cks up the script :P

Currently, all I've tested is a modified tictactoe, and joosts test (which is slightly bugged ;))

You can get the sandbox at: http://files.stuffplug.com/Sandbox.rar

Things I still want to implement:
- Forcing 2packets/second
- measuring max datatraffic
- add packet delay

If you use the sandbox, please give credit where credit is due ;)
and I would really appreciate some feedback....

Bye,
TB