Class Player
Inheritance
System.Object
Player
Implements
System.IDisposable
Assembly: Eco.Gameplay.dll
Syntax
public sealed class Player : WorldObserver, ICanTakeDamage, IDisposable, INotificationReceiver
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
Name
Declaration
public override string Name { get; }
Property Value
| Type |
Description |
| System.String |
|
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
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 |
|
GiveReputationTo(User, Int32, Single, String, Vector3i)
Declaration
public void GiveReputationTo(User user, int targetID, float value, string review, Vector3i actionLocation)
Parameters
| Type |
Name |
Description |
| User |
user |
|
| System.Int32 |
targetID |
|
| System.Single |
value |
|
| System.String |
review |
|
| Vector3i |
actionLocation |
|
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
InfoBox(String)
Declaration
public override void InfoBox(string msg)
Parameters
| Type |
Name |
Description |
| System.String |
msg |
|
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 |
|
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.
|
ShowLocation(PointOfInterest)
Declaration
public void ShowLocation(PointOfInterest pointOfInterest)
Parameters
ShowLocationPos(Vector3i)
Declaration
public void ShowLocationPos(Vector3i position)
Parameters
SimulationInteract(INetObject, WorldObserver.SimulationInteractType)
Declaration
public override void SimulationInteract(INetObject interactor, WorldObserver.SimulationInteractType interactionType)
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
StopEmotes()
Declaration
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
TryDamage(INetObject, Single, DamageSourceType)
Declaration
public bool TryDamage(INetObject source, float damage, DamageSourceType sourceType)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
TryDamage(Int32, Single, DamageSourceType)
Delegates damage to User.
Declaration
public bool TryDamage(int source, float damage, DamageSourceType sourceType)
Parameters
| Type |
Name |
Description |
| System.Int32 |
source |
|
| System.Single |
damage |
|
| DamageSourceType |
sourceType |
|
Returns
| Type |
Description |
| System.Boolean |
|
TrySetEmote(String)
Declaration
public void TrySetEmote(string emoteID)
Parameters
| Type |
Name |
Description |
| System.String |
emoteID |
|
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type |
Description |
| System.ComponentModel.PropertyChangedEventHandler |
|
Implements
System.IDisposable
Extension Methods