Skip to content

Class: DewPlayer ​

csharp
[DewResourceLink(ResourceLinkBy.Type)]
public class DewPlayer : DewNetworkBehaviour, ILogicUpdate, ISettingsChangedCallback

Fields ​

NameDeclarationDescription
allHumanPlayerspublic static List<DewPlayer> allHumanPlayersAll human players that are connected to the server.
alliespublic readonly SyncList<DewPlayer> allies
availableLucidDreams`[NonSerialized]
public List<string> availableLucidDreams`Available on server.
ClientEvent_OnDreamDustChangedpublic SafeAction&lt;int, int&gt; ClientEvent_OnDreamDustChanged
ClientEvent_OnEarnDreamDustpublic SafeAction&lt;int&gt; ClientEvent_OnEarnDreamDust
ClientEvent_OnEarnGoldpublic SafeAction&lt;int&gt; ClientEvent_OnEarnGold
ClientEvent_OnEarnStardustpublic SafeAction&lt;int&gt; ClientEvent_OnEarnStardust
ClientEvent_OnEquippedNametagChangedpublic SafeAction&lt;string, string&gt; ClientEvent_OnEquippedNametagChanged
ClientEvent_OnGiveCurrencypublic SafeAction&lt;int, int, DewPlayer&gt; ClientEvent_OnGiveCurrencyArguments are as follows: Gold, DreamDust, Target
ClientEvent_OnGoldChangedpublic SafeAction&lt;int, int&gt; ClientEvent_OnGoldChanged
ClientEvent_OnHeroChangedpublic SafeAction&lt;Hero, Hero&gt; ClientEvent_OnHeroChanged
ClientEvent_OnIsReadyChangedpublic SafeAction&lt;bool&gt; ClientEvent_OnIsReadyChanged
ClientEvent_OnPlatinumCoinChangedpublic SafeAction&lt;int, int&gt; ClientEvent_OnPlatinumCoinChanged
ClientEvent_OnSelectedAccessoriesChangedpublic SafeAction ClientEvent_OnSelectedAccessoriesChanged
ClientEvent_OnSelectedDejavuItemChangedpublic SafeAction&lt;string&gt; ClientEvent_OnSelectedDejavuItemChanged
ClientEvent_OnSelectedHeroTypeChangedpublic SafeAction&lt;string&gt; ClientEvent_OnSelectedHeroTypeChanged
ClientEvent_OnSelectedLoadoutChangedpublic SafeAction&lt;HeroLoadoutData&gt; ClientEvent_OnSelectedLoadoutChanged
ClientEvent_OnSelectedSkinChangedpublic SafeAction&lt;string&gt; ClientEvent_OnSelectedSkinChanged
ClientEvent_OnSpendDreamDustpublic SafeAction&lt;int&gt; ClientEvent_OnSpendDreamDust
ClientEvent_OnSpendGoldpublic SafeAction&lt;int&gt; ClientEvent_OnSpendGold
ClientEvent_OnSpendStardustpublic SafeAction&lt;int&gt; ClientEvent_OnSpendStardust
ClientEvent_OnStateChangedpublic SafeAction ClientEvent_OnStateChanged
enemiespublic readonly SyncList&lt;DewPlayer&gt; enemies
friendSteamIds`[NonSerialized]
public List<string> friendSteamIds`
gamePlayerspublic static List&lt;DewPlayer&gt; gamePlayersHuman players that are playing the game.
lobbyPlayerspublic static List&lt;DewPlayer&gt; lobbyPlayersHuman players that are in the lobby. Note: players can be in the lobby even after the game has been started, if they joined mid-game.
neutralspublic readonly SyncList&lt;DewPlayer&gt; neutrals
onGamePlayerAddedpublic static SafeAction&lt;DewPlayer&gt; onGamePlayerAdded
onGamePlayerRemovedpublic static SafeAction&lt;DewPlayer&gt; onGamePlayerRemoved
onHumanPlayerAddedpublic static SafeAction&lt;DewPlayer&gt; onHumanPlayerAdded
onHumanPlayerRemovedpublic static SafeAction&lt;DewPlayer&gt; onHumanPlayerRemoved
onLobbyPlayerAddedpublic static SafeAction&lt;DewPlayer&gt; onLobbyPlayerAdded
onLobbyPlayerRemovedpublic static SafeAction&lt;DewPlayer&gt; onLobbyPlayerRemoved
onSpectatorAddedpublic static SafeAction&lt;DewPlayer&gt; onSpectatorAdded
onSpectatorRemovedpublic static SafeAction&lt;DewPlayer&gt; onSpectatorRemoved
ownedItems`[NonSerialized]
public List<string> ownedItems`
ownershipKeyspublic readonly SyncList&lt;string&gt; ownershipKeys
selectedAccessoriespublic readonly SyncList&lt;string&gt; selectedAccessories
spectatorspublic static List&lt;DewPlayer&gt; spectatorsHuman players that are in the game spectating. Note: this does not include game players with dead heroes.
steamIdpublic CSteamID steamId
unlockedGameItemspublic readonly SyncList&lt;string&gt; unlockedGameItems

