aminusia

Untitled

Mar 18th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void WinPvpSyncServer(int win, OnWinPvpSyncFinishedEvent result) {
  2.         string queryString =
  3.             "{\"userId\":\"" + GetId() + "\", " +
  4.                 "\"authToken\":\"" + GetToken() + "\", "+
  5.                 "\"win\":" + win + "}";
  6.         JSONNode query = JSONNode.Parse(queryString);
  7.  
  8.         ServerHandler.instance.SendQueryToServer("DBPvP", "WinPvp", query.ToString(), (result2) => {
  9.             //success
  10.             Debug.Log(result2);
  11.  
  12.             //nambah quest: Get gold, spend gold, reach player level, kill monster times
  13.             AddJSONReward(JSONNode.Parse(result2));
  14.             AddQuest(DBQuest.MISSIONTYPE.DoPvp, 1);
  15.             if(win==1) AddQuest(DBQuest.MISSIONTYPE.WinPvp, 1);
  16.             DBQuest.AddQuestProgress();
  17.  
  18.             result(true);
  19.         }, (result2) => {
  20.             //error
  21.             Debug.Log(result2);
  22.             result(false);
  23.         });
  24.     }
Add Comment
Please, Sign In to add comment