本文整理汇总了C#中Connect.getHash方法的典型用法代码示例。如果您正苦于以下问题:C# Connect.getHash方法的具体用法?C# Connect.getHash怎么用?C# Connect.getHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connect
的用法示例。
在下文中一共展示了Connect.getHash方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sending
private IEnumerator sending()
{
Connect connect = new Connect();
User user = GameObject.Find("User").GetComponent<User>();
string url = connect.getURL() + "/Comment/addComment.php";
WWWForm form = new WWWForm();
//userid content hash
form.AddField("userID", user.getID());
form.AddField("storeID", store.getId());
form.AddField("content", inputText.text);
form.AddField("hash", connect.getHash());
byte[] rawData = form.data;
WWW www = new WWW(url, rawData);
yield return www;
// check for errors
if (www.error == null)
{
string temp = www.text;
Debug.Log(www.text);
if (temp.Length == 5) //check
{
//add comment
jbc.addSuccess(inputText.text);
closeAdd ();
}
else if (temp.Length == 18)
{
errorText.text = "資料錯誤";
}
else
{
errorText.text = "資料錯誤(2)";
}
}
else
{
errorText.text = "請檢查裝置連線";
Debug.Log("WWW Error: " + www.error);
}
}
示例2: startLoad
private IEnumerator startLoad()
{
Connect connect = new Connect();
string url = connect.getURL() + "/login/loadUser.php";
// isSucess = false;
WWWForm form = new WWWForm();
form.AddField("act", getAccount());
form.AddField("hash", connect.getHash());
byte[] rawData = form.data;
WWW www = new WWW(url, rawData);
yield return www;
// check for errors
if (www.error == null)
{
JSONObject jsonReader;
string encoding = www.text;
Debug.Log(encoding);
jsonReader = new JSONObject(encoding);
userfill(jsonReader);
Debug.Log(id + " " + account + " " + password + " " + nickname + " " + gender + " " + email + " " + isFB);
save2SQL();
}
else
{
Debug.Log("WWW Error: " + www.error);
}
}
示例3: startLoad
private IEnumerator startLoad(string type)
{
Connect connect = new Connect();
string url = connect.getURL() + "/Comment/getComment.php";
// isSucess = false;
Debug.Log("storeID=" + store.getId());
WWWForm form = new WWWForm();
form.AddField("storeID", store.getId());
form.AddField("sortType",type);
form.AddField("hash", connect.getHash());
byte[] rawData = form.data;
WWW www = new WWW(url, rawData);
yield return www;
// check for errors
if (www.error == null)
{
string encoding = www.text;
Debug.Log(encoding);
commentData = new JSONObject(encoding);
total_Comment = commentData.Count;
generateCommentBuild();
accessData(commentData);
}
else
{
Debug.Log("WWW Error: " + www.error);
}
}
示例4: sendRate
private IEnumerator sendRate(Comment comm)
{
Connect connect = new Connect();
string url = connect.getURL() + "/Comment/addRate.php";
WWWForm form = new WWWForm();
Debug.Log (user.getID());
form.AddField("userID", user.getID());
form.AddField("comment_id", comm.id);
form.AddField("hash", connect.getHash());
byte[] rawData = form.data;
WWW www = new WWW(url, rawData);
yield return www;
// check for errors
if (www.error == null)
{
Debug.Log(www.text);
if (www.text.Length == 5)
{
Text trate = GameObject.Find(comment_uri + comm.index.ToString() + "/Rate/Text").GetComponent<Text>();
Comment temp = GameObject.Find(comment_uri + comm.index.ToString()).GetComponent<Comment>();
temp.rate++;
trate.text = temp.rate.ToString();
}
}
else
{
Debug.Log("WWW Error: " + www.error);
}
}
示例5: fastFBlogin
private IEnumerator fastFBlogin()
{
Connect connect = new Connect();
string url = connect.getURL() + "/login/haveFBaccount.php";
// isSucess = false;
WWWForm form = new WWWForm();
var aToken = AccessToken.CurrentAccessToken;
Debug.Log(aToken.UserId);
form.AddField("act", "FB" + aToken.UserId);
form.AddField("hash", connect.getHash());
byte[] rawData = form.data;
WWW www = new WWW(url, rawData);
yield return www;
// check for errors
if (www.error == null)
{
string temp = www.text;
Debug.Log("temp:" + temp + " num:" + temp.Length);
Debug.Log(www.text);
user.setAccount("FB" + aToken.UserId); //set Account
if (temp.Length == 5) //already
{
user.loadAllfromServer();
Debug.Log("FB Register password:" + user.getPassword());
ToMenu();
}
else//First Login
{
FB.API("/me?fields=name", HttpMethod.GET, GetUsername);
FB.API("/me?fields=gender", HttpMethod.GET, GetUsergender);
FB.API("/me/picture?height=145&width=157", HttpMethod.GET, DisplayProfilePic);
clrFBPanel();
ls.ShowFBLogin();
}
}
else
{
hint.text = "請檢查裝置連線";
Debug.Log("WWW Error: " + www.error);
}
}
示例6: doFBRegist
private IEnumerator doFBRegist()
{
Connect connect = new Connect();
string url = connect.getURL() + "/login/addFBUser.php";
// isSucess = false;
WWWForm form = new WWWForm();
form.AddField("act", user.getAccount());
form.AddField("name", user.getName());
form.AddField("nickname", user.getNickname());
form.AddField("gender", user.getGender());
form.AddField("email", user.getEmail());
form.AddField("isFB", "1");
form.AddField("hash", connect.getHash());
byte[] rawData = form.data;
WWW www = new WWW(url, rawData);
yield return www;
// check for errors
if (www.error == null)
{
string temp = www.text;
Debug.Log("temp:" + temp + " num:" + temp.Length);
Debug.Log(www.text);
if (temp.Length == 5) //check
{
hint.text = "註冊成功";
//Login
user.loadAllfromServer();
Debug.Log("FB Register password:" + user.getPassword());
ToMenu();
}
else if (temp.Length == 18)
{
hint.text = "重複的帳號或Email";
}
else
{
hint.text = "資料錯誤";
}
}
else
{
hint.text = "請檢查裝置連線";
Debug.Log("WWW Error: " + www.error);
}
//isSucess = false;
}