Properties ​

NameDeclarationDescription
avatarpublic Texture2D avatar { get; }
buyPriceMultiplierpublic float buyPriceMultiplier { get; set; }
cleanseRefundMultiplierpublic float cleanseRefundMultiplier { get; set; }
controllingEntitypublic Entity controllingEntity { get; set; }
creeppublic static DewPlayer creep { get; }
cursorWorldPospublic Vector3 cursorWorldPos { get; }Cursor world position of this player. Available on server and local client in-game.
dismantleDreamDustMultiplierpublic float dismantleDreamDustMultiplier { get; set; }
dismantleGemDreamDustMultiplierpublic float dismantleGemDreamDustMultiplier { get; set; }
dismantleSkillDreamDustMultiplierpublic float dismantleSkillDreamDustMultiplier { get; set; }
doubleChaosChancepublic float doubleChaosChance { get; set; }
dreamDust`[SaveVar(SaveVarFlags.Default)]
public int dreamDust { get; set; }`
environmentpublic static DewPlayer environment { get; }Environment player. Owner of server entities will default to this.
equippedNametagpublic string equippedNametag { get; }
gamepadTargetEnemypublic Entity gamepadTargetEnemy { get; }Available on server and local client in-game.
gold`[SaveVar(SaveVarFlags.Default)]
public int gold { get; set; }`
guidpublic string guid { get; set; }This is given for each profile.
heropublic Hero hero { get; set; }
inputModepublic InputMode inputMode { get; }Available on server and local client in-game.
isCreepPlayerpublic bool isCreepPlayer { get; }
isEnvironmentPlayerpublic bool isEnvironmentPlayer { get; }
isEveryInfoSetpublic bool isEveryInfoSet { get; }
isGamepadExplicitAimpublic bool isGamepadExplicitAim { get; }Available on server and local client in-game.
isHostPlayerpublic bool isHostPlayer { get; }
isHumanPlayerpublic bool isHumanPlayer { get; }
isKickedpublic bool isKicked { get; }Available on server.
isLoadingForMidJoinpublic bool isLoadingForMidJoin { get; set; }
isPlayingCutscenepublic bool isPlayingCutscene { get; }Is this player in a cutscene? Available on server.
isReadingArtifactStorypublic bool isReadingArtifactStory { get; }
isReadypublic bool isReady { get; set; }Is ready to start the game (lobby) / travel to next node (ingame) / end the game (end result screen) ?
isSamplingCastInfopublic bool isSamplingCastInfo { get; }
isWaitingForContinueMidJoinpublic bool isWaitingForContinueMidJoin { get; set; }
localpublic static DewPlayer local { get; }
monsterKillGoldMultiplierpublic float monsterKillGoldMultiplier { get; set; }Available on server.
platinumCoin`[SaveVar(SaveVarFlags.Default)]
public int platinumCoin { get; set; }`
playerNamepublic string playerName { get; }
playerNameRawpublic string playerNameRaw { get; set; }
potionDropChanceMultiplierpublic float potionDropChanceMultiplier { get; set; }
profileStatspublic DewProfileStats profileStats { get; }
selectedDejavuItempublic string selectedDejavuItem { get; }
selectedHeroTypepublic string selectedHeroType { get; }
selectedLoadoutpublic HeroLoadoutData selectedLoadout { get; }
selectedSkinpublic string selectedSkin { get; }
sellPriceMultiplierpublic float sellPriceMultiplier { get; set; }
shopAddedItemspublic int shopAddedItems { get; set; }
state`[ShowInInspector]
[ReadOnly]
public PlayerState state { get; set; }`
totalMasteryLevelpublic int totalMasteryLevel { get; }

