Exemple #1
0
    IEnumerator RestartGame()
    {
        redScore  = 0;
        blueScore = 0;
        yield return(new WaitForSeconds(2));

        RaiseEventOptions raiseEventOptions = new RaiseEventOptions {
            Receivers = ReceiverGroup.All
        };

        ExitGames.Client.Photon.SendOptions sendOptions = new ExitGames.Client.Photon.SendOptions {
            Reliability = true
        };
        PhotonNetwork.RaiseEvent(RestartGameEventCode, null, raiseEventOptions, sendOptions);
    }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        transform.parent = null;
        time             = newFireCooldown - 5;
        //FireSpawnList.Instance.AddEntryToList(this);
        if (Physics.OverlapSphere(transform.position, GetComponent <SphereCollider>().radius, spawnerLayerMask).Length > 0)
        {
            Debug.Log("Fire Gone");
            //GetComponent<SphereCollider>().enabled = false;
            DestroyImmediate(this.gameObject);
        }
        else if (PhotonNetwork.AllocateViewID(photonView) && !isNetworked)
        {
            object[] data = new object[]
            {
                transform.position, transform.rotation, photonView.ViewID
            };

            RaiseEventOptions raiseEventOptions = new RaiseEventOptions
            {
                Receivers     = ReceiverGroup.Others,
                CachingOption = EventCaching.AddToRoomCache
            };

            ExitGames.Client.Photon.SendOptions sendOptions = new ExitGames.Client.Photon.SendOptions
            {
                Reliability = true
            };

            PhotonNetwork.RaiseEvent(eventCode, data, raiseEventOptions, sendOptions);
        }
        else
        {
            Debug.LogError("Failed to allocate a ViewId.");

            Destroy(this);
        }
    }
        void StreamTextureDataToRequestSender(byte[] rawTextureData, int width, int height, int dataSize, int viewId, Player requestSender)
        {
            Debug.Log("***********************************");
            Debug.Log(" StreamTextureDataToRequestSender  ");
            Debug.Log("***********************************");

            RaiseEventOptions raiseEventOptions = new RaiseEventOptions
            {
                CachingOption = EventCaching.DoNotCache,
                Receivers     = ReceiverGroup.All,
                TargetActors  = new int[] { requestSender.ActorNumber },
            };

            SendOptions sendOptions = new ExitGames.Client.Photon.SendOptions
            {
                Reliability = true,
            };

            // Send info
            int[] textureInfo = new int[4];
            textureInfo[0] = viewId;
            textureInfo[1] = width;
            textureInfo[2] = height;
            textureInfo[3] = dataSize;
            PhotonNetwork.RaiseEvent((byte)StreamingBytesEventCode.BeginStream, textureInfo, raiseEventOptions, sendOptions);

            // Send raw data
            // The SlowDown operator is not necessary if you ignore the limit on the number of messages per second of Photon Cloud.
            rawTextureData.ToObservable()
            .Buffer(bytePerMessage)
            // .SlowDown(1.0f/messagePerSecond)
            .Subscribe(byteSubList =>
            {
                byte[] sendData = new byte[byteSubList.Count];
                byteSubList.CopyTo(sendData, 0);
                PhotonNetwork.RaiseEvent((byte)StreamingBytesEventCode.Streaming, sendData, raiseEventOptions, sendOptions);
            });
        }
Exemple #4
0
 internal override bool EnqueueOperation(Dictionary <byte, object> parameters, byte opCode, SendOptions sendParams, EgMessageType messageType = EgMessageType.Operation /* Metadata: 0x0064D574 */) => default; // 0x00000001806B1F60-0x00000001806B23A0
 internal override bool EnqueueMessage(object message, SendOptions sendOptions) => default;                                                                                                                     // 0x00000001806B1B30-0x00000001806B1F60
Exemple #5
0
 private bool AreReliableCommandsInTransit() => default;                                                                                                                                                        // 0x00000001806B03C0-0x00000001806B0520
 internal override bool EnqueueOperation(Dictionary <byte, object> parameters, byte opCode, SendOptions sendParams, EgMessageType messageType = EgMessageType.Operation /* Metadata: 0x0064D574 */) => default; // 0x00000001806B1F60-0x00000001806B23A0
Exemple #6
0
        public virtual bool SendOperation(byte operationCode, Dictionary <byte, object> operationParameters, SendOptions sendOptions)
        {
            bool flag = this.peerBase.usedTransportProtocol == ConnectionProtocol.WebSocketSecure;

            if (flag)
            {
                sendOptions.Encrypt = false;
            }
            object enqueueLock = this.EnqueueLock;
            bool   result;

            lock (enqueueLock)
            {
                result = this.peerBase.EnqueueOperation(operationParameters, operationCode, sendOptions, EgMessageType.Operation);
            }
            return(result);
        }