MBZ
MBZ

Reputation: 27592

Creating an online high score table

I want to create a very simple online high score table for my recently developed game in Windows 8 (C# and XAML).

What's the easiest and fastet way to do this?

Upvotes: 1

Views: 1464

Answers (6)

Denis
Denis

Reputation: 4115

Xbox live services have leader-boards support. Since you have a Win8 game you should look at this video from //build 2012 : Building Cross-Device Xbox Games, they get into useful details around 30 min into the video.

Upvotes: 0

Eldho
Eldho

Reputation: 8273

use service , or httpclient to update the score

Upvotes: 0

Jim O'Neil
Jim O'Neil

Reputation: 23764

WITHOUT A DOUBT WINDOWS AZURE MOBILE SERVICES, and yes I'm shouting :)

All of the infrastructure you need is provided in the cloud, and you get a client SDK that makes recording the score literally a one-liner. Take a look a my blog post on doing exactly this (along with incorporating push notifications). The post covers an HTML 5/JavaScript game, but I think you'll easily be able to translate to C#/XAML.

Windows Azure Mobile Services is free*, you can get access with the Windows Azure 3-month trial offer, and after that expires you're service remains free (although you will pay for data, in your case probably $5 a month)

Upvotes: 5

mattypiper
mattypiper

Reputation: 1232

If you're used to C#, build an ASP.NET MVC web application. You can develop and test this locally without going live. MVC may have a tough learning curve, but it's a great framework, and uses technologies you may already be familiar with as a C# coder, such as Linq. You need a database, and Visual Studio should help you get started with all of this.

You want a post or get controller action, with a url like http://server.com/scores/player1. An HTTP GET on that url could return the view of the scores, whereas a post to that url with parameters of, say, difficulty=easy and score=1100.

Your game client could use either WebClient (simpler) or HttpWebRequest for finer control. Build a class that encapsulates the scoring interaction, with a method that can get all high scores, and another method that sends a new score to the scoring server with args playername and score.

Get that up and going as a demo on your localhost, then maybe think about how to restrict players from posting their own scores, like having the game client authenticate with the server.

Upvotes: 1

DotNetRussell
DotNetRussell

Reputation: 9857

The first thing you need is a server that is up ALL the time and able to handle the traffic. I use Godaddy hosting. Its cheap and great service and easy to ftp to.

Next you need a php page.

The php page should grab GET data out of the URL regarding the score and user info

There are a couple ways you can implement the score recording. 1. You could have the receiving php page alter and sort a master file that contains a userid and score list 2. You could have the receiving php page save a unique txt file for each player id and stick their score in it. Then when your app calls for the scores it can pull all of the txt files and sort them on the phone.

Personally I prefer way one.

Finally you need a domain name that you can point your app too. You will need a directory for sending info and one for receiving.

I glossed over a TON of stuff. An experienced developer could do this in a day. To debug it though it would take some time. Good luck

Upvotes: 1

solusipse
solusipse

Reputation: 587

I would use HttpClient and simple PHP script that would be reciving scores with post method and second one that would be displaying these scores.

Upvotes: 1

Related Questions