Methods ​

AddDreamDust(int) ​

csharp
public void AddDreamDust(int amount)

Parameters:

NameTypeDescription
amountint

AddGold(int) ​

csharp
public void AddGold(int amount)

Parameters:

NameTypeDescription
amountint

Awake() ​

csharp
protected override void Awake()

CheckEnemyOrNeutral(Entity) ​

csharp
public bool CheckEnemyOrNeutral(Entity target)

Parameters:

NameTypeDescription
targetEntity

Returns: bool

CmdAuthorizeForUse(string) ​

csharp
public void CmdAuthorizeForUse(string ownershipKey)

Parameters:

NameTypeDescription
ownershipKeystring

CmdGiveCurrency(int, int, DewPlayer) ​

csharp
public void CmdGiveCurrency(int goldAmount, int dreamDustAmount, DewPlayer target)

Parameters:

NameTypeDescription
goldAmountint
dreamDustAmountint
targetDewPlayer

CmdNotifyEveryInfoSet() ​

csharp
public void CmdNotifyEveryInfoSet()

CmdNotifyMidJoinReady(string) ​

csharp
public void CmdNotifyMidJoinReady(string sceneName)

Parameters:

NameTypeDescription
sceneNamestring

CmdPing() ​

csharp
public void CmdPing()

CmdRequestMidJoin() ​

csharp
public void CmdRequestMidJoin()

CmdRequestOverrides() ​

csharp
public void CmdRequestOverrides()

CmdRequestStardust(int) ​

csharp
public void CmdRequestStardust(int amount)

Parameters:

NameTypeDescription
amountint

CmdRequestToJoinCurrentLobby() ​

csharp
public void CmdRequestToJoinCurrentLobby()

CmdSetAccessories(List&lt;string&gt;) ​

csharp
public void CmdSetAccessories(List<string> accessories)

Parameters:

NameTypeDescription
accessoriesSystem.Collections.Generic.List&lt;T&gt;&lt;string&gt;

CmdSetDejavuItem(string) ​

csharp
public void CmdSetDejavuItem(string item)

Parameters:

NameTypeDescription
itemstring

CmdSetHeroLoadoutData(HeroLoadoutData) ​

csharp
public void CmdSetHeroLoadoutData(HeroLoadoutData newData)

Parameters:

NameTypeDescription
newDataHeroLoadoutData

CmdSetHeroType(string) ​

Set local player's hero type. Can only be called in local machine of this DewPlayer.

csharp
public void CmdSetHeroType(string newType)

Parameters:

NameTypeDescription
newTypestring

CmdSetIsReady(bool) ​

csharp
public void CmdSetIsReady(bool newReady)

Parameters:

NameTypeDescription
newReadybool

CmdSetNametag(string) ​

csharp
public void CmdSetNametag(string ntName)

Parameters:

NameTypeDescription
ntNamestring

CmdSetProfileStats(DewProfileStats) ​

csharp
public void CmdSetProfileStats(DewProfileStats stats)

Parameters:

NameTypeDescription
statsDewProfileStats

CmdSetSkin(string) ​

csharp
public void CmdSetSkin(string skin)

Parameters:

NameTypeDescription
skinstring

CmdSetUnlockedGameItems() ​

csharp
public void CmdSetUnlockedGameItems()

EarnDreamDust(int) ​

csharp
public void EarnDreamDust(int amount)

Parameters:

NameTypeDescription
amountint

EarnGold(int) ​

csharp
public void EarnGold(int amount)

Parameters:

NameTypeDescription
amountint

