Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Crashing on www method

$
0
0
When I call it inside a IEnumerator: WWW www2 = OrganizeData(callParams); Sometimes the game crashes. Here is the OrganizeData: private WWW OrganizeData(string[] callParams) { string time= GetNonce().ToString(); WWWForm form = new WWWForm(); form.AddField("toTime", time); for (int i = 0; i < callParams.Length; i += 2) { form.AddField(callParams[i], callParams[i + 1]); } Dictionary headers = form.headers; Encoding encoding = Encoding.UTF8; var codeTemp = encoding.GetBytes(code); using (var hmacsha512 = new HMACSHA512(codeTemp)) { byte[] hashmessage = hmacsha512.ComputeHash(encoding.GetBytes(callParams[1] + ":" + code+ ":" + time)); headers["Life"] = "" + ByteToString(hashmessage).ToLower(); headers["Code"] = "" + code; headers["Content-type"] = "application/x-www-form-urlencoded"; } byte[] rawData = form.data; WWW www = new WWW("https:/www.gameTest/api/", rawData, headers); return www; } The log shows the crash in diferent points. Sometimes here: **WWW www2 = OrganizeData(callParams);** And sometimes in other points: **byte[] rawData = form.data;** And here: **WWW www = new WWW("https:/www.gameTest/api/", rawData, headers);** In Unity 4 it did not happens. When the project was updated to 5, it happens always... sometimes after 30 minutes, sometimes after some hours. Someone faced something like this? Thanks in advance.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>