<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>XNA Game talk to Website</title>
		<link>http://rbwhitaker.wikidot.com/forum/t-1163600/xna-game-talk-to-website</link>
		<description>Posts in the discussion thread &quot;XNA Game talk to Website&quot; - How to make a game post and get highscores to/from a website?</description>
				<copyright></copyright>
		<lastBuildDate>Mon, 20 Jul 2026 19:50:43 +0000</lastBuildDate>
		
					<item>
				<guid>http://rbwhitaker.wikidot.com/forum/t-1163600#post-2264234</guid>
				<title>Re: XNA Game talk to Website</title>
				<link>http://rbwhitaker.wikidot.com/forum/t-1163600/xna-game-talk-to-website#post-2264234</link>
				<description></description>
				<pubDate>Sun, 05 Apr 2015 03:29:42 +0000</pubDate>
				<wikidot:authorName>PiscesMike</wikidot:authorName>				<wikidot:authorUserId>1721619</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hey TurboMax!<br /> I must say, you've actually picked one of the most pain in the butt things I've ever actually accomplished. So, first things first: Sounds like you've registered the Domain Name (TurboMax.com?). You'll need to check that account out and see if you have web hosting included. Some sites allow you to rent server space and processor time, while others only handle the name registration (DNS registration). If you don't have included hosting, you'll either have to pay a monthly fee to rent space/time, or provide your own server. Personally, I set up an old computer in my house for my server, and it worked great. That took a lot of tinkering with, but if you choose this path I could probably be some help. Anywho's&#8230; registration is only the first part. Hosting, as mentioned before is where the actual code and data that make the site work reside. Once you've got that figured out, you're going to need to do some coding. Each website has a back end, and a front end. The back end is the code that makes things happen on the webpage, and the front end is what the user actually sees as the 'webpage'. When a user types in a website address such as: <a href="https://www.youtube.com/watch?v=Ha-6MAlSG5M">https://www.youtube.com/watch?v=Ha-6MAlSG5M</a>, they are 'issuing' a 'GET request'. That simply means, lets look at this! So, get is pretty self explanatory. The other thing you can do is a 'POST request'. That's the opposite of GET. It's telling the server computer, hey, this is important. This is information you need, and you need to do something with it.<br /> RBWhitaker demonstrated how to read and write to the website in C#, and from what I understand now, the server code that you use can be any language (as long as the host computer can process it).</p> <p><a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface">http://en.wikipedia.org/wiki/Common_Gateway_Interface</a></p> <p>So,</p> <ol> <li>find/setup hosting</li> <li>create your CGI code (any language)</li> <li>publish!</li> </ol> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://rbwhitaker.wikidot.com/forum/t-1163600#post-2264066</guid>
				<title>Re: XNA Game talk to Website</title>
				<link>http://rbwhitaker.wikidot.com/forum/t-1163600/xna-game-talk-to-website#post-2264066</link>
				<description></description>
				<pubDate>Sat, 04 Apr 2015 21:30:42 +0000</pubDate>
				<wikidot:authorName>rbwhitaker</wikidot:authorName>				<wikidot:authorUserId>88099</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Oh, by the way, <tt>WebClient</tt> is in the <tt>System.Net</tt> namespace, so you'll have to add a using directive at the top of your file for it:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">using</span><span class="hl-code"> </span><span class="hl-identifier">System</span><span class="hl-code">.</span><span class="hl-identifier">Net</span><span class="hl-code">;</span></pre></div> </div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://rbwhitaker.wikidot.com/forum/t-1163600#post-2264065</guid>
				<title>Re: XNA Game talk to Website</title>
				<link>http://rbwhitaker.wikidot.com/forum/t-1163600/xna-game-talk-to-website#post-2264065</link>
				<description></description>
				<pubDate>Sat, 04 Apr 2015 21:29:56 +0000</pubDate>
				<wikidot:authorName>rbwhitaker</wikidot:authorName>				<wikidot:authorUserId>88099</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi TurboMax!</p> <p>There are probably a million ways to do this, but I suppose in my head the most natural starting point is to use the <tt>WebClient</tt> class that's a part of the .NET Framework. It allows you to download the contents retrieved from a particular URL (using an HTTP GET), and send stuff back using an HTTP POST.</p> <p>An example of this might look like:</p> <div class="code"> <div class="hl-main"> <pre><span class="hl-identifier">WebClient</span><span class="hl-code"> </span><span class="hl-identifier">client</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">WebClient</span><span class="hl-brackets">()</span><span class="hl-code">; </span><span class="hl-identifier">string</span><span class="hl-code"> </span><span class="hl-identifier">text</span><span class="hl-code"> = </span><span class="hl-identifier">client</span><span class="hl-code">.</span><span class="hl-identifier">DownloadString</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">http://www.google.com</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">Console</span><span class="hl-code">.</span><span class="hl-identifier">WriteLine</span><span class="hl-brackets">(</span><span class="hl-identifier">text</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">client</span><span class="hl-code">.</span><span class="hl-identifier">UploadString</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">URL_HERE</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">new high scores</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre></div> </div> <p>Obviously, there's got to be some server-side work as well, to pick up the submitted scores and merge them in to the official list of high scores for everyone else to download, but that would be a starting point.</p> <p>I might suggest having it be a URL that expects something in the JSON format, instead of HTML, and same on the upload. There are a lot of libraries out there for the web that will easily turn JSON into actual objects, and vice versa.</p> <p>I realize that's not a complete end-to-end solution for you. It's missing a lot of details. But perhaps it gets you started.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://rbwhitaker.wikidot.com/forum/t-1163600#post-2264020</guid>
				<title>XNA Game talk to Website</title>
				<link>http://rbwhitaker.wikidot.com/forum/t-1163600/xna-game-talk-to-website#post-2264020</link>
				<description></description>
				<pubDate>Sat, 04 Apr 2015 19:52:05 +0000</pubDate>
				<wikidot:authorName>TurboMax</wikidot:authorName>				<wikidot:authorUserId>2117597</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I am writing a XNA game which is stand-alone, but I'd like to include an option to share the highscores. So I'd think I'd build in a function that gets the current high score file from a website when online, else use the ladt succesfully downloaded highscore info. Then when the game is finished, the new highscore file should be uploaded to the URL. Ideally I should have a file locking mechanism so not two players can upload a new file at the same time, but I don't expect my game to be so massively popular that the risk of this happening is very big.</p> <p>I have registered a URL aleady, but have no clue how to proceed, gathering info now.</p> <p>Any input is welcome. Thanks.</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>