Class Player
Inheritance
System.Object
Player
Implements
System.IDisposable
Assembly: Eco.Gameplay.dll
Syntax
public sealed class Player : WorldObserver, IPredator, ICanTakeDamage, IPrey, INetObjectPosition, INetObject, IPositionAndBounds, IDisposable, IDynamicObstacle
Constructors
Player(User, Single, INetClient)
Declaration
public Player(User user, float viewDistance, INetClient client)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Single |
viewDistance |
|
INetClient |
client |
|
Fields
MountManager
Handles all player vehicle mounting and dismounting logic.
Declaration
public readonly MountManager MountManager
Field Value
OnChangedPlotPosition
Declaration
public ThreadSafeAction<PlotPos> OnChangedPlotPosition
Field Value
Properties
BaseVelocity
Declaration
public Vector3 BaseVelocity { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
Client
Declaration
public override INetClient Client { get; }
Property Value
ControllerID
Declaration
public ref int ControllerID { get; }
Property Value
Type |
Description |
System.Int32 |
|
DesiredSpeed
Declaration
public float DesiredSpeed { get; }
Property Value
Type |
Description |
System.Single |
|
DisplayName
Declaration
public string DisplayName { get; }
Property Value
Type |
Description |
System.String |
|
FacingDir
Declaration
public override Vector3 FacingDir { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
Flying
Declaration
public bool Flying { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsInitialized
Declaration
public override bool IsInitialized { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
MinimapObject
Declaration
public MinimapObject MinimapObject { get; }
Property Value
OnMarkerAdd
Declaration
public ThreadSafeAction<WorldMarker> OnMarkerAdd { get; }
Property Value
OnTwitchEnableStateChange
Declaration
public static ThreadSafeAction<User, bool> OnTwitchEnableStateChange { get; }
Property Value
TargetId
Declaration
public int TargetId { get; }
Property Value
Type |
Description |
System.Int32 |
|
TargetPos
Declaration
public Vector3i TargetPos { get; }
Property Value
TwitchEnabled
Flag determining if the player currently has the Twitch integration enabled.
Declaration
public bool TwitchEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
User
Declaration
[NewTooltipChildren]
public User User { get; }
Property Value
Methods
ChangeBodyEmote(AnimationEmote)
These RPCs are called from local player (i.e. owner of this Player) after local player checks if it's possible to play the emote.
Sends an RPC to all clients. Notify the clients to start playing an emote animation.
Declaration
public void ChangeBodyEmote(AnimationEmote bodyEmote)
Parameters
ChangeExpressionEmote(ExpressionEmote)
Declaration
public void ChangeExpressionEmote(ExpressionEmote expressionEmote)
Parameters
CheckEmotes(INetClient, AnimationEmote, ExpressionEmote)
Sends an RPC only to the player who requested the emote. Player will check if possible to play the emote and then notify the server.
This function is called from a chat command call when a player wants to change their emote.
Declaration
public void CheckEmotes(INetClient client, AnimationEmote bodyEmote, ExpressionEmote expressionEmote)
Parameters
ConfirmBox(LocString)
Declaration
public Task<bool> ConfirmBox(LocString message)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Declaration
public Task<bool> ConfirmBoxLoc(FormattableString message)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
ConvertToType(Type)
Declaration
public override object ConvertToType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Object |
|
DeleteAllWaypoints()
Declaration
public void DeleteAllWaypoints()
Destroy()
Declaration
public override void Destroy()
DestroyPlayer()
Declaration
public void DestroyPlayer()
Dispose()
Declaration
DropExactWaypoint(Vector3i, String)
Declaration
public void DropExactWaypoint(Vector3i pos, string data)
Parameters
Type |
Name |
Description |
Vector3i |
pos |
|
System.String |
data |
|
DropWaypoint(Vector2i)
Declaration
public void DropWaypoint(Vector2i pos)
Parameters
Error(LocString)
Declaration
public override void Error(LocString message)
Parameters
Declaration
public void ErrorLoc(FormattableString message)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
ErrorLocStr(String)
Declaration
public void ErrorLocStr(string message)
Parameters
Type |
Name |
Description |
System.String |
message |
|
GetItemForType(String)
Declaration
public Item GetItemForType(string typeName)
Parameters
Type |
Name |
Description |
System.String |
typeName |
|
Returns
GetItemUILinkForType(String)
Declaration
public string GetItemUILinkForType(string typeName)
Parameters
Type |
Name |
Description |
System.String |
typeName |
|
Returns
Type |
Description |
System.String |
|
GiveReputationTo(User, Int32, Single, String)
Declaration
public void GiveReputationTo(User user, int targetID, float value, string review)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Int32 |
targetID |
|
System.Single |
value |
|
System.String |
review |
|
Declaration
public void HandleButtonLinkClicked(string linkId, string rpcMethodName, BSONObject args)
Parameters
Type |
Name |
Description |
System.String |
linkId |
|
System.String |
rpcMethodName |
|
BSONObject |
args |
|
Declaration
public void HandleLinkClicked(string linkId, bool cntrPressed, bool shiftPressed, TooltipOrigin origin)
Parameters
Type |
Name |
Description |
System.String |
linkId |
|
System.Boolean |
cntrPressed |
|
System.Boolean |
shiftPressed |
|
TooltipOrigin |
origin |
|
Declaration
public void HandleViewLinkClicked(IController obj, bool cntrPressed, bool shiftPressed, TooltipOrigin origin)
Parameters
InfoBox(LocString)
Declaration
public void InfoBox(LocString message)
Parameters
Declaration
public void InfoBoxExtraLoc(FormattableString message, string extra)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
System.String |
extra |
|
Declaration
public void InfoBoxLoc(FormattableString message)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
InfoBoxLocStr(String)
Declaration
public void InfoBoxLocStr(string message)
Parameters
Type |
Name |
Description |
System.String |
message |
|
Presents a large text input dialog to the user to send a text back to the server or hit cancel.
Declaration
public Task<string> InputLargeString(LocString message, Nullable<LocString> defaultText = null, int maxLength = 400)
Parameters
Type |
Name |
Description |
LocString |
message |
|
System.Nullable<LocString> |
defaultText |
|
System.Int32 |
maxLength |
Sets the max number of characters that the user can enter into the text field.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.String> |
Text entered by the user if they hit confirm. Otherwise returns the value of System.String.Empty
|
Presents a password input dialog to the user to send a text back to the server or hit cancel.
Declaration
public Task<string> InputPasswordString(LocString message, Nullable<LocString> defaultText = null)
Parameters
Type |
Name |
Description |
LocString |
message |
Message to show to the user about the text they are entering
|
System.Nullable<LocString> |
defaultText |
Default text to place into the input field
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.String> |
Text entered by the user if they hit confirm. Otherwise returns the value of System.String.Empty
|
Presents a text input dialog to the user to send a text back to the server or hit cancel.
Declaration
public Task<string> InputString(LocString message, Nullable<LocString> defaultText = null)
Parameters
Type |
Name |
Description |
LocString |
message |
Message to show to the user about the text they are entering
|
System.Nullable<LocString> |
defaultText |
Default text to place into the input field
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.String> |
Text entered by the user if they hit confirm. Otherwise returns the value of System.String.Empty
|
IsAdmin()
Declaration
public override bool IsAdmin()
Returns
Type |
Description |
System.Boolean |
|
IsUpdated(INetObjectViewer)
Declaration
public override bool IsUpdated(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsValidPlacement(Vector3i, Quaternion)
This function is called by the client when the player is in 'shadow placement' mode.
It checks if a placement position is valid or not, by receiving the position and rotation of the object to be placed from the player.
Returns true if the placement is valid, false otherwise. Also returns the blocks that are blocking the object placement position, if any.
Declaration
public (bool, List<Vector3i>) IsValidPlacement(Vector3i position, Quaternion rotation)
Parameters
Returns
Type |
Description |
System.ValueTuple<System.Boolean, System.Collections.Generic.List<Vector3i>> |
|
LargeInfoBox(LocString, LocString, Nullable<LocString>)
Opens a large popup dialog box with the supplied text and header.
Declaration
public Task<bool> LargeInfoBox(LocString header, LocString message, Nullable<LocString> button = null)
Parameters
Type |
Name |
Description |
LocString |
header |
Header of the new popup dialog.
|
LocString |
message |
The text to display to the user in the popup dialog.
|
System.Nullable<LocString> |
button |
Text to display on the button. Defaults to "Ok".
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
LargeInfoBoxConfirm(LocString, LocString, Nullable<LocString>, Nullable<LocString>)
Opens a large resizable popup dialog box with the supplied text, header and two buttons.
Declaration
public Task<bool> LargeInfoBoxConfirm(LocString header, LocString message, Nullable<LocString> buttonOne = null, Nullable<LocString> buttonTwo = null)
Parameters
Type |
Name |
Description |
LocString |
header |
Header of the new popup dialog.
|
LocString |
message |
Text to display to the user in the popup dialog.
|
System.Nullable<LocString> |
buttonOne |
Text to display on the first button ('Ok' by default).
|
System.Nullable<LocString> |
buttonTwo |
Text to display on the second button ('Copy' by default).
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Opens a large resizable popup dialog box with the supplied text, header and two buttons. Seconds button will be 'copy'
Declaration
public Task<bool> LargeInfoBoxWithTwoButtons(LocString header, LocString message, Nullable<LocString> buttonOne = null, Nullable<LocString> buttonTwo = null)
Parameters
Type |
Name |
Description |
LocString |
header |
Header of the new popup dialog.
|
LocString |
message |
Text to display to the user in the popup dialog.
|
System.Nullable<LocString> |
buttonOne |
Text to display on the first button ('Ok' by default).
|
System.Nullable<LocString> |
buttonTwo |
Text to display on the second button ('Copy' by default).
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
MinimapOpened()
Declaration
public void MinimapOpened()
MinimapSelectLayer()
Declaration
public void MinimapSelectLayer()
Msg(LocString, NotificationStyle)
Declaration
public void Msg(LocString message, NotificationStyle style)
Parameters
Declaration
public void MsgLoc(FormattableString message, NotificationStyle style)
Parameters
MsgLocStr(String, NotificationStyle)
Declaration
public void MsgLocStr(string message, NotificationStyle style)
Parameters
NotifyMinimapIsOpenInWindowOrFullscreenMode()
Declaration
public void NotifyMinimapIsOpenInWindowOrFullscreenMode()
OkBox(LocString)
Declaration
public void OkBox(LocString message)
Parameters
OkBox(LocString, Boolean)
Declaration
public Result OkBox(LocString message, bool succeeded)
Parameters
Type |
Name |
Description |
LocString |
message |
|
System.Boolean |
succeeded |
|
Returns
OkBoxAwaitable(LocString)
Declaration
public Task<bool> OkBoxAwaitable(LocString message)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Declaration
public Task<bool> OkBoxAwaitableLoc(FormattableString message)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Declaration
public void OkBoxExtraLoc(FormattableString message, string extra)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
System.String |
extra |
|
Declaration
public void OkBoxLoc(FormattableString message)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
Declaration
public Result OkBoxLoc(FormattableString message, bool succeeded)
Parameters
Type |
Name |
Description |
System.FormattableString |
message |
|
System.Boolean |
succeeded |
|
Returns
OkBoxLocStr(String)
Declaration
public void OkBoxLocStr(string message)
Parameters
Type |
Name |
Description |
System.String |
message |
|
OpenInfoPanel(String, String, String)
Declaration
public void OpenInfoPanel(string title, string text, string category)
Parameters
Type |
Name |
Description |
System.String |
title |
|
System.String |
text |
|
System.String |
category |
The category, based on which will be remembered preferred positions and size.
|
OpenObjectives()
Opens the Objectives UI on the client.
Declaration
public void OpenObjectives()
OpenRepDialog(Int32)
Declaration
public void OpenRepDialog(int targetID)
Parameters
Type |
Name |
Description |
System.Int32 |
targetID |
|
OptionBox(LocString, List<String>)
Shows a dialog with a dropdown.
Declaration
public Task<int> OptionBox(LocString message, List<string> options)
Parameters
Type |
Name |
Description |
LocString |
message |
The text to be shown.
|
System.Collections.Generic.List<System.String> |
options |
Options to be added to the dropdown.
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
Index of the selected item. -1 if the player cancels the dialog.
|
ReceiveUpdate(BSONObject)
Declaration
public override void ReceiveUpdate(BSONObject bsonObj)
Parameters
SendInitialState(BSONObject, INetObjectViewer)
Declaration
public override void SendInitialState(BSONObject obj, INetObjectViewer viewer)
Parameters
SendUpdate(BSONObject, INetObjectViewer)
Declaration
public override void SendUpdate(BSONObject obj, INetObjectViewer viewer)
Parameters
SetFlying(Boolean)
Declaration
public void SetFlying(bool set)
Parameters
Type |
Name |
Description |
System.Boolean |
set |
|
SetInitialMinimapObjectPos()
Declaration
public void SetInitialMinimapObjectPos()
SetPosition(Vector3)
Declaration
public void SetPosition(Vector3 position)
Parameters
Type |
Name |
Description |
System.Numerics.Vector3 |
position |
|
SetPositionAndRotation(Vector3, Quaternion)
Declaration
public void SetPositionAndRotation(Vector3 position, Quaternion rotation)
Parameters
Type |
Name |
Description |
System.Numerics.Vector3 |
position |
|
Quaternion |
rotation |
|
SetRelativePosAndRot(Int32, Vector3, Vector3)
Declaration
public void SetRelativePosAndRot(int targetID, Vector3 position, Vector3 direction)
Parameters
Type |
Name |
Description |
System.Int32 |
targetID |
|
System.Numerics.Vector3 |
position |
|
System.Numerics.Vector3 |
direction |
|
SetTwitchEnabled(Boolean)
Sets the player's twitch enabled state
Declaration
public void SetTwitchEnabled(bool state)
Parameters
Type |
Name |
Description |
System.Boolean |
state |
Client's new Twitch integration enabled state
|
SetTwitchEnabledOnServer(Boolean)
Sets the client's current Twitch enabled status state.
Declaration
public void SetTwitchEnabledOnServer(bool state)
Parameters
Type |
Name |
Description |
System.Boolean |
state |
State that the client is currently in.
|
Declaration
public bool ShouldFleeUs(IPrey prey)
Parameters
Type |
Name |
Description |
IPrey |
prey |
|
Returns
Type |
Description |
System.Boolean |
|
ShowLocation(PointOfInterest)
Declaration
public void ShowLocation(PointOfInterest pointOfInterest)
Parameters
ShowLocationPos(Vector3i)
Declaration
public void ShowLocationPos(Vector3i position)
Parameters
SpawnBlockEffect(Vector3i, Type, BlockEffect)
Declaration
public void SpawnBlockEffect(Vector3i blockPosition, Type blockType, BlockEffect effect)
Parameters
SpawnBlockEffect(Vector3i, Type, BlockEffect, BlockEffectParameters)
Declaration
public void SpawnBlockEffect(Vector3i blockPosition, Type blockType, BlockEffect effect, BlockEffectParameters parameters)
Parameters
SpawnBlockEffect(WrappedWorldPosition3i, Type, BlockEffect, BlockEffectParameters)
Declaration
public void SpawnBlockEffect(WrappedWorldPosition3i blockPosition, Type blockType, BlockEffect effect, BlockEffectParameters parameters)
Parameters
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
TryDamage(INetObject, Single)
Delegates damage to User.
Declaration
public bool TryDamage(INetObject source, float damage)
Parameters
Type |
Name |
Description |
INetObject |
source |
|
System.Single |
damage |
|
Returns
Type |
Description |
System.Boolean |
|
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
Description |
System.ComponentModel.PropertyChangedEventHandler |
|
Implements
System.IDisposable
Extension Methods