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;
            }
        }
Example #2
0
        private void OnEventHandler(byte eventCode, object content, int senderID)
        {
            Hashtable hashtable = (Hashtable)content;
            int       num       = (int)hashtable.get_Item((object)"s");
            string    str;

            if (num == 0)
            {
                str = (string)hashtable.get_Item((object)"m");
            }
            else
            {
                byte[] data = (byte[])hashtable.get_Item((object)"m");
                str = MyEncrypt.Decrypt(num + this.GetCryptKey(), data, true);
            }
            MyPhoton.MyEvent myEvent = new MyPhoton.MyEvent();
            myEvent.code     = (MyPhoton.SEND_TYPE)eventCode;
            myEvent.playerID = senderID;
            myEvent.json     = str;
            if (((Dictionary <object, object>)hashtable).ContainsKey((object)"sq"))
            {
                myEvent.sendID = (int)hashtable.get_Item((object)"sq");
            }
            this.mEvents.Add(myEvent);
            if (this.SortRoomMessage)
            {
                this.mEvents.Sort((Comparison <MyPhoton.MyEvent>)((a, b) => a.sendID - b.sendID));
            }
            this.Log("OnEventHandler: " + (object)senderID + (string)hashtable.get_Item((object)"msg"));
        }
Example #3
0
 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);
 }
Example #4
0
        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;
        }
Example #5
0
        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);
        }
Example #6
0
 private static BattleSuspend.Data loadSaveData(string file_name)
 {
     if (string.IsNullOrEmpty(file_name))
     {
         return((BattleSuspend.Data)null);
     }
     try
     {
         byte[] data = File.ReadAllBytes(file_name);
         if (data != null)
         {
             string str = MyEncrypt.Decrypt(0, data, false);
             if (!string.IsNullOrEmpty(str))
             {
                 return((BattleSuspend.Data)JsonUtility.FromJson <BattleSuspend.Data>(str));
             }
         }
     }
     catch
     {
     }
     return((BattleSuspend.Data)null);
 }
        public void Analyze(string log)
        {
            string json = string.Empty;
            string src  = string.Empty;

            if (!string.IsNullOrEmpty(this.mNonAnalyzeLog))
            {
                log = this.mNonAnalyzeLog + log;
                this.mNonAnalyzeLog = string.Empty;
            }
            if (log.IndexOf("creatorName") != -1)
            {
                json = log;
            }
            else if (log.IndexOf("players") != -1)
            {
                src = log;
            }
            else if (log.IndexOf("bm") != -1)
            {
                try
                {
                    byte[] data = MyEncrypt.Decrypt(((AudienceLog)JsonUtility.FromJson <AudienceLog>(log)).bm);
                    SceneBattle.MultiPlayRecvData buffer;
                    if (GameUtility.Binary2Object <SceneBattle.MultiPlayRecvData>(out buffer, data))
                    {
                        if (!this.mTurnLog.ContainsKey(buffer.b))
                        {
                            this.mTurnLog[buffer.b] = new List <SceneBattle.MultiPlayRecvData>();
                        }
                        this.mTurnLog[buffer.b].Add(buffer);
                    }
                }
                catch
                {
                    this.mNonAnalyzeLog = log;
                }
            }
            else if (log.IndexOf("bin") != -1)
            {
                try
                {
                    SceneBattle.MultiPlayRecvBinData multiPlayRecvBinData = (SceneBattle.MultiPlayRecvBinData)JsonUtility.FromJson <SceneBattle.MultiPlayRecvBinData>(log);
                    string buffer;
                    GameUtility.Binary2Object <string>(out buffer, multiPlayRecvBinData.bin);
                    this.Analyze(buffer);
                    return;
                }
                catch
                {
                    this.mNonAnalyzeLog = log;
                }
            }
            else
            {
                this.mNonAnalyzeLog = log;
            }
            if (!string.IsNullOrEmpty(json))
            {
                try
                {
                    this.mRoomParam = JSON_MyPhotonRoomParam.Parse(json);
                }
                catch
                {
                    Debug.LogWarning((object)json);
                    this.mNonAnalyzeLog = json;
                }
            }
            if (string.IsNullOrEmpty(src))
            {
                return;
            }
            try
            {
                this.mStartedParam = JSONParser.parseJSONObject <AudienceStartParam>(src);
            }
            catch
            {
                Debug.LogWarning((object)src);
                this.mNonAnalyzeLog = src;
            }
        }