Player Class
Jump to navigation
Jump to search
Player Class
This class represents a Player in the game and handles various functionalities related to the player's actions, state, and interactions within the game world.
Public Constant Fields
Public Fields
- `public VehicleSyncHelper vehicleSyncHelper` - Synchronizes vehicle-related data for the player.
- `public PlayerTeamSyncHelper TeamSyncHelper` - Handles synchronization of team-related data.
- `public PlayerScenarioSync ScnSyncHelper` - Manages synchronization of scenario data for the player.
- `public NetXmitter NetXmitter` - Facilitates network data transmission for the player.
- `public NetworkCommands NetworkCommands` - Executes network commands for the player.
- `public string ppid` - Stores the player's persistent ID.
- `public PilotProfile PilotProfile` - Contains the player's pilot profile information.
- `public KnownPlayer knownPlayer` - Represents a known player instance.
- `public GUnityEvent<View> OnViewStart` - Event triggered when the player's view starts.
- `public Vector3 vehicleSpawnOffset` - Offset for spawning vehicles.
- `public bool hasLaunchLocation` - Indicates if a launch location is set.
- `public Vector3d launchApos` - Stores the absolute spawn position for launching.
- `public Quaternion launchRot` - Stores the rotation for launch.
- `public Action<bool> OnFindMeStateChg` - Action triggered when the "find me" state changes.
- `public bool IsClientInEditor` - Indicates if the client is in editor mode.
- `public bool adminSV` - Indicates if the player has admin privileges.
- `public Teams TeamFlag` - Represents the player's team flag.
- `public double currentRTT` - Stores the current round-trip time for network communication.
Public Delegates
Public Events
Public Enums
Public Interfaces
- `IVehicleOwner` - Interface indicating the player is a vehicle owner.
Public Properties
- `public RigidbodyPhysicsEvents PhysicsEvents { get; }` - Gets the player's RigidbodyPhysicsEvents.
- `public Vector3d AbsSpawnPos { get; }` - Gets the player's absolute spawn position.
- `public Team Team { get; }` - Gets the player's team.
- `public bool IsAdmin { get; }` - Indicates if the player is an admin.
- `public bool isHost { get; }` - Indicates if the player is the host.
- `public Vehicle Vehicle { get; }` - Gets the player's vehicle.
- `public PlayerAvatar Avatar { get; }` - Gets the player's avatar.
- `public CapsuleCollider MainCollider { get; }` - Gets the player's main collider.
- `public PlayerMovement Movement { get; }` - Gets the player's movement component.
- `public PlayerRotation Rotation { get; }` - Gets the player's rotation component.
- `public PlayerFieldToolkit FieldToolkit { get; }` - Gets the player's field toolkit.
- `public Vector3 DefaultVehicleSpawnPos { get; }` - Gets the default vehicle spawn position.
- `public Quaternion DefaultVehicleSpawnRot { get; }` - Gets the default vehicle spawn rotation.
- `public Vector3 VehicleSpawnPos { get; }` - Gets the vehicle spawn position.
- `public Quaternion VehicleSpawnRot { get; }` - Gets the vehicle spawn rotation.
- `public float DistanceToVehicle { get; }` - Gets the distance to the vehicle.
- `public Vector3 DirectionToVehicle { get; }` - Gets the direction to the vehicle.
Public Methods
- `public void OnTeamSVChange(Teams _, Teams teamFlag)` - Handles changes in the player's team flag.
- `public void SetPlayerSpawnData(MsgPlayerSpawnData spawnData)` - Sets the player's spawn data.
- `public void SpawnVehicle(CraftInfo cInfo, bool allowCancel, Action<Vehicle> then = null)` - Spawns a vehicle with specified craft info.
- `public void SpawnVehicle(Construct ctr, bool allowCancel, Action<Vehicle> then = null, bool suppressUImsg = false)` - Spawns a vehicle with specified construct.
- `public void DespawnVehicle(Action onSuccess = null)` - Despawns the player's vehicle.
- `public void OnPlayerDisconnecting()` - Handles player disconnection.
- `public void SetLaunchLocation(Vector3 wpos, Quaternion wrot, bool announce = false)` - Sets the launch location.
- `public void ClearLaunchLocation(bool announce = false)` - Clears the launch location.
- `public void ResetVehicleToHome(Action then = null, bool overrideLaunchLocation = false, bool repairDamage = true, bool? shutoffEngines = null, bool armAutoGrab = true)` - Resets the vehicle to home position.
- `public void ResetVehicle(Vector3 wpos, Quaternion? wrot = null, Action then = null, bool repairDamage = true, bool? shutoffEngines = null, bool armAutoGrab = true)` - Resets the vehicle to a specified position.
- `public async void FindMe(float durationSecs = 8f)` - Activates "find me" mode for the player.
- `public string GetName()` - Gets the player's name.
- `public Team GetTeam()` - Gets the player's team.
- `public Teams GetTeamFlag()` - Gets the player's team flag.
- `public float GetPingMsOnLocalClient()` - Gets the ping in milliseconds on the local client.
- `public void CmdSpawnVehicle(Vector3 aPos, Quaternion wRot, Guid netTransferID)` - Command to spawn a vehicle.
- `public void CmdDespawnVehicle(GameObject vGo, uint[] partIDlist)` - Command to despawn a vehicle.
- `public void CmdPing(double t0)` - Command to ping the server.
- `public void Cmd_ClientInEditorModeUpdate(bool v)` - Command to update editor mode status.
- `public void RpcOnVehicleSpawn(GameObject vGo, Guid netTransferID, Vector3 aPos)` - RPC to handle vehicle spawn.
- `public void TargetOnSpawnVehicle(NetworkConnection tgt, GameObject vehicleGo)` - Target RPC to handle vehicle spawn.
- `public void RPCOnDisconnecting()` - RPC to handle player disconnection.
- `public void Rpc_OnWillDeleteVehicle(GameObject vGo)` - RPC to handle vehicle deletion.
- `public IEnumerator WaitForServerCR(bool allowCancel, Func<bool> whileCondition, Action then, Action<bool> onFail, float timeout = 10f)` - Coroutine to wait for server response.
Public Structs
Public Classes
See Also
- VehicleSyncHelper Class
- PlayerTeamSyncHelper Class
- PlayerScenarioSync Class
- NetXmitter Class
- NetworkCommands Class
- PilotProfile Class
- KnownPlayer Class
- GUnityEvent Class
- PlayerAvatar Class
- Vehicle Class
- RigidbodyPhysicsEvents Class
- PlayerMovement Class
- PlayerRotation Class
- PlayerFieldToolkit Class