Beispiel #1
0
        public static NetworkReaderPooled Get(ArraySegment <byte> segment)
        {
            // grab from pool & set buffer
            NetworkReaderPooled reader = Pool.Get();

            reader.SetBuffer(segment);
            return(reader);
        }
Beispiel #2
0
        public static NetworkReaderPooled Get(byte[] bytes)
        {
            // grab from pool & set buffer
            NetworkReaderPooled reader = Pool.Get();

            reader.SetBuffer(bytes);
            return(reader);
        }
Beispiel #3
0
        void CmdOnAnimationParametersServerMessage(byte[] parameters)
        {
            // Ignore messages from client if not in client authority mode
            if (!clientAuthority)
            {
                return;
            }

            // handle and broadcast
            using (NetworkReaderPooled networkReader = NetworkReaderPool.Get(parameters))
            {
                HandleAnimParamsMsg(networkReader);
                RpcOnAnimationParametersClientMessage(parameters);
            }
        }
Beispiel #4
0
        void CmdOnAnimationServerMessage(int stateHash, float normalizedTime, int layerId, float weight, byte[] parameters)
        {
            // Ignore messages from client if not in client authority mode
            if (!clientAuthority)
            {
                return;
            }

            //Debug.Log($"OnAnimationMessage for netId {netId}");

            // handle and broadcast
            using (NetworkReaderPooled networkReader = NetworkReaderPool.Get(parameters))
            {
                HandleAnimMsg(stateHash, normalizedTime, layerId, weight, networkReader);
                RpcOnAnimationClientMessage(stateHash, normalizedTime, layerId, weight, parameters);
            }
        }
Beispiel #5
0
 public static void Return(NetworkReaderPooled reader)
 {
     Pool.Return(reader);
 }
Beispiel #6
0
 public static void Recycle(NetworkReaderPooled reader) => Return(reader);
Beispiel #7
0
 void RpcOnAnimationParametersClientMessage(byte[] parameters)
 {
     using (NetworkReaderPooled networkReader = NetworkReaderPool.Get(parameters))
         HandleAnimParamsMsg(networkReader);
 }
Beispiel #8
0
 void RpcOnAnimationClientMessage(int stateHash, float normalizedTime, int layerId, float weight, byte[] parameters)
 {
     using (NetworkReaderPooled networkReader = NetworkReaderPool.Get(parameters))
         HandleAnimMsg(stateHash, normalizedTime, layerId, weight, networkReader);
 }