C# Класс BF2Statistics.Gamespy.MasterServer

Master.Gamespy.com Server. Alot of code was borrowed and re-written from the Open Source PRMasterServer located here: https://github.com/AncientMan2002/PRMasterServer
Наследование: GamespyUdpSocket
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Servers GameServer>.ConcurrentDictionary

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

Метод Описание
MasterServer ( int &Port, LogWriter DebugLog ) : System
Shutdown ( ) : void

Shutsdown the Master server and socket

Защищенные методы

Метод Описание
ProcessAccept ( GamespyUdpPacket Packet ) : void

Callback method for when the UDP Master socket recieves a connection

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

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

Executed every 5 seconds or so... Removes all servers that haven't reported in awhile, assuming they are offline

ParseServerDetails ( IPEndPoint remote, byte data ) : bool

Executed every 60 seconds per server (Every 3rd ping), the BF2 server sends a full list of data that describes its current state, and this method is used to parse that data, and update the server in the Servers list

ValidateServer ( IPEndPoint remote ) : bool

When a server sends data initially, it needs to be validated with a validation code. Once that has happened, this method is called, and it allows the server to be seen in the Serverlist. This method also corrects local IP addresses by converting them to External IP addresses, so that external clients get a good IP to connect to.

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

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

public MasterServer ( int &Port, LogWriter DebugLog ) : System
Port int
DebugLog BF2Statistics.Logging.LogWriter
Результат System

ProcessAccept() защищенный Метод

Callback method for when the UDP Master socket recieves a connection
protected ProcessAccept ( GamespyUdpPacket Packet ) : void
Packet BF2Statistics.Gamespy.Net.GamespyUdpPacket
Результат void

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

Shutsdown the Master server and socket
public Shutdown ( ) : void
Результат void

Описание свойств

Servers публичное статическое свойство

A List of all servers that have sent data to this master server, and are active in the last 30 seconds or so
public static ConcurrentDictionary Servers
Результат GameServer>.ConcurrentDictionary