Beispiel #1
0
 public void Deserialize(SerializationBuffer buf)
 {
     Add            = buf.ReadBool();
     ForLocalPlayer = buf.ReadBool();
     PlayerId       = buf.ReadInt();
     PlayerName     = buf.ReadString();
 }
 public void ReadFromBuffer(SerializationBuffer buf)
 {
     MoveAxisForward = buf.ReadFloat();
     MoveAxisRight   = buf.ReadFloat();
     CameraRotation  = buf.ReadQuaternion();
     JumpDown        = buf.ReadBool();
     Fire            = buf.ReadBool();
 }
        public void ReadFromBuffer(SerializationBuffer buf)
        {
            int CharacterStatesCount = buf.ReadInt();

            for (int i = 0; i < CharacterStatesCount; i++)
            {
                int characterId = buf.ReadInt();

                Vector3    position  = buf.ReadVector3();
                Quaternion rotation  = buf.ReadQuaternion();
                Vector3    velocity  = buf.ReadVector3();
                bool       isStunned = buf.ReadBool();

                // Find CharacterState corresponding to this ID and apply the state
                for (int j = 0; j < CharacterStates.Count; j++)
                {
                    if (CharacterStates[j].DataId == characterId)
                    {
                        IdentifiedData <MyCharacterState> tmpIdCharState = CharacterStates[j];

                        tmpIdCharState.DataStruct.MotorState.Position     = position;
                        tmpIdCharState.DataStruct.MotorState.Rotation     = rotation;
                        tmpIdCharState.DataStruct.MotorState.BaseVelocity = velocity;

                        tmpIdCharState.DataStruct.IsStunned = isStunned;

                        CharacterStates[j] = tmpIdCharState;
                        break;
                    }
                }
            }
        }
Beispiel #4
0
 public void Deserialize(SerializationBuffer buf)
 {
     PlayerId      = buf.ReadInt();
     IsLocalPlayer = buf.ReadBool();
 }