Silverlight Multiplayer Pokerroom

  • nederlands
22 02 2008

Finally, after a few weeks of very hard work I’m back.

The last few weeks were about my Silverlight Multiplayer Pokerroom, a technical showcase that tries to show what can be done with Silverlight 1.1/2.0 and Silverlight Multiplayer PokerRoomASP.NET 3.5.

An application, with multiple poker tables. In which users on different computers, on different sides of the world, can play poker and chat with each other.

And when there is no one around to play with you can always add a "bot". (Type /help in the chat for more info).

You do have to create your own account before you can start playing. But because it only requires you to enter a username, password and e-mail address, this should take you no time at all.

It has been tested to work on IE6+7 and Firefox on windows.

Some of the more advanced poker rules are not implemented (sidepots, all-in, etc…),  so expect it to behave strangely when this happens.

It still contains a few bugs, that is why the application is recycled every 120 minutes.

The game should keep you busy for a while and hopefully it will get some people "into the light " ;-).

Design & 2.0

Silverlight Multiplayer PokerRoomI’m in the process of getting a real designer to redesign the pokerroom, and in a few weeks (probably after Mix) the application has to be made compatible with Silverlight 2.0.

More suggestions are always welcome, please use the contact form. I’ll keep you all posted on the progress.

Geek

As a true geek, there are is some technical stuff I would like to highlight:

  • There is a real PokerHand comparer that can compare 11 billion hands per second ;-), totally useless of course, but just as fun.
  • The webservice calls are long running. Meaning that as long as there is no new data, they stay open and sleep. A very simple but effective way to minimize webservice calls. Hopefully I can replace this with a nice WCF solutions in 2.0.
  • The colors in the chatbox, were a hell of a job, but just look nice!.
  • When the server restarts or when the session goes away, the client app will recognize and restart itself.
  • The bot’s taunt you when they win money from you ;-)  (Altough it would be nice in the future if they used more than one taunt)

Links

Have fun playing poker, and see you at Mix!

Robertjan Tuit



Bookmarks, Pictures and Projects

  • nederlands
22 02 2008

Last week I have added a few things to my blog :

Pictures

I had prommised myself to put all the pictures, from the events I go to, onto Flickr. And because of a very nice WordPress plugin, these pictures are also available on my blog on the Pictures page. It also delivers a nice sidebar gadget showing some random pictures.

Projects

Until now I had no place to put some of my personal projects, for which I have created a Projects page.

Bookmarks

Recently I have started using del.icio.us to store interesting pages. And because I was already doing some work on my blog.

I only just realized that I just created 3 more places I have to keep up to date. Well, should have tought of that sooner :).

Robertjan Tuit



Silverlight 1.1/2.0 Alpha Timer

  • nederlands
4 02 2008

In silverlight 1.1/2.0 alpha there are a lot of things that just do not work as us spoiled developers would expect.

One of these things is the fact that a normal Timer event cannot access the UI Thread. Meaning you cannot change any visual things with a normal timer.

There are some fixes around, I added some of them together in a simple class u can use as seen in the following example:

public partial class Page : Canvas
{
    UITimer _Timer;
    public void Page_Loaded(object o, EventArgs e)
    {
        // Create a new UITimer
        _Timer = new UITimer(this); 

        // With a 10 seconds interval
        _Timer.Duration = new TimeSpan(0, 0, 10); 

        // And call this delegate every 10 seconds
        _Timer.TimerEvent += new EventHandler(_Timer_TimerEvent);
    } 

    void _Timer_TimerEvent(object sender, EventArgs e)
    {
        // Do something in the UI
        // Fore example: Set the opacity of the page
        Opacity = 0.5;
    }
}

The class itself looks like this:

using System.Windows;
using System;
using System.Windows.Media.Animation; 

public class UITimer
{
    static int TimerCount = 0; 

    private bool _Active = false;
    public bool Active
    {
        get
        {
            return _Active;
        }
        set
        {
            if (_Active != value)
            {
                _Active = value;
                if (_Active)
                {
                    timer.Duration = _Duration;
                    timer.Begin();
                }
                else
                    timer.Stop();
            }
        }
    } 

    private Duration _Duration;
    public Duration Duration
    {
        get { return _Duration; }
        set
        {
            _Duration = value;
            timer.Duration = _Duration;
        }
    } 

    public event EventHandler TimerEvent;
    Storyboard timer; 

    public UITimer(FrameworkElement rootElement)
    {
        timer = (Storyboard)XamlReader.Load(String.Format(“<Storyboard xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” x:Name=”UITimer_{0}” Duration=”00:00:00″ />”,UITimer.TimerCount));
        timer.Completed += new EventHandler(timer_Completed);
        rootElement.Resources.Add(timer);
        UITimer.TimerCount++;
    } 

    void timer_Completed(object sender, EventArgs e)
    {
        if (TimerEvent != null)
            TimerEvent(this, EventArgs.Empty);
    }
}

Source Code :  UITimer.zip

Light it up!

Robertjan Tuit



Silverlight Mopup Part 1 of Many

  • nederlands
3 02 2008

Because of time pressure writing new blog posts is something that’s nog going to happen right now. But I still read about a 1000 feeds in which, especially the last few weeks, a lot of nice new Silveright things show up.

That’s why of today I’ll irregularly post the “Silverlight Mopup”: a list of links to nice sites and articles about Silverlight

More on the next mopup

Robertjan Tuit



Mix08

  • nederlands
1 02 2008

It has been some time ago that I have seen the inside of Windows Live Writer. I have been terribly busy with a project for the Silverlight Challenge en currently still am. This is why I haven’t blogged as much is I usually do. Also the previously promised report about the Envision-Event trip will have to wait.

Why this blog post then, U ask? I would like to share with you the joy of having registered for the Mix08 in Vegas. An event you should not miss this year.

With the release of  Silverlight 2.0 (beta) and subjects as IE8, ASP.NET MVC, IIS7, WPF 3.5, Dynamic Data Controls and.NET 3.5, I’m very much looking forward to it.

And the fact that it is in Las Vegas is not bad either. I haven’t settled yet on the flying schedule, and the hotel.

Who else is going? and if you are, how did you arrange your flight schedule and your hotel, any tips that can help me? The Venetian is a bit to pricey for my taste.

Going to dive back into my Silverlight 1.1 Alpha project. The longer I work with it the more I’m looking forward to the 2.0 beta release.

Hope to see you in Vegas!

Robertjan Tuit