C# Класс Descent.Messaging.Events.EventManager

Takes strings received from the network and fires the appropriate events. Can also convert an event to a text string and send it.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FirePlayersInGameEvent ( ) : void
ProcessEventQueue ( ) : void

Process the event queue. Will fire all events in the queue and clear it.

QueueEvent ( EventType eventType, GameEventArgs eventArgs, bool broadcast = true ) : void

Queue an event.

QueueStringEvent ( string eventString, bool broadcast = true ) : void

Take an event string and puts it on the event queue.

Приватные методы

Метод Описание
AddRequiredEventArgs ( EventType eventType, GameEventArgs eventArgs ) : void

Populate a GameEventArgs object with required fields.

AddResponse ( ) : void

TODO: This method is not curently used. Should be used for methods requiring responses - like MoveTo and attacks in the future.

BuildEventArgs ( EventType eventType, string args ) : GameEventArgs

Builds the correct type of GameEventArgs object based on the event type.

EncodeMessage ( EventType eventType, GameEventArgs eventArgs ) : string

Encode a message to a string.

Fire ( EventType eventType, GameEventArgs eventArgs, bool sendOnNetwork ) : void

Fires an event.

GenerateEventId ( ) : string

Generates a unique event id. It's based on the current time, the player ip and the player id.

MD5String ( string input ) : string

Generate a MD5 hash from a given string.

NeedResponse ( EventType eventType ) : bool

Does this kind of EventType need a response?

ParseAndFire ( string eventString, bool sendOnNetwork ) : void

Parse an event string and fire the event.

Описание методов

FirePlayersInGameEvent() публичный Метод

public FirePlayersInGameEvent ( ) : void
Результат void

ProcessEventQueue() публичный Метод

Process the event queue. Will fire all events in the queue and clear it.
public ProcessEventQueue ( ) : void
Результат void

QueueEvent() публичный Метод

Queue an event.
public QueueEvent ( EventType eventType, GameEventArgs eventArgs, bool broadcast = true ) : void
eventType EventType The type of event to queue.
eventArgs GameEventArgs The event arguments.
broadcast bool
Результат void

QueueStringEvent() публичный Метод

Take an event string and puts it on the event queue.
public QueueStringEvent ( string eventString, bool broadcast = true ) : void
eventString string Event string to queue.
broadcast bool
Результат void