![]() |
Dawn of Light - Class documentation 2900
This is the Dawn of Light project
|
Class encapsulates all game server functionality. More...
Public Member Functions | |
| void | LoadInvalidNames () |
| Loads an array of invalid names. | |
| void | SendUDP (byte[] bytes, int count, EndPoint clientEndpoint) |
| Sends a UDP packet. | |
| void | SendUDP (byte[] bytes, int count, EndPoint clientEndpoint, AsyncCallback callback) |
| Sends a UDP packet. | |
| override bool | Start () |
| Starts the server. | |
| bool | RecompileScripts () |
| Recomiples the scripts dll. | |
| void | Close () |
| void | Open () |
| override void | Stop () |
| Stops the server, disconnects all clients, and writes the database to disk. | |
| override byte[] | AcquirePacketBuffer () |
| Gets packet buffer from the pool. | |
| override void | ReleasePacketBuffer (byte[] buf) |
| Releases previously acquired packet buffer. | |
| void | LogGMAction (string text) |
| Writes a line to the gm log file. | |
| void | LogCheatAction (string text) |
| Writes a line to the cheat log file. | |
| bool | InitDB () |
| Initializes the database. | |
Static Public Member Functions | |
| static void | CreateInstance (GameServerConfiguration config) |
| Creates the gameserver instance. | |
Protected Member Functions | |
| bool | StartUDP () |
| Starts the udp listening. | |
| void | RecvFromCallback (IAsyncResult ar) |
| UDP event handler. Called when a UDP packet is waiting to be read. | |
| void | SendToCallback (IAsyncResult ar) |
| Callback function for UDP sends. | |
| bool | StartScriptComponents () |
| Initialize all script components. | |
| virtual bool | UpdateDatabase () |
| Do any required updates to the database. | |
| bool | InitComponent (bool componentInitState, string text) |
| Prints out some text info on component initialisation and stops the server again if the component failed. | |
| override BaseClient | GetNewClient () |
| Creates a new client. | |
| void | SaveTimerProc (object sender) |
| Function called at X interval to write the database to disk. | |
| GameServer () | |
| Default game server constructor. | |
| GameServer (GameServerConfiguration config) | |
| Constructor with a given configuration. | |
Protected Attributes | |
| const int | MAX_UDPBUF = 4096 |
| Maximum UDP buffer size. | |
| const int | MINUTE_CONV = 60000 |
| Minute conversion from milliseconds. | |
| ILog | m_cheatLog |
| The textwrite for log operations. | |
| IObjectDatabase | m_database |
| Database instance. | |
| ILog | m_gmLog |
| The textwrite for log operations. | |
| ArrayList | m_invalidNames = new ArrayList() |
| Contains a list of invalid names. | |
| IServerRules | m_serverRules |
| Holds instance of current server rules. | |
| int | m_startTick |
| Holds the startSystemTick when server is up. | |
| eGameServerStatus | m_status |
| Game server status variable. | |
| Timer | m_timer |
| World save timer. | |
| byte[] | m_udpBuf |
| Receive buffer for UDP. | |
| Socket | m_udpListen |
| Socket that listens for UDP packets. | |
| Socket | m_udpOutSocket |
| Socket that sends UDP packets. | |
| readonly AsyncCallback | m_udpReceiveCallback |
| Holds udp receive callback delegate. | |
| readonly AsyncCallback | m_udpSendCallback |
| Holds the async UDP send callback. | |
Static Protected Attributes | |
| static GameServer | m_instance |
| The instance! | |
Properties | |
| ILog | Logger [get] |
| A general logger for the server. | |
| static GameServer | Instance [get] |
| Returns the instance. | |
| virtual new GameServerConfiguration | Configuration [get] |
| Retrieves the server configuration. | |
| eGameServerStatus | ServerStatus [get] |
| Gets the server status. | |
| static IServerRules | ServerRules [get] |
| Gets the current rules used by server. | |
| static IObjectDatabase | Database [get] |
| Gets the database instance. | |
| int | SaveInterval [get, set] |
| Gets or sets the world save interval. | |
| ArrayList | InvalidNames [get] |
| Gets an array of invalid player names. | |
| bool | IsRunning [get] |
| True if the server is listening. | |
| int | TickCount [get] |
| Gets the number of millisecounds elapsed since the GameServer started. | |
| Socket | UDPSocket [get] |
| Gets the UDP Socket of this server instance. | |
| byte[] | UDPBuffer [get] |
| Gets the UDP buffer of this server instance. | |
| int | PacketPoolSize [get] |
| Gets the count of packet buffers in the pool. | |
Class encapsulates all game server functionality.
| DOL.GS.GameServer.GameServer | ( | ) | [protected] |
Default game server constructor.
| DOL.GS.GameServer.GameServer | ( | GameServerConfiguration | config | ) | [protected] |
Constructor with a given configuration.
| config | A valid game server configuration |
| override byte [] DOL.GS.GameServer.AcquirePacketBuffer | ( | ) |
Gets packet buffer from the pool.
| static void DOL.GS.GameServer.CreateInstance | ( | GameServerConfiguration | config | ) | [static] |
Creates the gameserver instance.
| config |
| override BaseClient DOL.GS.GameServer.GetNewClient | ( | ) | [protected] |
Creates a new client.
| bool DOL.GS.GameServer.InitComponent | ( | bool | componentInitState, |
| string | text | ||
| ) | [protected] |
Prints out some text info on component initialisation and stops the server again if the component failed.
| componentInitState | The state |
| text | The text to print |
| bool DOL.GS.GameServer.InitDB | ( | ) |
Initializes the database.
| void DOL.GS.GameServer.LoadInvalidNames | ( | ) |
Loads an array of invalid names.
| void DOL.GS.GameServer.LogCheatAction | ( | string | text | ) |
Writes a line to the cheat log file.
| text | the text to log |
| void DOL.GS.GameServer.LogGMAction | ( | string | text | ) |
Writes a line to the gm log file.
| text | the text to log |
| bool DOL.GS.GameServer.RecompileScripts | ( | ) |
Recomiples the scripts dll.
| void DOL.GS.GameServer.RecvFromCallback | ( | IAsyncResult | ar | ) | [protected] |
UDP event handler. Called when a UDP packet is waiting to be read.
| ar |
| override void DOL.GS.GameServer.ReleasePacketBuffer | ( | byte[] | buf | ) |
Releases previously acquired packet buffer.
| buf | The released buf |
| void DOL.GS.GameServer.SaveTimerProc | ( | object | sender | ) | [protected] |
Function called at X interval to write the database to disk.
| sender | Object that generated the event |
| void DOL.GS.GameServer.SendToCallback | ( | IAsyncResult | ar | ) | [protected] |
Callback function for UDP sends.
| ar | Asynchronous result of this operation |
| void DOL.GS.GameServer.SendUDP | ( | byte[] | bytes, |
| int | count, | ||
| EndPoint | clientEndpoint | ||
| ) |
Sends a UDP packet.
| bytes | Packet to be sent |
| count | The count of bytes to send |
| clientEndpoint | Address of receiving client |
| void DOL.GS.GameServer.SendUDP | ( | byte[] | bytes, |
| int | count, | ||
| EndPoint | clientEndpoint, | ||
| AsyncCallback | callback | ||
| ) |
Sends a UDP packet.
| bytes | Packet to be sent |
| count | The count of bytes to send |
| clientEndpoint | Address of receiving client |
| callback |
| override bool DOL.GS.GameServer.Start | ( | ) |
Starts the server.
| bool DOL.GS.GameServer.StartScriptComponents | ( | ) | [protected] |
Initialize all script components.
| bool DOL.GS.GameServer.StartUDP | ( | ) | [protected] |
Starts the udp listening.
| override void DOL.GS.GameServer.Stop | ( | ) |
Stops the server, disconnects all clients, and writes the database to disk.
| virtual bool DOL.GS.GameServer.UpdateDatabase | ( | ) | [protected, virtual] |
Do any required updates to the database.
ILog DOL.GS.GameServer.m_cheatLog [protected] |
The textwrite for log operations.
IObjectDatabase DOL.GS.GameServer.m_database [protected] |
Database instance.
ILog DOL.GS.GameServer.m_gmLog [protected] |
The textwrite for log operations.
GameServer DOL.GS.GameServer.m_instance [static, protected] |
The instance!
ArrayList DOL.GS.GameServer.m_invalidNames = new ArrayList() [protected] |
Contains a list of invalid names.
IServerRules DOL.GS.GameServer.m_serverRules [protected] |
Holds instance of current server rules.
int DOL.GS.GameServer.m_startTick [protected] |
Holds the startSystemTick when server is up.
eGameServerStatus DOL.GS.GameServer.m_status [protected] |
Game server status variable.
Timer DOL.GS.GameServer.m_timer [protected] |
World save timer.
byte [] DOL.GS.GameServer.m_udpBuf [protected] |
Receive buffer for UDP.
Socket DOL.GS.GameServer.m_udpListen [protected] |
Socket that listens for UDP packets.
Socket DOL.GS.GameServer.m_udpOutSocket [protected] |
Socket that sends UDP packets.
readonly AsyncCallback DOL.GS.GameServer.m_udpReceiveCallback [protected] |
Holds udp receive callback delegate.
readonly AsyncCallback DOL.GS.GameServer.m_udpSendCallback [protected] |
Holds the async UDP send callback.
const int DOL.GS.GameServer.MAX_UDPBUF = 4096 [protected] |
Maximum UDP buffer size.
const int DOL.GS.GameServer.MINUTE_CONV = 60000 [protected] |
Minute conversion from milliseconds.
virtual new GameServerConfiguration DOL.GS.GameServer.Configuration [get] |
Retrieves the server configuration.
IObjectDatabase DOL.GS.GameServer.Database [static, get] |
Gets the database instance.
GameServer DOL.GS.GameServer.Instance [static, get] |
Returns the instance.
ArrayList DOL.GS.GameServer.InvalidNames [get] |
Gets an array of invalid player names.
bool DOL.GS.GameServer.IsRunning [get] |
True if the server is listening.
ILog DOL.GS.GameServer.Logger [get] |
A general logger for the server.
int DOL.GS.GameServer.PacketPoolSize [get] |
Gets the count of packet buffers in the pool.
int DOL.GS.GameServer.SaveInterval [get, set] |
Gets or sets the world save interval.
IServerRules DOL.GS.GameServer.ServerRules [static, get] |
Gets the current rules used by server.
eGameServerStatus DOL.GS.GameServer.ServerStatus [get] |
Gets the server status.
int DOL.GS.GameServer.TickCount [get] |
Gets the number of millisecounds elapsed since the GameServer started.
byte [] DOL.GS.GameServer.UDPBuffer [get, protected] |
Gets the UDP buffer of this server instance.
Socket DOL.GS.GameServer.UDPSocket [get, protected] |
Gets the UDP Socket of this server instance.