C# 클래스 MCSharp.Player

파일 보기 프로젝트 열기: Voziv/MCSharp 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Loading bool
bindings byte[]
connections List
disconnected bool
group Group
hidden bool
id byte
ip string
isJailed bool
isJoker bool
isMuted bool
lastSeen DateTime>.Dictionary
left string>.Dictionary
name string
players ThreadedBindingList

공개 메소드들

메소드 설명
Ban ( string name ) : void

Changes the players rank to banned.

ChangeRank ( Player p, GroupEnum g ) : void

Changes a players rank

ChangeRank ( string name, GroupEnum g ) : void

Changes the given players rank

Disconnect ( ) : void

Handles a player disconnection. Cleans up the player from other players on the server as well as handles cleaning up the player from the system.

Exists ( byte id ) : bool

Checks to see if a player exists in the list

Exists ( string name ) : bool

Checks to see if a player exists in the list

Find ( string name ) : Player

Finds a player in the list

GZip ( byte bytes ) : byte[]

Zips an array of bytes using gzip

GetColor ( string name ) : string

Gets the color for a given player

GetGroup ( string name ) : Group

Get the group of a given player

GetPlayers ( ) : List

Returns the list of players.

GetRank ( string name ) : GroupEnum

Gets a players rank

HandleBlockchange ( byte message ) : void

Handles a player blockchange packet

HandleLogin ( byte message ) : void

Handles a player login packet

IsOnline ( string name ) : bool

Determines if the user is online

Kick ( string message ) : void

Kicks the player with a given message

Player ( Socket s ) : System

The main constructor for the player.

SMPKick ( string message ) : void

A kick function that works for the new SMP clients. That way they have a friendly way of being removed from the server instead of "Invalid packet id 2"

SendBlockchange ( ushort x, ushort y, ushort z, byte type ) : void
SendChat ( Player p, string message ) : void
SendDie ( byte id ) : void
SendKick ( string message ) : void
SendMap ( ) : void
SendMessage ( byte id, string message ) : void
SendMessage ( string message ) : void
SendMotd ( ) : void
SendPing ( ) : void
SendPos ( byte id, ushort x, ushort y, ushort z, byte rotx, byte roty ) : void
SendRaw ( byte send ) : void
SendRaw ( int id ) : void
SendRaw ( int id, byte send ) : void
SendSpawn ( byte id, string name, ushort x, ushort y, ushort z, byte rotx, byte roty ) : void
ToString ( ) : string
UpdatePosition ( ) : void
ValidName ( string name ) : bool

Checks to see if a players name is valid

initNetworking ( Socket s ) : void

Initializes the players networking and handles the incoming socket connection.

loginTimerCallback ( Object sender, ElapsedEventArgs e ) : void

Handles the login timer callback once it finishes. If the player has not been authenticated then we kick them.

비공개 메소드들

메소드 설명
CheckBlockSpam ( ) : bool

Detects whether or not a player is spamming blocks around the map

FreeId ( ) : byte

Find the next free id available

HTNO ( short x ) : byte[]

Converts a short to network byte order

HTNO ( ushort x ) : byte[]

Converts a ushort to network byte order

HandleMessage ( byte buffer ) : byte[]

Handles messages in the buffer

NTHO ( byte x, int offset ) : ushort

Converts a ushort to host byte order

Receive ( IAsyncResult result ) : void

Handles network callbacks and adding to the players buffer

StringFormat ( string str, int size ) : byte[]

Formats a string

Wordwrap ( string message ) : List

Performs wordwrap on a string

checkOp ( ) : bool

Checks to see if the player has operator permissions

메소드 상세

Ban() 공개 정적인 메소드

Changes the players rank to banned.
public static Ban ( string name ) : void
name string The player's name to ban
리턴 void

ChangeRank() 공개 정적인 메소드

Changes a players rank
public static ChangeRank ( Player p, GroupEnum g ) : void
p Player The player object to change
g GroupEnum The rank to change the player to
리턴 void

ChangeRank() 공개 정적인 메소드

Changes the given players rank
public static ChangeRank ( string name, GroupEnum g ) : void
name string The name of the player
g GroupEnum The players new rank
리턴 void

Disconnect() 공개 메소드

Handles a player disconnection. Cleans up the player from other players on the server as well as handles cleaning up the player from the system.
public Disconnect ( ) : void
리턴 void

Exists() 공개 정적인 메소드

Checks to see if a player exists in the list
public static Exists ( byte id ) : bool
id byte The id of the player
리턴 bool

Exists() 공개 정적인 메소드

Checks to see if a player exists in the list
public static Exists ( string name ) : bool
name string the players name
리턴 bool

Find() 공개 정적인 메소드

Finds a player in the list
public static Find ( string name ) : Player
name string The name of the player
리턴 Player

GZip() 공개 정적인 메소드

Zips an array of bytes using gzip
public static GZip ( byte bytes ) : byte[]
bytes byte The bytes to zip
리턴 byte[]

GetColor() 공개 정적인 메소드

Gets the color for a given player
public static GetColor ( string name ) : string
name string The player to get the color for
리턴 string

GetGroup() 공개 정적인 메소드

