//type = a:1/10, b:1/100, c:1/1000
    public Test_GetGameContentCommand( string playerId,string authToken, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.content.get");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId }});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
    //type = a:1/10, b:1/100, c:1/1000
    public Player_HeroSkillEditCommand( string playerId,string authToken,string herotype,HeroData hd, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.heroSkillEdit");
        command.Add ("time", TimeUtils.UnixTime);
        ArrayList activeSkillIDList = new ArrayList(){"a","b","c"};
        ArrayList passiveSkillIDList = new ArrayList(){"d","e","f"};
        command.Add ("args", new Hashtable () { { "playerId", playerId },{"herotype",herotype},{"as",activeSkillIDList},{"ps",passiveSkillIDList}});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
    //type = a:1/10, b:1/100, c:1/1000
    public Player_HerosUpdateCommand( string playerId,string authToken, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.heroUpdate");
        command.Add ("time", TimeUtils.UnixTime);
        ArrayList heros = new ArrayList();
        for(int i=0; i< UserInfo.heroDataList.Count; i++)
        {
            HeroData heroD = UserInfo.heroDataList[i] as HeroData;
            heros.Add(heroD.dumpDynamicData());
        }

        command.Add ("args", new Hashtable () { { "playerId", playerId }
            ,{"bpack", EquipManager.Instance.dumpDynamicData()}
            ,{"heros", heros}
        });
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
    public void coroutineAnimation(Animation a, CompleteDelegate completeDeletgate)
    {
        object[] parameters = new object[2]{a, completeDeletgate};

        StatusManager.enableNextOrder = false;
        StartCoroutine("animationWait",parameters);
    }
Exemple #5
0
        public override void start()
        {
            //storage が指定されている場合は、そのAudioのみ停止する
            StatusManager.enableNextOrder = false;

            string storage = this.param ["storage"];
            float  time    = float.Parse(this.param ["time"]);
            //			string wait = this.param ["wait"];

            CompleteDelegate completeDelegate = this.complete;

            if (storage != "")
            {
                string file = GameSetting.PATH_AUDIO_SE + storage;
                this.gameManager.audioManager.stopAudio(file, AudioType.Sound, time, completeDelegate);
            }
            else
            {
                this.gameManager.audioManager.stopAudio("", AudioType.Sound, time, completeDelegate);
            }

            if (this.param ["wait"] != "true")
            {
                StatusManager.enableNextOrder = true;
                this.gameManager.nextOrder();
            }
        }
    //type = a:1/10, b:1/100, c:1/1000
    public Player_PackageUpdateCommand( string playerId,string authToken, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.bpackUpdate");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId },{"bpack", EquipManager.Instance.dumpDynamicData()}});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
Exemple #7
0
        public override void start()
        {
            StatusManager.enableNextOrder = false;

            string storage = this.param ["storage"];
            string file    = GameSetting.PATH_AUDIO_SE + storage;

            //			string wait = this.param ["wait"];

            CompleteDelegate completeDelegate = this.complete;
            AudioObject      audioObject      = this.gameManager.audioManager.getAudio(file, AudioType.Sound);

            audioObject.time             = 0;
            audioObject.vol              = float.Parse(this.param["vol"]);
            audioObject.completeDelegate = completeDelegate;
            audioObject.audioSource.loop = bool.Parse(this.param["loop"]);
            audioObject.play();

            //this.gameManager.scene.MessageSpeed = 0.02f;
            //this.gameManager.scene.coroutineShowMessage (message);

            if (this.param ["wait"] != "true")
            {
                StatusManager.enableNextOrder = true;
                this.gameManager.nextOrder();
            }
        }
Exemple #8
0
        public override void start()
        {
            //storage が指定されている場合は、そのAudioのみ停止する
            StatusManager.enableNextOrder = false;

            string storage = this.param ["storage"];
            float  time    = float.Parse(this.param ["time"]);
            //			string wait = this.param ["wait"];

            CompleteDelegate completeDelegate = this.complete;

            if (storage != "")
            {
                string file = GameSetting.PATH_AUDIO_BGM + storage;
                this.gameManager.audioManager.stopAudio(file, AudioType.Bgm, time, completeDelegate);
            }
            else
            {
                this.gameManager.audioManager.stopAudio("", AudioType.Bgm, time, completeDelegate);
            }

            //this.gameManager.scene.MessageSpeed = 0.02f;
            //this.gameManager.scene.coroutineShowMessage (message);
            StatusManager.currentPlayBgm = "";

            if (this.param ["wait"] != "true")
            {
                StatusManager.enableNextOrder = true;
                this.gameManager.nextOrder();
            }
        }
    //type = a:1/10, b:1/100, c:1/1000
    public Auth_GetAutoTokenCommand( string playerId,string secret, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", AuthUtils.generateRequestToken (playerId, secret));

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "auth.getAuthToken");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId }, { "secret", secret }});
        //		command.Add ("expectedStatus","");
        command.Add ("requestId", 123);
        //		command.Add ("token", "");
        commands.Add(command);
        batchHash.Add("commands",commands);
        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            //{"requestId":null,"messages":{},"result":"aWeha_JMFgzaF5zWMR3tnObOtLZNPR4rO70DNdfWPvc.eyJ1c2VySWQiOiIyMCIsImV4cGlyZXMiOiIxMzg1NzA5ODgyIn0","status":0}
            Hashtable completeParam = new Hashtable();
            completeParam.Add("result",t["result"]);
            completeDelegate(completeParam);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
Exemple #10
0
    public void coroutineAnimation(Animation a, CompleteDelegate completeDeletgate)
    {
        object[] parameters = new object[2] {
            a, completeDeletgate
        };

        StatusManager.enableNextOrder = false;
        StartCoroutine("animationWait", parameters);
    }
        public void init(Tag tag, int line_num)
        {
            this.tag         = tag;
            this.tagName     = tag.Name;
            this.gameManager = NovelSingleton.GameManager;
            this.gameView    = NovelSingleton.GameView;
            this.line_num    = line_num;

            this.finishAnimationDeletgate = this.finishAnimation;
        }
Exemple #12
0
 public ActionCompletionData(string textToShow, string description, CompleteDelegate action)
 {
     if (action == null)
     {
         throw new ArgumentNullException(nameof(action));
     }
     _action     = action;
     Content     = new TextBlock(new Italic(new Run(textToShow)));
     Description = description;
 }
Exemple #13
0
		public void init (Tag tag, int line_num)
		{

			this.tag = tag;
			this.tagName = tag.Name;
			this.gameManager = NovelSingleton.GameManager;
			this.gameView = NovelSingleton.GameView;
			this.line_num = line_num;

			this.finishAnimationDeletgate = this.finishAnimation;


		}
Exemple #14
0
    private IEnumerator animationWait(object[] param)
    {
        Animation        a = (Animation)param [0];
        CompleteDelegate completeDeletgate = (CompleteDelegate)param[1];

        //アニメーションの終了を待つ

        while (a.isPlaying)
        {
            // childのisComplete変数がtrueになるまで待機
            yield return(new WaitForEndOfFrame());
        }

        completeDeletgate();
    }
Exemple #15
0
        internal ScriptRunner(Runspace runSpace, ISynchronizeInvoke invoker, string script, IDictionary <string, dynamic> parameters = null)
        {
            _invoker     = invoker;
            _stopEvent   = new ManualResetEvent(false);
            _waitHandles = new WaitHandle[] { null, _stopEvent };

            ScriptFile = script;
            Parameters = parameters;

            _powerShell          = System.Management.Automation.PowerShell.Create();
            _powerShell.Runspace = runSpace;

            var command = new Command(script);

            if (parameters != null)
            {
                foreach (KeyValuePair <string, dynamic> parameter in parameters)
                {
                    command.Parameters.Add(new CommandParameter(parameter.Key, parameter.Value));
                }
            }
            _powerShell.Commands.AddCommand(command);

            _outputCollection            = new PSDataCollection <PSObject>();
            _outputCollection.DataAdded += OnObjectOutput;

            synchComplete         = SyncComplete;
            synchObjectReady      = SyncObjectReady;
            synchProgressReady    = SyncProgressReady;
            synchInformationReady = SyncInformationReady;
            synchWarningReady     = SyncWarningReady;
            synchErrorReady       = SyncErrorReady;
            synchVerboseReady     = SyncVerboseReady;
            synchDebugReady       = SyncDebugReady;

            _powerShell.InvocationStateChanged        += StateChanged;
            _powerShell.Streams.Progress.DataAdded    += OnProgress;
            _powerShell.Streams.Error.DataAdded       += OnError;
            _powerShell.Streams.Information.DataAdded += OnInformation;
            _powerShell.Streams.Verbose.DataAdded     += OnVerbose;
            _powerShell.Streams.Debug.DataAdded       += OnDebug;
            _powerShell.Streams.Warning.DataAdded     += OnWarning;
        }
Exemple #16
0
    private static IEnumerator DeleteRequest(string uri,
                                             CompleteDelegate completeDelegate = null, ErrorDelegate errorDelegateUri = null)
    {
        using (var www = UnityWebRequest.Delete(uri))
        {
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
                errorDelegateUri?.Invoke(www.error);
            }
            else
            {
                Debug.Log("Upload complete!");
                completeDelegate?.Invoke(uri);
            }
        }
    }
