Пример #1
0
 // Token: 0x06001B36 RID: 6966 RVA: 0x0008C068 File Offset: 0x0008A268
 public void PositionUpdate(PlayerMovement update, ushort gameFrame)
 {
     this.MovementState   = (MoveStates)update.MovementState;
     this.KeyState        = (KeyState)update.KeyState;
     this.Velocity        = update.Velocity;
     this.hRotationTarget = Conversion.Byte2Angle(update.HorizontalRotation);
     this.vRotationTarget = Conversion.Byte2Angle(update.VerticalRotation);
     this.sampler.Add(update, gameFrame);
     this.debugger.AddSample(update.Position, this.MovementState);
     this.InterpolateMovement();
     this.OnPositionUpdate(update);
 }
Пример #2
0
 // Token: 0x06001A8F RID: 6799 RVA: 0x0008A9F4 File Offset: 0x00088BF4
 public void PlayerDamaged(DamageEvent damageEvent)
 {
     if (this.Player != null)
     {
         foreach (KeyValuePair <byte, byte> keyValuePair in damageEvent.Damage)
         {
             global::EventHandler.Global.Fire(new GameEvents.PlayerDamage
             {
                 Angle       = Conversion.Byte2Angle(keyValuePair.Key),
                 DamageValue = (float)keyValuePair.Value
             });
             if ((damageEvent.DamageEffectFlag & 1) != 0)
             {
                 this.Player.DamageFactor = damageEvent.DamgeEffectValue;
             }
         }
     }
 }
Пример #3
0
    // Token: 0x06001A99 RID: 6809 RVA: 0x0008B074 File Offset: 0x00089274
    public void PlayerRespawned(int cmid, Vector3 position, byte rotation)
    {
        GameActorInfo gameActorInfo;

        if (this.TryGetActorInfo(cmid, out gameActorInfo))
        {
            if (gameActorInfo.Cmid == PlayerDataManager.Cmid && gameActorInfo.TeamID == TeamID.NONE && this.GameMode != GameModeType.DeathMatch)
            {
                Debug.LogWarning("PlayerRespawned failed, invalid team for gamemode");
                Singleton <GameStateController> .Instance.LeaveGame(false);

                return;
            }
            if (!this.Avatars.ContainsKey(cmid))
            {
                this.InstantiateAvatar(gameActorInfo);
            }
            CharacterConfig characterConfig;
            if (this.Avatars.TryGetValue(cmid, out characterConfig))
            {
                this.RemotePlayerStates.UpdatePositionHard(characterConfig.State.Player.PlayerId, position);
                characterConfig.Reset();
            }
            if (cmid == PlayerDataManager.Cmid)
            {
                global::EventHandler.Global.Fire(new GameEvents.PlayerRespawn
                {
                    Position = position,
                    Rotation = Conversion.Byte2Angle(rotation)
                });
            }
        }
        else
        {
            Debug.LogError(string.Format("PlayerRespawned failed {0} because not found in the list of players!", cmid));
        }
    }