C# 클래스 BeardedManStudios.Network.ForgeMasterServer

상속: UnityEngine.MonoBehaviour
파일 보기 프로젝트 열기: drakelinglabs/unityarmada

공개 프로퍼티들

프로퍼티 타입 설명
natComplete bool

공개 메소드들

메소드 설명
GetHosts ( string host, ushort pageNumber, Action callback ) : void

This method requests all of the hosts from the master server

PullNatRequest ( string ip, ushort port, ushort internalPort, string requestHost, ushort requestPort ) : void

This method is used on the server to attempt to connect through the NAT hole punch server to the client

RegisterNat ( CrossPlatformUDP socket, ushort port, string proxyHost, ushort proxyPort = PORT ) : void

This method is used to allow a server to register itself with the NAT hole punching server

RegisterNatRequest ( string ip, ushort port, ushort internalPort ) : void
RegisterServer ( string host, ushort port, int maxPlayers, string name, string gameType = "", string comment = "", string password = "", string sceneName = "" ) : void

This method is used to register a server to the master server to be retreived by clients

RequestNat ( CrossPlatformUDP socket, ushort port, string requestHost, ushort requestPort, string proxyHost, ushort proxyPort = PORT ) : bool

This method is used on the client to attempt to connect to the server through the NAT hole punch server

SetIp ( string ip ) : void
UnRegisterServer ( string host, ushort port ) : void

This method is used to manually unregister a server. If a server aborts the master server will automatically remove it

UpdateServer ( string host, ushort port, int playerCount ) : void

This method is used to update the current player count on the master server for this server

비공개 메소드들

메소드 설명
Awake ( ) : void
GetHostsRequestToClient ( NetworkingPlayer sender, NetworkingStream stream ) : void
GetHostsRequestToServer ( NetworkingPlayer sender, NetworkingStream stream ) : void
OnApplicationQuit ( ) : void
PingHosts ( ) : void
PingRecieved ( string ip ) : void
RegisterServerRequest ( NetworkingPlayer sender, NetworkingStream stream ) : void
Request ( string host, Action call ) : void
Start ( ) : void
StartServer ( ) : void

This method is called when the host server button is clicked

UnRegisterServerRequest ( NetworkingPlayer sender, NetworkingStream stream ) : void
UpdateServerRequest ( NetworkingPlayer sender, NetworkingStream stream ) : void

메소드 상세

GetHosts() 공개 정적인 메소드

This method requests all of the hosts from the master server
public static GetHosts ( string host, ushort pageNumber, Action callback ) : void
host string The host of the master server
pageNumber ushort This is the page number (starting from 0). So if you want to get entries 0-n then you will pass 0, if you want n-n+n then pass 1
callback Action This is the method that will be called once the master server responds with the host list
리턴 void

PullNatRequest() 공개 메소드

This method is used on the server to attempt to connect through the NAT hole punch server to the client
public PullNatRequest ( string ip, ushort port, ushort internalPort, string requestHost, ushort requestPort ) : void
ip string This is the ip address of the NAT hole punch server
port ushort This is the port number of the NAT hole punch server
internalPort ushort This is the internal port of the client that this server is trying to communicate with
requestHost string This is the client host address that this server is trying to communicate with
requestPort ushort This is the client port number that this server is trying to communicate with
리턴 void

RegisterNat() 공개 정적인 메소드

This method is used to allow a server to register itself with the NAT hole punching server
public static RegisterNat ( CrossPlatformUDP socket, ushort port, string proxyHost, ushort proxyPort = PORT ) : void
socket CrossPlatformUDP This is the socket that is being used for the communication with the clients
port ushort The port number that is being used for this server
proxyHost string The ip address of the the NAT hole punching (router) server
proxyPort ushort The port number for the NAT hole punch server
리턴 void

RegisterNatRequest() 공개 메소드

public RegisterNatRequest ( string ip, ushort port, ushort internalPort ) : void
ip string
port ushort
internalPort ushort
리턴 void

RegisterServer() 공개 정적인 메소드

This method is used to register a server to the master server to be retreived by clients
public static RegisterServer ( string host, ushort port, int maxPlayers, string name, string gameType = "", string comment = "", string password = "", string sceneName = "" ) : void
host string The master server host address
port ushort The port that this server will be running on
maxPlayers int The maximum amount of players allowed on this server
name string The name for this server
gameType string The type of game for this server (ie. deathmatch, capture the flag, etc.)
comment string The comment for this server (usually user populated for loading screens)
password string The password for this server
sceneName string The scene name that this server is currently on
리턴 void

RequestNat() 공개 정적인 메소드

This method is used on the client to attempt to connect to the server through the NAT hole punch server
public static RequestNat ( CrossPlatformUDP socket, ushort port, string requestHost, ushort requestPort, string proxyHost, ushort proxyPort = PORT ) : bool
socket CrossPlatformUDP This is the socket that is being used for the communication with the server
port ushort This is the port number that this client is bound to
requestHost string This is the host address of the server that this client is trying to connect to
requestPort ushort This is the host port of the server that this client is trying to connect to
proxyHost string This is the NAT hole punch server host address
proxyPort ushort This is the NAT hole punch server port number
리턴 bool

SetIp() 공개 정적인 메소드

public static SetIp ( string ip ) : void
ip string
리턴 void

UnRegisterServer() 공개 정적인 메소드

This method is used to manually unregister a server. If a server aborts the master server will automatically remove it
public static UnRegisterServer ( string host, ushort port ) : void
host string The host of the master server
port ushort The port that this server was running on
리턴 void

UpdateServer() 공개 정적인 메소드

This method is used to update the current player count on the master server for this server
public static UpdateServer ( string host, ushort port, int playerCount ) : void
host string The host of the master server
port ushort The port number that this server is running on
playerCount int The current player count for this server
리턴 void

프로퍼티 상세

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

public static bool natComplete
리턴 bool