C# Class Wolfje.Plugins.SEconomy.WorldEconomy

World economy. Provides monetary gain and loss as a result of interaction in the world, including mobs and players.
Inheritance: IDisposable
Datei anzeigen Open project: tylerjwatson/SEconomy

Protected Properties

Property Type Description
PVPDamage int>.Dictionary
__NPCDamageMutex object
__dictionaryMutex object
__pvpDictMutex object

Public Methods

Method Description
Dispose ( ) : void
WorldEconomy ( SEconomy parent ) : System

Protected Methods

Method Description
AddNPCDamage ( Terraria NPC, Terraria Player, int Damage, bool crit = false ) : void

Adds damage done by a player to an NPC slot. When the NPC dies the rewards for it will fill out.

Dispose ( bool disposing ) : void
Game_Update ( EventArgs args ) : void
GetDeathPenalty ( TShockAPI.TSPlayer player ) : Money
GiveRewardsForNPC ( Terraria NPC ) : void

Should occur when an NPC dies; gives rewards out to all the players that hit it.

NetHooks_GetData ( TerrariaApi.Server.GetDataEventArgs args ) : void

Occurs when the server has received a message from the client.

NetHooks_SendData ( TerrariaApi.Server.SendDataEventArgs e ) : void

Occurs when the server has a chunk of data to send

PlayerHitPlayer ( int HitterSlot, int VictimSlot ) : void

Assigns the last player slot to a victim in PVP

ProcessDeath ( int DeadPlayerSlot, bool PVPDeath ) : void

Runs when a player dies, and hands out penalties if enabled, and rewards for PVP

Method Details

AddNPCDamage() protected method

Adds damage done by a player to an NPC slot. When the NPC dies the rewards for it will fill out.
protected AddNPCDamage ( Terraria NPC, Terraria Player, int Damage, bool crit = false ) : void
NPC Terraria
Player Terraria
Damage int
crit bool
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Game_Update() protected method

protected Game_Update ( EventArgs args ) : void
args System.EventArgs
return void

GetDeathPenalty() protected method

protected GetDeathPenalty ( TShockAPI.TSPlayer player ) : Money
player TShockAPI.TSPlayer
return Money

GiveRewardsForNPC() protected method

Should occur when an NPC dies; gives rewards out to all the players that hit it.
protected GiveRewardsForNPC ( Terraria NPC ) : void
NPC Terraria
return void

NetHooks_GetData() protected method

Occurs when the server has received a message from the client.
protected NetHooks_GetData ( TerrariaApi.Server.GetDataEventArgs args ) : void
args TerrariaApi.Server.GetDataEventArgs
return void

NetHooks_SendData() protected method

Occurs when the server has a chunk of data to send
protected NetHooks_SendData ( TerrariaApi.Server.SendDataEventArgs e ) : void
e TerrariaApi.Server.SendDataEventArgs
return void

PlayerHitPlayer() protected method

Assigns the last player slot to a victim in PVP
protected PlayerHitPlayer ( int HitterSlot, int VictimSlot ) : void
HitterSlot int
VictimSlot int
return void

ProcessDeath() protected method

Runs when a player dies, and hands out penalties if enabled, and rewards for PVP
protected ProcessDeath ( int DeadPlayerSlot, bool PVPDeath ) : void
DeadPlayerSlot int
PVPDeath bool
return void

WorldEconomy() public method

public WorldEconomy ( SEconomy parent ) : System
parent SEconomy
return System

Property Details

PVPDamage protected_oe property

Format for this dictionary: * key: Player ID * value: Last player hit ID
protected Dictionary PVPDamage
return int>.Dictionary

__NPCDamageMutex protected_oe static_oe property

Synch object for NPC damage, forcing NPC damages to be serialized
protected static object __NPCDamageMutex
return object

__dictionaryMutex protected_oe property

synch object for access to the dictionary. You MUST obtain a mutex through this object to access the dictionary member.
protected object __dictionaryMutex
return object

__pvpDictMutex protected_oe property

synch object for access to the pvp dictionary. You MUST obtain a mutex through this object to access the dictionary member.
protected object __pvpDictMutex
return object