GetLocalUnlockedGameItems() ​

csharp
public static string[] GetLocalUnlockedGameItems()

Returns: string[]

GetTeamRelation(DewPlayer) ​

csharp
public TeamRelation GetTeamRelation(DewPlayer other)

Parameters:

NameTypeDescription
otherDewPlayer

Returns: TeamRelation

GetTeamRelation(Entity) ​

csharp
public TeamRelation GetTeamRelation(Entity other)

Parameters:

NameTypeDescription
otherEntity

Returns: TeamRelation

GiveStardust(int) ​

csharp
public void GiveStardust(int amount)

Parameters:

NameTypeDescription
amountint

HideOnScreenTimer(NetworkedOnScreenTimerHandle) ​

csharp
public void HideOnScreenTimer(NetworkedOnScreenTimerHandle handle)

Parameters:

NameTypeDescription
handleNetworkedOnScreenTimerHandle

IsAllowedToUseItem(string) ​

csharp
public bool IsAllowedToUseItem(string itemName)

Parameters:

NameTypeDescription
itemNamestring

Returns: bool

Kick() ​

csharp
public void Kick()

LogicUpdate(float) ​

csharp
public override void LogicUpdate(float dt)

Parameters:

NameTypeDescription
dtfloat

OnDestroy() ​

csharp
protected override void OnDestroy()

OnSettingsChanged() ​

csharp
public void OnSettingsChanged()

OnStart() ​

csharp
public override void OnStart()

OnStartClient() ​

csharp
public override void OnStartClient()

OnStop() ​

csharp
public override void OnStop()

OnStopServer() ​

csharp
public override void OnStopServer()

PurgeRelationsList() ​

Purge any despawned / null entries in player relation lists.

csharp
public void PurgeRelationsList()

RevalidateAllItems() ​

csharp
public void RevalidateAllItems()

RpcInvokeOnSpendStardust(int) ​

csharp
public void RpcInvokeOnSpendStardust(int amount)

Parameters:

NameTypeDescription
amountint

SendLog(string) ​

csharp
public void SendLog(string message)

Parameters:

NameTypeDescription
messagestring

SendLogError(string) ​

csharp
public void SendLogError(string message)

Parameters:

NameTypeDescription
messagestring

SendLogWarning(string) ​

csharp
public void SendLogWarning(string message)

Parameters:

NameTypeDescription
messagestring

ShowOnScreenTimer(NetworkedOnScreenTimerHandle) ​

csharp
public void ShowOnScreenTimer(NetworkedOnScreenTimerHandle handle)

Parameters:

NameTypeDescription
handleNetworkedOnScreenTimerHandle

Spend(Cost) ​

Note this will not work for stardusts.

csharp
public void Spend(Cost cost)

Parameters:

NameTypeDescription
costCost

SpendDreamDust(int) ​

csharp
public void SpendDreamDust(int amount)

Parameters:

NameTypeDescription
amountint

SpendGold(int) ​

csharp
public void SpendGold(int amount)

Parameters:

NameTypeDescription
amountint

TpcMakePlayerChangeLobby(string) ​

csharp
public void TpcMakePlayerChangeLobby(string lobbyId)

Parameters:

NameTypeDescription
lobbyIdstring

TpcNotifyDejavuUse() ​

csharp
public void TpcNotifyDejavuUse()

TpcShowCenterMessage(CenterMessageType, string, string[]) ​

csharp
public void TpcShowCenterMessage(CenterMessageType type, string key, string[] localizedFormatArgs)

Parameters:

NameTypeDescription
typeCenterMessageType
keystring
localizedFormatArgsstring[]

TpcShowCenterMessage(CenterMessageType, string) ​

csharp
public void TpcShowCenterMessage(CenterMessageType type, string key)

Parameters:

NameTypeDescription
typeCenterMessageType
keystring

TpcShowWorldPopMessage(WorldMessageSetting) ​

csharp
public void TpcShowWorldPopMessage(WorldMessageSetting message)

Parameters:

NameTypeDescription
messageWorldMessageSetting

Maintained by the Shape of Dreams Modding Community