Exemple #17
0
        public void stopAudio(string file, AudioType audioType, float time, CompleteDelegate completeDelegate)
        {
            //全部停止する
            if (file == "")
            {
                Dictionary <string, AudioObject> dic = this.getDic(audioType);
                foreach (KeyValuePair <string, AudioObject> kvp in dic)
                {
                    string key = kvp.Key;

                    dic [key].time             = time;
                    dic [key].completeDelegate = completeDelegate;
                    dic[key].stop();
                }
            }
            else
            {
                AudioObject audioObject = this.getAudio(file, audioType);
                audioObject.time             = time;
                audioObject.completeDelegate = completeDelegate;
                audioObject.stop();
            }
        }
Exemple #18
0
 public FileCommand( string fileName , CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
 {
     this.fileName = fileName;
     this.onComplete = completeDelegate;
     this.onError = errorDelegate;
 }
Exemple #19
0
		public void stopAudio(string file,AudioType audioType,float time,CompleteDelegate completeDelegate){

			//全部停止する
			if (file == "") {
				Dictionary<string,AudioObject> dic = this.getDic (audioType);
				foreach (KeyValuePair<string, AudioObject> kvp in dic) {

					string key = kvp.Key;

					dic [key].time = time;
					dic [key].completeDelegate = completeDelegate;
					dic[key].stop();

				}

			} else {

				AudioObject audioObject = this.getAudio (file,audioType);
				audioObject.time = time;
				audioObject.completeDelegate = completeDelegate;
				audioObject.stop();

			}


		}
 public FlowBuilder()
 {
     flows           = new List <ActionResultDelegate>();
     errorHandler    = (e) => { Console.WriteLine("Holy Cow !"); };
     completeHandler = (flowId, data) => { Console.WriteLine("Complete !"); };
 }
Exemple #21
0
 /// <summary>
 /// Register a delegate to be invoked when the capture is complete.
 /// </summary>
 /// <param name='del'>
 /// The delegate to be invoked when capture complete.
 /// </param>
 public void RegisterCompleteDelegate(CompleteDelegate del)
 {
     completeDelegate += del;
 }
Exemple #22
0
 /// <summary>
 /// Unregister a previously registered session complete delegate.
 /// </summary>
 /// <param name='del'>
 /// The delegate to be unregistered.
 /// </param>
 public void UnregisterCompleteDelegate(CompleteDelegate del)
 {
     completeDelegate -= del;
 }
        public FlowBuilder OnComplete(CompleteDelegate complete)
        {
            completeHandler = complete;

            return(this);
        }
Exemple #24
0
		public void setFinishAnimationDelegate(CompleteDelegate completeDeletgate){

			this.completeDeletgate = completeDeletgate;

		}
Exemple #25
0
 public void setFinishAnimationDelegate(CompleteDelegate completeDeletgate)
 {
     this.completeDeletgate = completeDeletgate;
 }