本文整理汇总了C#中MasterServerEvent类的典型用法代码示例。如果您正苦于以下问题:C# MasterServerEvent类的具体用法?C# MasterServerEvent怎么用?C# MasterServerEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MasterServerEvent类属于命名空间,在下文中一共展示了MasterServerEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
if (msEvent == MasterServerEvent.HostListReceived)
{
//hostList = MasterServer.PollHostList();
}
}
示例2: OnMasterServerEvent
public override void OnMasterServerEvent(MasterServerEvent masterServerEvent)
{
base.OnMasterServerEvent(masterServerEvent);
if (masterServerEvent == MasterServerEvent.HostListReceived) {
hostListReceived();
}
}
示例3: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
Debug.Log("Entr a change OnMasterServerEvent");
if (msEvent == MasterServerEvent.HostListReceived) {
hostList = MasterServer.PollHostList ();
}
}
示例4: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent mse)
{
if(mse == MasterServerEvent.RegistrationSucceeded)
{
Debug.Log("Registered Server!");
}
}
示例5: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent mse)
{
if (mse == MasterServerEvent.RegistrationSucceeded)
{
print("registered server");
}
}
示例6: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
bool trying_client = false;
if (msEvent == MasterServerEvent.HostListReceived)
{
Debug.Log("Master Server List Received");
hostList.Clear();
hostList.AddRange(MasterServer.PollHostList());
foreach (HostData hd in hostList)
{
if (hd.connectedPlayers < hd.playerLimit)
{
Debug.Log("Connecting to Server...");
Network.Connect(hd);
trying_client = true;
}
}
if (Network.peerType == NetworkPeerType.Disconnected && !trying_client)
{
Debug.Log("Initializing Server");
Network.InitializeServer(numberOfPlayers, connectionPort, !Network.HavePublicAddress());
MasterServer.RegisterHost(typeName, gameName);
}
}
}
示例7: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent e)
{
if (e == MasterServerEvent.RegistrationSucceeded)
Debug.Log("RegistrationSucceeded");
else if (e == MasterServerEvent.HostListReceived)
hostDatas = MasterServer.PollHostList();
}
示例8: ServerCreationEvent
public ServerCreationEvent(MasterServerEvent mse)
{
if(mse == MasterServerEvent.RegistrationSucceeded)
this.eventCode = ServerCreationEventCode.RegistrationSucceeded;
else if(mse == MasterServerEvent.RegistrationFailedGameName || mse == MasterServerEvent.RegistrationFailedGameType || mse == MasterServerEvent.RegistrationFailedNoServer)
this.eventCode = ServerCreationEventCode.MSRegistrationFailed;
}
示例9: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent e)
{
if (e == MasterServerEvent.HostListReceived)
{
hosts = MasterServer.PollHostList();
}
}
示例10: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
if (msEvent == MasterServerEvent.HostListReceived) {
hostList = MasterServer.PollHostList ();
}
else if (msEvent == MasterServerEvent.RegistrationSucceeded)
Debug.Log ("server registered");
}
示例11: OnMasterServerEvent
// Appelée quand un événement serveur a lieux.
void OnMasterServerEvent(MasterServerEvent sEvent)
{
if (sEvent == MasterServerEvent.HostListReceived)
{
Debug.Log ("Liste des parties mise à jour");
_hostData = MasterServer.PollHostList();
}
}
示例12: OnMasterServerEvent
public void OnMasterServerEvent(MasterServerEvent msEvent)
{
if (msEvent == MasterServerEvent.HostListReceived)
{
ServerHostList = MasterServer.PollHostList();
if (ServerHostList.Length > 0)
UpdateServerList();
}
}
示例13: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
if (msEvent == MasterServerEvent.HostListReceived)
{
Debug.Log("Host list received");
hostList = MasterServer.PollHostList();
Debug.Log(hostList.Length);
}
}
示例14: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
if(msEvent == MasterServerEvent.RegistrationSucceeded)
Debug.Log("Server Registered");
if(msEvent == MasterServerEvent.HostListReceived)
Debug.Log("Hosts Refreshed");
hostsUpdated = true;
}
示例15: OnMasterServerEvent
void OnMasterServerEvent(MasterServerEvent msEvent)
{
if(msEvent == MasterServerEvent.RegistrationFailedGameName)
GameManager.WriteMessage("Server Registration Failed: No game name given");
if(msEvent == MasterServerEvent.RegistrationFailedGameType)
GameManager.WriteMessage("Server Registration Failed: No game tpye given");
if(msEvent == MasterServerEvent.RegistrationFailedNoServer)
GameManager.WriteMessage("Server Registration Failed: Server not running");
if(msEvent == MasterServerEvent.RegistrationSucceeded)
GameManager.WriteMessage("Server Registraion Suceeded");
}