C# Class fCraft.Player

Show file Open project: GlennMR/800craft Class Usage Examples

Public Properties

Property Type Description
FullPositionUpdateInterval int

Private Properties

Property Type Description
AddEntity void
ClearLowPriotityOutputQueue void
ClearPriorityOutputQueue void
DenyMovement void
DetectMovementPacketSpam bool
Disconnect void
GentlyKickBetaClients void
HideEntity void
IoLoop void
JoinWorldNow bool
KickNow void
LoginSequence bool
MeasureBandwidthUseRates void
MoveEntity void
NegotiateProtocolExtension bool
Player System
Player System
ProcessMessagePacket bool
ProcessMovementPacket void
ProcessOutgoingSetBlock void
ProcessSetBlockPacket void
ReAddEntity void
ReadString string
RemoveEntity void
ResetVisibleEntities void
ServeCfg void
ShowEntity void
UpdateVisibleEntities void

Public Methods

Method Description
JoinWorld ( [ newWorld, WorldChangeReason reason ) : void
JoinWorld ( [ newWorld, WorldChangeReason reason, Position position ) : void
Kick ( [ message, LeaveReason leaveReason ) : void

Kick (asynchronous). Immediately blocks all client input, but waits until client thread has sent the kick packet.

Send ( Packet packet ) : void

Send packet (thread-safe, async, priority queue). This is used for most packets (movement, chat, etc).

SendBlockPermissions ( ) : void
SendLowPriority ( Packet packet ) : void

Send packet (thread-safe, asynchronous, delayed queue). This is currently only used for block updates.

SendNow ( Packet packet ) : void

Send packet to player (not thread safe, sync, immediate). Should NEVER be used from any thread other than this session's ioThread. Not thread-safe (for performance reason).

StartSession ( [ tcpClient ) : void
WaitForDisconnect ( ) : void

Blocks the calling thread until this session disconnects.

Private Methods

Method Description
AddEntity ( [ player, Position newPos ) : void
ClearLowPriotityOutputQueue ( ) : void

Clears the low priority player queue.

ClearPriorityOutputQueue ( ) : void

Clears the priority player queue.

DenyMovement ( ) : void
DetectMovementPacketSpam ( ) : bool
Disconnect ( ) : void
GentlyKickBetaClients ( ) : void
HideEntity ( [ entity ) : void
IoLoop ( ) : void
JoinWorldNow ( [ newWorld, bool doUseWorldSpawn, WorldChangeReason reason ) : bool
KickNow ( [ message, LeaveReason leaveReason ) : void

Kick (synchronous). Immediately sends the kick packet. Can only be used from IoThread (this is not thread-safe).

LoginSequence ( ) : bool
MeasureBandwidthUseRates ( ) : void
MoveEntity ( [ entity, Position newPos ) : void
NegotiateProtocolExtension ( ) : bool
Player ( ) : System
Player ( [ tcpClient ) : System
ProcessMessagePacket ( ) : bool
ProcessMovementPacket ( ) : void
ProcessOutgoingSetBlock ( Packet &packet ) : void
ProcessSetBlockPacket ( ) : void
ReAddEntity ( [ entity, [ player, Position newPos ) : void
ReadString ( ) : string
RemoveEntity ( [ player ) : void
ResetVisibleEntities ( ) : void
ServeCfg ( ) : void
ShowEntity ( [ entity, Position newPos ) : void
UpdateVisibleEntities ( ) : void

Method Details

JoinWorld() public method

public JoinWorld ( [ newWorld, WorldChangeReason reason ) : void
newWorld [
reason WorldChangeReason
return void

JoinWorld() public method

public JoinWorld ( [ newWorld, WorldChangeReason reason, Position position ) : void
newWorld [
reason WorldChangeReason
position Position
return void

Kick() public method

Kick (asynchronous). Immediately blocks all client input, but waits until client thread has sent the kick packet.
public Kick ( [ message, LeaveReason leaveReason ) : void
message [
leaveReason LeaveReason
return void

Send() public method

Send packet (thread-safe, async, priority queue). This is used for most packets (movement, chat, etc).
public Send ( Packet packet ) : void
packet Packet
return void

SendBlockPermissions() public method

public SendBlockPermissions ( ) : void
return void

SendLowPriority() public method

Send packet (thread-safe, asynchronous, delayed queue). This is currently only used for block updates.
public SendLowPriority ( Packet packet ) : void
packet Packet
return void

SendNow() public method

Send packet to player (not thread safe, sync, immediate). Should NEVER be used from any thread other than this session's ioThread. Not thread-safe (for performance reason).
public SendNow ( Packet packet ) : void
packet Packet
return void

StartSession() public static method

public static StartSession ( [ tcpClient ) : void
tcpClient [
return void

WaitForDisconnect() public method

Blocks the calling thread until this session disconnects.
public WaitForDisconnect ( ) : void
return void

Property Details

FullPositionUpdateInterval public static property

public static int FullPositionUpdateInterval
return int