SendOutgoingCommands() public static method

Can be used to immediately send the RPCs and Instantiates just made, so they are on their way to the other players.
This could be useful if you do a RPC to load a level and then load it yourself. While loading, no RPCs are sent to others, so this would delay the "load" RPC. You can send the RPC to "others", use this method, disable the message queue (by isMessageQueueRunning) and then load.
public static SendOutgoingCommands ( ) : void
return void
Ejemplo n.º 1
0
 private void OnApplicationFocus(bool focus)
 {
     playerState = focus;
     if (!isOnlineMode)
     {
         return;
     }
     if (focus)
     {
         Debug.Log("Application resume");
         if (opponentState)
         {
             Time.timeScale = 1f;
         }
         WhotUiManager.instance.connecting.SetActive(true);
         StartCoroutine(checkPoolStatus());
         if (PhotonNetwork.room != null)
         {
             WhotUiManager.instance.connecting.SetActive(false);
             PhotonNetwork.RaiseEvent(152, 1, true, null);
             PhotonNetwork.SendOutgoingCommands();
         }
     }
     else
     {
         // playerState = false;
         Debug.Log("Application pause");
         WhotUiManager.instance.connecting.SetActive(true);
         Time.timeScale = 0f;
         PhotonNetwork.RaiseEvent(151, 1, true, null);
         PhotonNetwork.SendOutgoingCommands();
     }
 }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        RaycastHit hit;

        if (GetComponent <PhotonView>().isMine)
        {
            if (PhotonNetwork.player.GetScore() >= collectGoal)
            {
                Debug.Log("Goal Hit");
                ScoreContainer.scores = PhotonNetwork.playerList;
                GetComponent <PhotonView>().RPC("TransitionScreen", PhotonTargets.AllViaServer, null);
                PhotonNetwork.SendOutgoingCommands();
            }
            if (Physics.Raycast(transform.position, Camera.main.transform.forward, out hit, raycastDist))
            {
                if (hit.transform.tag == "Collect")
                {
                    hit.transform.gameObject.GetComponent <diamondControl>().destroySelf();
                    PhotonNetwork.player.SetScore(PhotonNetwork.player.GetScore() + 1);

                    // cmw edited & tested
                    GetComponent <PlayerMovement>().speedExhaust = GetComponent <PlayerMovement>().speedExhaustScale;
                    Debug.LogError("CMW: " + GetComponent <PlayerMovement>().speedExhaust + " " + GetComponent <PlayerMovement>().speedExhaustScale);
                }
            }
        }
    }
Ejemplo n.º 3
0
 protected void OnApplicationPause(bool pauseStatus)
 {
     if (pauseStatus)
     {
         if (PhotonNetwork.connectionState == ConnectionState.Connected && PhotonNetwork.inRoom && PhotonNetwork.isMasterClient)
         {
             ChangeMasterClientifAvailble();
             PhotonNetwork.SendOutgoingCommands();
         }
     }
 }
Ejemplo n.º 4
0
 private void OnApplicationQuit()
 {
     if (LudoMultiplayer.Instance.gameStarted)
     {
         if (PhotonNetwork.room != null)
         {
             LudoMultiplayer.Instance.checkForceQuit();
             PhotonNetwork.RaiseEvent(153, UserDetailsManager.userId, true, null);
             PhotonNetwork.SendOutgoingCommands();
         }
     }
 }
Ejemplo n.º 5
0
    public void GameEnded(string Team)//모두에게 진팀 보내주기
    {
        byte evcode = 151;

        object[]          datas = new object[] { (string)Team };
        RaiseEventOptions op    = new RaiseEventOptions {
            Receivers = ReceiverGroup.All
        };

        PhotonNetwork.RaiseEvent(evcode, datas, true, op);
        PhotonNetwork.SendOutgoingCommands();
    }
Ejemplo n.º 6
0
 void OnApplicationPause(bool pauseStatus)
 {
     if (pauseStatus)
     {
         PhotonNetwork.SendOutgoingCommands();
         Debug.Log("Application pause");
     }
     else
     {
         PhotonNetwork.SendOutgoingCommands();
         Debug.Log("Application resume");
     }
 }
Ejemplo n.º 7
0
    /// <param name="KillerImg">가해자 오브젝트의 이미지(string)</param>
    /// <param name="KilledImg">피해자 오브젝트 이미지(string)</param>
    /// <param name="Team">가해자의 팀(string) 타워면 "ex"</param>
    public void sendKillmsg(string KillerImg, string KilledImg, string Team)
    {
        evcode = 160;
        object[] datas = new object[] { KillerImg, KilledImg, Team };

        if (isDatasame(curdata, datas))
        {
            return;
        }
        curdata = datas;
        PhotonNetwork.RaiseEvent(evcode, datas, true, op);
        PhotonNetwork.SendOutgoingCommands();
        Invoke("Reset_data", 10f);
    }
Ejemplo n.º 8
0
    public static void RaiseEvent(byte i_EventCode, Hashtable i_Params, bool i_SendReliable, RaiseEventOptions i_Options, bool i_Immediate = false)
    {
        if (!offlineMode)
        {
            PhotonNetwork.RaiseEvent(i_EventCode, i_Params, i_SendReliable, i_Options);
            if (i_Immediate)
            {
                PhotonNetwork.SendOutgoingCommands();
            }

            return;
        }

        RaiseLocalEvent(i_EventCode, i_Params, i_Options);
    }
Ejemplo n.º 9
0
 void OnApplicationPause(bool pauseStatus)
 {
     if (pauseStatus)
     {
         PhotonNetwork.RaiseEvent(151, 1, true, null);
         PhotonNetwork.SendOutgoingCommands();
         Debug.Log("Application pause");
     }
     else
     {
         PhotonNetwork.RaiseEvent(152, 1, true, null);
         PhotonNetwork.SendOutgoingCommands();
         Debug.Log("Application resume");
     }
 }
