private static bool writeSaveData(string file_name, BattleSuspend.Data data = null) { if (string.IsNullOrEmpty(file_name)) { return(false); } if (data == null) { data = new BattleSuspend.Data(); } try { string json = JsonUtility.ToJson((object)data); if (!string.IsNullOrEmpty(json)) { byte[] bytes = MyEncrypt.Encrypt(0, json, false); if (bytes != null) { File.WriteAllBytes(file_name, bytes); return(true); } } } catch { } return(false); }
public override void OnActivate(int pinID) { switch (pinID) { case 0: string format1 = LocalizedText.Get("sys.MP_LINE_TEXT"); string msg1 = string.Empty + "iname=" + GlobalVars.SelectedQuestID + "&type=" + (object)GlobalVars.SelectedMultiPlayRoomType + "&creatorFUID=" + JSON_MyPhotonRoomParam.GetMyCreatorFUID() + "&roomid=" + (object)GlobalVars.SelectedMultiPlayRoomID; byte[] inArray1 = MyEncrypt.Encrypt(JSON_MyPhotonRoomParam.LINE_PARAM_ENCODE_KEY, msg1, false); string str1 = string.Format(format1, (object)WWW.EscapeURL(Convert.ToBase64String(inArray1))); DebugUtility.Log("LINE:" + str1); Application.OpenURL(LocalizedText.Get("sys.MP_LINE_HTTP") + WWW.EscapeURL(str1, Encoding.UTF8)); this.ActivateOutputLinks(1); break; case 100: if (JSON_MyPhotonRoomParam.GetMyCreatorFUID().Equals(FlowNode_OnUrlSchemeLaunch.LINEParam_decided.creatorFUID)) { this.ActivateOutputLinks(101); break; } this.ActivateOutputLinks(102); break; case 200: string format2 = LocalizedText.Get("sys.MP_LINE_VERSUS_TEXT"); string msg2 = string.Empty + "iname=" + GlobalVars.SelectedQuestID + "&type=" + (object)GlobalVars.SelectedMultiPlayRoomType + "&creatorFUID=" + JSON_MyPhotonRoomParam.GetMyCreatorFUID() + "&roomid=" + (object)GlobalVars.SelectedMultiPlayRoomID; byte[] inArray2 = MyEncrypt.Encrypt(JSON_MyPhotonRoomParam.LINE_PARAM_ENCODE_KEY, msg2, false); string str2 = string.Format(format2, (object)WWW.EscapeURL(Convert.ToBase64String(inArray2))); DebugUtility.Log("LINE:" + str2); Application.OpenURL(LocalizedText.Get("sys.MP_LINE_HTTP") + WWW.EscapeURL(str2, Encoding.UTF8)); GlobalVars.VersusRoomReuse = true; this.ActivateOutputLinks(1); break; } }
public void OnClickURL() { string format = LocalizedText.Get("sys.MP_LINE_VERSUS_TEXT"); string msg = string.Empty + "iname=" + GlobalVars.SelectedQuestID + "&type=" + (object)GlobalVars.SelectedMultiPlayRoomType + "&creatorFUID=" + JSON_MyPhotonRoomParam.GetMyCreatorFUID() + "&roomid=" + (object)GlobalVars.SelectedMultiPlayRoomID; byte[] inArray = MyEncrypt.Encrypt(JSON_MyPhotonRoomParam.LINE_PARAM_ENCODE_KEY, msg, false); string str = string.Format(format, (object)WWW.EscapeURL(Convert.ToBase64String(inArray)), (object)GlobalVars.SelectedMultiPlayRoomID); DebugUtility.Log("LINE:" + str); GUIUtility.set_systemCopyBuffer(str); GlobalVars.VersusRoomReuse = true; }
public bool SendRoomMessage(bool reliable, string msg, MyPhoton.SEND_TYPE eventcode = MyPhoton.SEND_TYPE.Normal) { if (this.mState != MyPhoton.MyState.ROOM) { return(false); } int num = 0; Hashtable hashtable1; if (num == 0) { Hashtable hashtable2 = new Hashtable(); ((Dictionary <object, object>)hashtable2).Add((object)"s", (object)num); ((Dictionary <object, object>)hashtable2).Add((object)"m", (object)msg); hashtable1 = hashtable2; } else { byte[] numArray = MyEncrypt.Encrypt(num + this.GetCryptKey(), msg, true); Hashtable hashtable2 = new Hashtable(); ((Dictionary <object, object>)hashtable2).Add((object)"s", (object)num); ((Dictionary <object, object>)hashtable2).Add((object)"m", (object)numArray); hashtable1 = hashtable2; } if (this.SortRoomMessage) { ((Dictionary <object, object>)hashtable1).Add((object)"sq", (object)this.mSendRoomMessageID); ++this.mSendRoomMessageID; } bool flag = PhotonNetwork.RaiseEvent((byte)eventcode, (object)hashtable1, reliable, (RaiseEventOptions)null); if (!this.DisconnectIfSendRoomMessageFailed || flag) { return(flag); } this.Disconnect(); this.mError = MyPhoton.MyError.RAISE_EVENT_FAILED; DebugUtility.LogError("SendRoomMessage failed!"); return(false); }