/* * 뒤끝챗 서버 접속 * 활성화 된 일반채널 접속 */ //뒤끝챗 서버 접속 //private IEnumerator GetChatStatus() //{ // chatStatus = false; // channelType = ChannelType.Public; // //현재 채팅서버 상태를 호출함 // BackendAsyncClass.BackendAsync(Backend.Chat.GetChatStatus, callback => // { // if (!callback.IsSuccess() || callback.IsServerError()) // { // ShowMessage(callback.ToString()); // Debug.Log("Fail to Connect Chat Server - " + callback); // } // else // { // string chatServerStatus = callback.GetReturnValuetoJSON()["chatServerStatus"]["chatServer"].ToString(); // chatStatus |= chatServerStatus.Equals("y"); // Debug.Log("chatStatus - " + chatStatus + " : " + callback); // chatStatus = true; // } // reply_chat = true; // }); // yield return new WaitUntil(() => reply_chat); // if (chatStatus == false) // { // ShowMessage("GetChatStatus : " + CHAT_INACTIVE); // } //} // 활성화된 채널 리스트 받아오기 (public) private bool GetChatStatus() { //현재 채팅서버 상태를 호출함 BackendReturnObject chatStatusBRO = Backend.Chat.GetChatStatus(); chatStatus = false; channelType = ChannelType.Public; if (!chatStatusBRO.IsSuccess()) { ShowMessage(chatStatusBRO.ToString()); Debug.Log("Fail To Connect Chat Server - " + chatStatusBRO); return(false); } string chatServerStatus = chatStatusBRO.GetReturnValuetoJSON()["chatServerStatus"]["chatServer"].ToString(); chatStatus |= chatServerStatus.Equals("y"); Debug.Log("chatStatus - " + chatStatus); //chatStatus = true; if (!chatStatus) { ShowMessage(CHAT_INACTIVE); return(false); } return(true); }
/* * */ private void InsertLog(string logType, string content) { Param param = new Param(); param.Add("content", content); Backend.GameInfo.InsertLog(logType, param, bro => { Debug.Log("InsertLog - " + bro.ToString()); }); }
// Update is called once per frame void Update() { if (isSuccess) { Debug.Log("-------------Update(SaveToken)-------------"); BackendReturnObject saveToken = Backend.BMember.SaveToken(bro); if (saveToken.IsSuccess()) { Debug.Log("로그인 성공"); } else { Debug.Log("로그인 실패: " + saveToken.ToString()); } isSuccess = false; bro.Clear(); } // 차트를 비동기로 저장하는 경우에만 필요한 부분입니다. if (isChartSuccess) { Debug.Log("-----------------Update-----------------"); PlayerPrefsClear(); Backend.Chart.SaveChart(chart); isChartSuccess = false; if (chart.IsSuccess()) { JsonData rows = chart.GetReturnValuetoJSON()["rows"]; string ChartName, ChartContents; // get chart contents with chartName for (int i = 0; i < rows.Count; i++) { ChartName = rows[i]["chartName"]["S"].ToString(); ChartContents = PlayerPrefs.GetString(ChartName); Debug.Log(string.Format("{0}\n{1}", ChartName, ChartContents)); } } chart.Clear(); } }
// 게임 정보 생성 public void GameInfoInsert() { Debug.Log("-----------------GameInfo Insert-----------------"); Param lunch = new Param(); lunch.Add("how much", 332); lunch.Add("when", "yesterday"); lunch.Add("what", "eat chocolate"); Dictionary <string, int> dic = new Dictionary <string, int> { { "dic1", 1 }, { "dic4", 2 }, { "dic2", 4 } }; Dictionary <string, string> dic2 = new Dictionary <string, string> { { "mm", "j" }, { "nn", "n" }, { "dd", "2" } }; String[] list = { "a", "b" }; int[] list2 = { 400, 500, 600 }; string jsonstring = @"{""inDate"":""2019-05-08T06:58:01.608Z"",""nickname"":""GM로엠"",""uuid"":""YV85MTYyMzY2MjM5MDUwNDc2MjMz"",""fightingPower"":203575853.67367488,""characterType"":0,""skinType"":0}"; string jsonstring2 = @"{""inDate"":""2019-05-08T06:58:01.608Z"",""nickname"":""GM로로로로아아"",""uuid"":""YV85MTYyMzY2MjM5MDUwNDc2MjMz"",""fightingPower"":203575853.67367488,""characterType"":1,""skinType"":11}"; List <string> stringList = new List <string>(); stringList.Add(jsonstring); stringList.Add(jsonstring2); Param param2 = new Param(); param2.Add("이름", "cheolsu"); param2.Add("score", 99); param2.Add("lunch", lunch); Param param3 = new Param(); param3.Add("dic_num", dic); param3.Add("dic_string", dic2); param3.Add("list_string", list); //param.Add("list_num", list2); Debug.Log(stringList.ToArray()); Param[] paramList = { param2, param3 }; Param param = new Param(); param.Add("이름", "cheolsu"); param.Add("score", 99); param.Add("lunch", lunch); param.Add("dic_num", dic); param.Add("dic_string", dic2); param.Add("list_string", list); param.Add("list_num", list2); param.Add("params", paramList); BackendReturnObject insert = Backend.GameInfo.Insert(public_table_name, param); Debug.Log(insert.ToString()); if (insert.IsSuccess()) { Indate = insert.GetInDate(); Debug.Log("indate : " + Indate); } }