void OnDestroy() { Log.Info($"Player record destroy for {this.hub.nicknameSync._firstNickname} ({this.hub.characterClassManager.UserId}) ({this.hub.queryProcessor.PlayerId})"); RecorderCore.OnReceiveEvent(new LeaveData() { PlayerID = (sbyte)this.hub.queryProcessor.PlayerId }); RecorderCore.OnRegisterRecordPlayer(this); }
void OnDestroy() { Log.Info($"Pickup record destroy for {pickup.ItemId} ({uniqueId})"); RecorderCore.recordPickups.Remove(uniqueId); RecorderCore.OnReceiveEvent(new RemovePickupData() { ItemID = uniqueId }); RecorderCore.OnUnRegisterRecordPickup(this); }
private void Player_Shot(Exiled.Events.EventArgs.ShotEventArgs ev) { if (!RecorderCore.isRecording) { return; } RecorderCore.OnReceiveEvent(new ShotWeaponData() { PlayerID = (sbyte)ev.Shooter.Id }); }
private void Player_ReloadingWeapon(Exiled.Events.EventArgs.ReloadingWeaponEventArgs ev) { if (!RecorderCore.isRecording) { return; } RecorderCore.OnReceiveEvent(new ReloadWeaponData() { PlayerID = (sbyte)ev.Player.Id }); }
void Awake() { Log.Info($"Player record init for {this.hub.nicknameSync._firstNickname} ({this.hub.characterClassManager.UserId}) ({this.hub.queryProcessor.PlayerId})"); RecorderCore.OnReceiveEvent(new PlayerInfoData() { PlayerID = (sbyte)this.hub.queryProcessor.PlayerId, UserID = this.hub.characterClassManager.UserId, UserName = this.hub.nicknameSync._firstNickname }); RecorderCore.OnRegisterRecordPlayer(this); }
private void Player_Died(Exiled.Events.EventArgs.DiedEventArgs ev) { if (!RecorderCore.isRecording) { return; } RecorderCore.OnReceiveEvent(new UpdateRoleData() { PlayerID = (sbyte)ev.Target.Id, RoleID = (sbyte)RoleType.Spectator }); }
private void Player_ChangingRole(Exiled.Events.EventArgs.ChangingRoleEventArgs ev) { if (!RecorderCore.isRecording) { return; } RecorderCore.OnReceiveEvent(new UpdateRoleData() { PlayerID = (sbyte)ev.Player.Id, RoleID = (sbyte)ev.NewRole }); }
private void Player_InteractingDoor(Exiled.Events.EventArgs.InteractingDoorEventArgs ev) { if (!RecorderCore.isRecording) { return; } RecorderCore.OnReceiveEvent(new DoorData() { State = !ev.Door.TargetState, Position = ev.Door.transform.position.GetData() }); }
private void Player_InteractingElevator(Exiled.Events.EventArgs.InteractingElevatorEventArgs ev) { if (!RecorderCore.isRecording) { return; } if (ev.Status == Lift.Status.Moving) { return; } RecorderCore.OnReceiveEvent(new LiftData() { Elevatorname = ev.Lift.elevatorName }); }
public EventHandlers(RecorderCore core) { this.core = core; Exiled.Events.Handlers.Server.WaitingForPlayers += WaitingForPlayers; Exiled.Events.Handlers.Player.ChangingRole += Player_ChangingRole; Exiled.Events.Handlers.Player.ItemDropped += Player_ItemDropped; Exiled.Events.Handlers.Server.RestartingRound += Server_RestartingRound1; Exiled.Events.Handlers.Server.SendingRemoteAdminCommand += Server_SendingRemoteAdminCommand; Exiled.Events.Handlers.Player.InteractingDoor += Player_InteractingDoor; Exiled.Events.Handlers.Player.InteractingElevator += Player_InteractingElevator; Exiled.Events.Handlers.Player.Died += Player_Died; Exiled.Events.Handlers.Player.Shot += Player_Shot; Exiled.Events.Handlers.Player.ReloadingWeapon += Player_ReloadingWeapon; Exiled.Events.Handlers.Player.Verified += Player_Verified; Exiled.Events.Handlers.Map.SpawnedItem += Map_SpawnedItem; Exiled.Events.Handlers.Server.RoundStarted += Server_RoundStarted; firstrun = true; }
public void Update() { if (!RecorderCore.isRecording || pickup?.ItemId == ItemType.None) { return; } if (currentPosition != transform.position || currentRotation != transform.rotation) { currentPosition = transform.position; currentRotation = transform.rotation; RecorderCore.OnReceiveEvent(new UpdatePickupData() { ItemID = uniqueId, ItemType = (int)pickup.itemId, Position = transform.position.GetData(), Rotation = transform.rotation.GetData() }); } }
public void Update() { if (hub?.characterClassManager.NetworkCurClass == RoleType.Spectator || hub?.characterClassManager.NetworkCurClass == RoleType.None || !RecorderCore.isRecording) { return; } if (currentPosition != hub.transform.position || currentRotation != hub.playerMovementSync.Rotations) { currentPosition = hub.transform.position; currentRotation = hub.playerMovementSync.Rotations; RecorderCore.OnReceiveEvent(new UpdatePlayerData() { PlayerID = (sbyte)hub.queryProcessor.NetworkPlayerId, MoveState = (byte)hub.animationController.Network_curMoveState, HoldingItem = (sbyte)hub.inventory.Network_curItemSynced, CurrentAnim = hub.animationController.NetworkcurAnim, Speed = hub.animationController.Networkspeed.GetData(), Position = hub.transform.position.GetData(), Rotation = hub.playerMovementSync.Rotations.GetData() }); } }
public override void OnEnabled() { foreach (MethodBase bas in Evs.Events.Instance.Harmony.GetPatchedMethods()) { if (bas.Name.Equals("TransmitData")) { Exiled.Events.Events.DisabledPatchesHashSet.Add(bas); } } Evs.Events.Instance.ReloadDisabledPatches(); pluginDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "EXILED", "Plugins", "PlayerRecorder"); if (!Directory.Exists(pluginDir)) { Directory.CreateDirectory(pluginDir); } singleton = this; core = CustomNetworkManager.singleton.gameObject.AddComponent <RecorderCore>(); eventHandlers = new EventHandlers(core); core.handler = eventHandlers; HarmonyLib.Harmony hrm = new HarmonyLib.Harmony("Patcher.recorder"); hrm.PatchAll(); base.OnEnabled(); }
void Awake() { for (int i = 1; i < int.MaxValue; i++) { if (RecorderCore.recordPickups.Keys.Any(p => p == i)) { continue; } uniqueId = i; break; } RecorderCore.recordPickups.Add(uniqueId, this); RecorderCore.OnReceiveEvent(new CreatePickupData() { ItemID = uniqueId, ItemType = (int)pickup.ItemId, Position = pickup.position.GetData(), Rotation = pickup.rotation.GetData() }); Log.Info($"Pickup record init for {pickup.ItemId} ({uniqueId})"); RecorderCore.OnRegisterRecordPickup(this); }
void OnDestroy() { RecorderCore.replayPlayers.Remove(uniqueId); Log.Info($"Player replay destroy for {this.hub.nicknameSync.Network_myNickSync} ({this.hub.characterClassManager.UserId}) ({this.hub.queryProcessor.PlayerId})"); RecorderCore.OnUnRegisterReplayPlayer(this); }
void Awake() { Log.Info($"Player replay init for {this.hub.nicknameSync.Network_myNickSync} ({this.hub.characterClassManager.UserId}) ({this.hub.queryProcessor.PlayerId})"); RecorderCore.OnRegisterReplayPlayer(this); }
void OnDestroy() { Log.Info($"Pickup replay destroy for {pickup.ItemId} ({uniqueId})"); RecorderCore.replayPickups.Remove(uniqueId); RecorderCore.OnUnRegisterReplayPickup(this); }
void Awake() { Log.Info($"Pickup replay init for {pickup.ItemId}"); RecorderCore.OnRegisterReplayPickup(this); }
void Start() { singleton = this; ReceiveEvent += EventReceived; }