php
I should not put everything in the title, it leaves me nothing to post in here.
Well, if you're remotely interested in game studies, you might want to check out eludamos's new issues, where you might find articles about World of Warcraft, Call of Duty, GTA IV as well as Dragon Age: Origins and Mass Effect 2. And as an added bonus: hyper-ludicity, contra-ludicity, the magic circle and the mundane circle.
Found, of course, via Jesper Juul.
Writing Serialised Data to a String Instead of a File in C#
Instead of writing the serialised data to a file, which can be done using using (Stream s = File.Create("foo.xml")), you might want to have just the string – maybe because you want to send it to a server? You can use the StringWriter class to do so:
string data; using (StringWriter stream = new StringWriter()) { xs.Serialize (stream, foo); data = stream.ToString(); }
Uploading Data to a Server in Unity 3D
Unfortunately, you can't directly upload data to server in Unity 3D. Instead, you have to write some sort of wrapper script that resides on the server.
Since you can create POST variables in Unity, you can mainly work with those in your script.
A very simple, preliminary implementation could look like this:
concierge.php
<?php //concierge.php resides on the server – and might not be written so nicely, // my PHP skills are rusty. if ($_POST['action'] == 'save') { // Needs to be rewritten to add folders when they don't exist // – otherwise, fileputcontents will silently fail. file_put_contents('./'. $_POST['type'] . '/save.xml', stripslashes($_POST['data'])); } else if ($_POST['action'] == 'load') { $data = file_get_contents($_POST['type'].