Get the group of a given player
public static GetGroup ( string name ) : Group
name string The players name
리턴 Group

GetPlayers() 공개 정적인 메소드

Returns the list of players.
public static GetPlayers ( ) : List
리턴 List

GetRank() 공개 정적인 메소드

Gets a players rank
public static GetRank ( string name ) : GroupEnum
name string The player name to get the rank for
리턴 GroupEnum

HandleBlockchange() 공개 메소드

Handles a player blockchange packet
public HandleBlockchange ( byte message ) : void
message byte The blockchange packet
리턴 void

HandleLogin() 공개 메소드

Handles a player login packet
public HandleLogin ( byte message ) : void
message byte The login packet
리턴 void

IsOnline() 공개 정적인 메소드

Determines if the user is online
public static IsOnline ( string name ) : bool
name string The player's name
리턴 bool

Kick() 공개 메소드

Kicks the player with a given message
public Kick ( string message ) : void
message string The reason the player was kicked
리턴 void

Player() 공개 메소드

The main constructor for the player.
public Player ( Socket s ) : System
s Socket The incoming socket connection for the player to bind to
리턴 System

SMPKick() 공개 메소드

A kick function that works for the new SMP clients. That way they have a friendly way of being removed from the server instead of "Invalid packet id 2"
public SMPKick ( string message ) : void
message string The message to kick a SMP player with
리턴 void

SendBlockchange() 공개 메소드

public SendBlockchange ( ushort x, ushort y, ushort z, byte type ) : void
x ushort
y ushort
z ushort
type byte
리턴 void

SendChat() 공개 메소드

public SendChat ( Player p, string message ) : void
p Player
message string
리턴 void

SendDie() 공개 메소드

public SendDie ( byte id ) : void
id byte
리턴 void

SendKick() 공개 메소드

public SendKick ( string message ) : void
message string
리턴 void

SendMap() 공개 메소드

public SendMap ( ) : void
리턴 void

SendMessage() 공개 메소드

public SendMessage ( byte id, string message ) : void
id byte
message string
리턴 void

SendMessage() 공개 메소드

public SendMessage ( string message ) : void
message string
리턴 void

SendMotd() 공개 메소드

public SendMotd ( ) : void
리턴 void

SendPing() 공개 메소드

public SendPing ( ) : void
리턴 void

SendPos() 공개 메소드

public SendPos ( byte id, ushort x, ushort y, ushort z, byte rotx, byte roty ) : void
id byte
x ushort
y ushort
z ushort
rotx byte
roty byte
리턴 void

SendRaw() 공개 메소드

public SendRaw ( byte send ) : void
send byte
리턴 void

SendRaw() 공개 메소드

public SendRaw ( int id ) : void
id int
리턴 void

SendRaw() 공개 메소드

public SendRaw ( int id, byte send ) : void
id int
send byte
리턴 void

SendSpawn() 공개 메소드

public SendSpawn ( byte id, string name, ushort x, ushort y, ushort z, byte rotx, byte roty ) : void
id byte
name string
x ushort
y ushort
z ushort
rotx byte
roty byte
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

UpdatePosition() 공개 메소드

public UpdatePosition ( ) : void
리턴 void

ValidName() 공개 정적인 메소드

Checks to see if a players name is valid
public static ValidName ( string name ) : bool
name string
리턴 bool

initNetworking() 공개 메소드

Initializes the players networking and handles the incoming socket connection.
public initNetworking ( Socket s ) : void
s Socket The incoming socket connection
리턴 void

loginTimerCallback() 공개 메소드

Handles the login timer callback once it finishes. If the player has not been authenticated then we kick them.
public loginTimerCallback ( Object sender, ElapsedEventArgs e ) : void
sender Object
e ElapsedEventArgs
리턴 void

프로퍼티 상세

Loading 공개적으로 프로퍼티

public bool Loading
리턴 bool

bindings 공개적으로 프로퍼티

public byte[] bindings
리턴 byte[]

connections 공개적으로 정적으로 프로퍼티

public static List connections
리턴 List

disconnected 공개적으로 프로퍼티

public bool disconnected
리턴 bool

group 공개적으로 프로퍼티

public Group group
리턴 Group

hidden 공개적으로 프로퍼티

public bool hidden
리턴 bool

id 공개적으로 프로퍼티

public byte id
리턴 byte

ip 공개적으로 프로퍼티

public string ip
리턴 string

isJailed 공개적으로 프로퍼티

public bool isJailed
리턴 bool

isJoker 공개적으로 프로퍼티

public bool isJoker
리턴 bool

isMuted 공개적으로 프로퍼티

public bool isMuted
리턴 bool

lastSeen 공개적으로 정적으로 프로퍼티

This keeps track of when a player was last seen. Resets when the server is reset.
public static Dictionary lastSeen
리턴 DateTime>.Dictionary

left 공개적으로 정적으로 프로퍼티

This needs a better description. What does left do?
public static Dictionary left
리턴 string>.Dictionary

name 공개적으로 프로퍼티

public string name
리턴 string

players 공개적으로 정적으로 프로퍼티

public static ThreadedBindingList players
리턴 ThreadedBindingList