Ejemplo n.º 10
0
    IEnumerator sendFeedback()
    {
        yield return(new WaitForSecondsRealtime(1f));

        if (PhotonNetwork.room != null)
        {
            PhotonNetwork.RaiseEvent(152, 1, true, null);
            PhotonNetwork.SendOutgoingCommands();
            WhotUiManager.instance.connecting.SetActive(false);
        }
        else
        {
            StartCoroutine(sendFeedback());
        }
    }
Ejemplo n.º 11
0
 /// <param name="num">0Null, 1Welcome, 2MinionWait, 3MinionSpawn, 4SuperMinion, 5Kill, 6Killed, 7Excution, 8T_Destroy,
 /// 9 T_Destroyed, 10Inhibitor_Destroy, 11Inhibitor_Destroyed, 12Inhibitor_Respawn </param>
 /// <param name="isAnnouce">전체 방송인지 팀 전송인지.</param>
 public void Annoucement(int num, bool isAnnouce, string team = null)
 {
     if (isAnnouce)
     {
         evcode = 150;
     }
     else
     {
         if (team.Equals("red") || team.Equals("Red"))
         {
             evcode = 131;
         }
         else if (team.Equals("blue") || team.Equals("Blue"))
         {
             evcode = 141;
         }
     }
     PhotonNetwork.RaiseEvent(evcode, num, true, op);
     PhotonNetwork.SendOutgoingCommands();
 }
Ejemplo n.º 12
0
    private void SceneLoaded_Send()
    {
        if (this == null)
        {
            return;
        }

        if (photonview.isMine)
        {
            byte   evcode = 33;
            string Team   = PhotonNetwork.player.GetTeam().ToString();
            int    viewid = photonview.viewID;

            object            datas = new object[] { viewid, Team };
            RaiseEventOptions op    = new RaiseEventOptions {
                Receivers = ReceiverGroup.MasterClient, CachingOption = EventCaching.AddToRoomCache
            };
            PhotonNetwork.RaiseEvent(evcode, datas, true, op);
            PhotonNetwork.SendOutgoingCommands();
        }
    }
Ejemplo n.º 13
0
 public void SendFlush()
 {
     PhotonNetwork.SendOutgoingCommands();
 }
Ejemplo n.º 14
0
 public void PrintViaServerInstant()
 {
     PhotonView.Get(networkObject).RPC("ShowLog", PhotonTargets.AllViaServer, PhotonView.Get(networkObject).viewID, "Coming from server Instant");
     PhotonNetwork.SendOutgoingCommands();
 }
Ejemplo n.º 15
0
 public void checkForceQuit()
 {
     photonView.RPC("CheckForceQuit", PhotonTargets.OthersBuffered, true);
     PhotonNetwork.RaiseEvent(153, UserDetailsManager.userId, true, null);
     PhotonNetwork.SendOutgoingCommands();
 }
Ejemplo n.º 16
0
Archivo: Snake.cs Proyecto: akil03/bx
    public void KillSnake(Snake targetSnake)
    {
        if (targetSnake == this)
        {
            ReasonDeath = name + " got confused and hit his own trail !!";

            if (!PlayerPrefs.HasKey("TutorialComplete") && !isBot)
            {
                GUIManager.instance.ShowTutorialLog(1, "Do not hit your own trail !!", 3);
            }
            else
            {
                GUIManager.instance.ShowLog(name + " got confused and hit his own trail !!", 3);
            }
        }
        else
        {
            if (playerID == 1)
            {
                AccountDetails.instance.Save(totalKills: 1);
            }

            targetSnake.ReasonDeath = name + " ended " + targetSnake.name + "'s trail game !!";
            if (snakeMeshContainer.AnimController)
            {
                snakeMeshContainer.AnimController.Kill();
            }


            if (!PlayerPrefs.HasKey("TutorialComplete") && !isLog)
            {
                isLog = true;

                if (!isBot)
                {
                    GUIManager.instance.ShowTutorialLog("Nicely done !!", 2);
                }
                else
                {
                    GUIManager.instance.ShowTutorialLog("Try completing shorter trails to play safe!!", 2);
                }

                Invoke("EnableLog", 2);
            }
            else
            {
                if (!targetSnake.isShielded)
                {
                    GUIManager.instance.ShowLog(name + " ended " + targetSnake.name + "'s trail game !!", 3);
                }
            }
        }

        if (!isBot)
        {
            isOncePlayer = true;
        }

        if (targetSnake.isShielded)
        {
        }
        else
        {
            targetSnake.haveToDie = true;

            if (PhotonNetwork.inRoom && !isNetworkKill && isLocal)
            {
                PhotonView.Get(targetSnake._networkSnake.gameObject).RPC("KillPlayer", PhotonTargets.AllViaServer);
                PhotonNetwork.SendOutgoingCommands();
                targetSnake._networkSnake.shouldTransmit = false;
                isNetworkKill = true;
                Invoke("EnableNetworkKill", 2);
            }
        }
    }
Ejemplo n.º 17
0
Archivo: Snake.cs Proyecto: akil03/bx
 void NetworkGameOver()
 {
     print("gameover called");
     PhotonView.Get(Server.instance.gameObject).RPC("GameOver", PhotonTargets.AllViaServer, PhotonView.Get(_networkSnake.gameObject).viewID, ReasonDeath);
     PhotonNetwork.SendOutgoingCommands();
 }
Ejemplo n.º 18
0
 public void SendTouch()
 {
     photonView.RPC("DoTouch", PhotonTargets.All);
     PhotonNetwork.SendOutgoingCommands();
 }