C# Class SharpMod.Message

A wrapper class for sending messages with the goldsrc engine
Datei anzeigen Open project: txdv/sharpmod

Public Methods

Method Description
Begin ( MessageDestination destination, int messageType, IntPtr floatValue, IntPtr playerEntity ) : void

Begins with the sending of a message.

End ( ) : void

Signals the engine that the message is *constructed* and that it can be send.

GetUserMessageID ( string name ) : int

Calls the Engine to retrieve the User Message ID

GetUserMessageName ( int id ) : string
Intercept ( int id, Delegate del ) : bool
Intercept ( string name, Delegate del ) : bool
Register ( string name, int size ) : int
Write ( Entity entity ) : void
Write ( byte val ) : void

Writes a byte value. If the message buffer is already full, writing will be omitted.

Write ( char val ) : void

Writes a character into the message If the message buffer is already full, writing will be omitted.

Write ( long val ) : void

Writes a long in the message.

Write ( short val ) : void

Writes a short into the message. If the message buffer is already full, writing will be omitted.

Write ( string val ) : void

Writes a string value into the buffer. If the string is too long and would result in a message overflow, it will be truncated.

WriteAngle ( int val ) : void

Writes an angle in the message.

WriteByte ( byte val ) : void

Writes a byte value. If the message buffer is already full, writing will be omitted.

WriteChar ( char val ) : void

Writes a character into the message If the message buffer is already full, writing will be omitted.

WriteCoord ( Vector3f val ) : void
WriteEntity ( Entity entity ) : void
WriteEntity ( int entity ) : void
WriteLong ( int val ) : void
WriteLong ( long val ) : void

Writes a long in the message.

WriteShort ( short val ) : void

Writes a short into the message. If the message buffer is already full, writing will be omitted.

WriteString ( string val ) : void

Writes a string value into the buffer. If the string is too long and would result in a message overflow, it will be truncated.

Private Methods

Method Description
Init ( ) : void
Invoke ( Delegate del, MessageHeader message_header, List parameters ) : void
Invoke ( List list, MessageHeader message_header, List parameters ) : void
Invoke ( MessageHeader message_header, List parameters ) : void
WriteCoord ( float val ) : void

Method Details

Begin() public static method

Begins with the sending of a message.
public static Begin ( MessageDestination destination, int messageType, IntPtr floatValue, IntPtr playerEntity ) : void
destination MessageDestination /// The destination of a message. ///
messageType int
floatValue System.IntPtr
playerEntity System.IntPtr
return void

End() public static method

Signals the engine that the message is *constructed* and that it can be send.
public static End ( ) : void
return void

GetUserMessageID() public static method

Calls the Engine to retrieve the User Message ID
public static GetUserMessageID ( string name ) : int
name string /// The name of the message ///
return int

GetUserMessageName() public static method

public static GetUserMessageName ( int id ) : string
id int
return string

Intercept() public static method

public static Intercept ( int id, Delegate del ) : bool
id int
del System.Delegate
return bool

Intercept() public static method

public static Intercept ( string name, Delegate del ) : bool
name string
del System.Delegate
return bool

Register() public static method

public static Register ( string name, int size ) : int
name string
size int
return int

Write() public static method

public static Write ( Entity entity ) : void
entity Entity
return void

Write() public static method

Writes a byte value. If the message buffer is already full, writing will be omitted.
public static Write ( byte val ) : void
val byte /// A byte value. ///
return void

Write() public static method

Writes a character into the message If the message buffer is already full, writing will be omitted.
public static Write ( char val ) : void
val char /// A character value ///
return void

Write() public static method

Writes a long in the message.
public static Write ( long val ) : void
val long /// A long value /// If the message buffer is already full, writing will be omitted. ///
return void

Write() public static method

Writes a short into the message. If the message buffer is already full, writing will be omitted.
public static Write ( short val ) : void
val short /// A character value ///
return void

Write() public static method

Writes a string value into the buffer. If the string is too long and would result in a message overflow, it will be truncated.
public static Write ( string val ) : void
val string /// A ///
return void

WriteAngle() public static method

Writes an angle in the message.
public static WriteAngle ( int val ) : void
val int /// An angle value /// If the message buffer is already full, writing will be omitted. ///
return void

WriteByte() public static method

Writes a byte value. If the message buffer is already full, writing will be omitted.
public static WriteByte ( byte val ) : void
val byte /// A byte value. ///
return void

WriteChar() public static method

Writes a character into the message If the message buffer is already full, writing will be omitted.
public static WriteChar ( char val ) : void
val char /// A character value ///
return void

WriteCoord() public static method

public static WriteCoord ( Vector3f val ) : void
val SharpMod.Math.Vector3f
return void

WriteEntity() public static method

public static WriteEntity ( Entity entity ) : void
entity Entity
return void

WriteEntity() public static method

public static WriteEntity ( int entity ) : void
entity int
return void

WriteLong() public static method

public static WriteLong ( int val ) : void
val int
return void

WriteLong() public static method

Writes a long in the message.
public static WriteLong ( long val ) : void
val long /// A long value /// If the message buffer is already full, writing will be omitted. ///
return void

WriteShort() public static method

Writes a short into the message. If the message buffer is already full, writing will be omitted.
public static WriteShort ( short val ) : void
val short /// A character value ///
return void

WriteString() public static method

Writes a string value into the buffer. If the string is too long and would result in a message overflow, it will be truncated.
public static WriteString ( string val ) : void
val string /// A ///
return void