public IEnumerator PlayerCharactersRoutine(IPlayerApi caller) { string uri = NetworkSettings.instance.BaseUri() + "/api/characters/list"; var form = new WWWForm(); form.AddField("playerId", NetworkSettings.instance.username); form.AddField("authtoken", NetworkSettings.instance.authtoken); WWW www = new WWW(uri, form.data, form.headers); yield return(www); if (www.error != null) { caller.OnPlayerCharactersError(www.error); } else { MemoryStream stream = new MemoryStream(www.bytes); Characters characters = Serializer.Deserialize <Characters>(stream); caller.OnPlayerCharacters(characters); } }
public IEnumerator PlayerCharactersRoutine(IPlayerApi caller) { string uri = NetworkSettings.instance.BaseUri() + "/api/characters/list"; var form = new WWWForm(); form.AddField("playerId", NetworkSettings.instance.username); form.AddField("authtoken", NetworkSettings.instance.authtoken); WWW www = new WWW(uri, form.data, form.headers); yield return www; if (www.error != null) { caller.OnPlayerCharactersError(www.error); } else { MemoryStream stream = new MemoryStream(www.bytes); Characters characters = Serializer.Deserialize<Characters>(stream); caller.OnPlayerCharacters(characters); } }