public static void SubmitOnline(string name, float speed, float time, HighscoreSubmitted callback) { const string url = "http://www.pillowdrift.com/swift/"; highscoreCallback = callback; System.Net.ServicePointManager.Expect100Continue = false; Recording current = GameRecorder.current; if (current != null) { // Encode recording to base 64 MemoryStream ms = new MemoryStream(); current.Write(ms); string recording = Convert.ToBase64String(ms.ToArray()); if (recording != "") { // Create POST request WWWForm form = new WWWForm(); form.AddField("name", name); form.AddField("level", current.levelName); form.AddField("recording", recording); form.AddField("time", time.ToString()); form.AddField("speed", speed.ToString()); WWW www = new WWW(url, form); form.AddField("Expect", ""); instance.StartCoroutine("WaitForSubmission", www); } } }
public static void SubmitOnline(string name, float speed, float time, HighscoreSubmitted callback) { const string url = "http://www.pillowdrift.com/swift/"; highscoreCallback = callback; System.Net.ServicePointManager.Expect100Continue = false; Recording current = GameRecorder.current; if (current != null) { // Encode recording to base 64 MemoryStream ms = new MemoryStream(); current.Write(ms); string recording = Convert.ToBase64String(ms.ToArray()); if (recording != "") { // Create POST request WWWForm form = new WWWForm(); form.AddField("name", name); form.AddField("level", current.levelName); form.AddField("recording", recording); form.AddField("time", time.ToString()); form.AddField("speed", speed.ToString()); WWW www = new WWW(url, form); form.AddField("Expect", ""); instance.StartCoroutine("WaitForSubmission", www); } } }