- Home /
Question by
felipefrosi · Feb 29, 2016 at 12:05 PM ·
crashwwwienumeratorwwwform
Crashing on www method
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<string, string> 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.
Comment
Your answer
Follow this Question
Related Questions
UnityEngineInternal.WebRequestUtils.MakeInitialUrl throwing IndexOutOfRangeException 3 Answers
iPad crashes after many WWW images queries 1 Answer
WWW IOS Crash 0 Answers
Apply Texture from AssetBundle 0 Answers
Problem using WWW with PHP and MYSQL 3 Answers