示例#1
0
        void FixedUpdate()
        {
            if (!Init)
            {
                if (masterServer.isConnected)
                {
                    Init                = true;
                    moduleManager       = masterServer.GetComponent <ModuleManager>();
                    authModule          = moduleManager.GetModule <ServerAuthentication>();
                    chatModule          = moduleManager.GetModule <ChatServer>();
                    masterSpawnerModule = moduleManager.GetModule <MasterSpawner>();
                    gameModule          = moduleManager.GetModule <ServerGameManager>();
                    matchModule         = moduleManager.GetModule <ServerMatchMaking>();
                }
                return;
            }

            spawnerCountText.text        = masterSpawnerModule.registeredSpawners.Count.ToString();
            gameCountText.text           = gameModule.registeredGameServers.Count.ToString();
            userCountText.text           = authModule.registeredUsers.Count.ToString();
            playersInQueueCountText.text = matchModule.playerQueue.Count.ToString();

            //Clear previous values
            activeGamesText.text = "";

            //Game Status
            foreach (GameContainer game in gameModule.registeredGameServers)
            {
                activeGamesText.text += game.UniqueId + " - " + game.NetworkAddress + ":" + game.NetworkPort + " - " + game.SceneName + " - " + game.CurrentPlayers + "/" + game.MaxPlayers + Environment.NewLine;
            }
        }
示例#2
0
    public override void Initialize(InsightServer insight, ModuleManager manager)
    {
        server        = insight;
        masterSpawner = manager.GetModule <MasterSpawner>();
        RegisterHandlers();

        server.transport.OnServerDisconnected.AddListener(HandleDisconnect);
    }
    public override void OnInspectorGUI()
    {
        MasterSpawner spawner = (MasterSpawner)target;

        DrawDefaultInspector();

        GUILayout.TextArea("Only press during play mode!!!");

        if (GUILayout.Button("Spawn Vorpal"))
        {
            spawner.ManualSpawn(new List <int> ()
            {
                spawner.testNumberToSpawn
            });
        }
        if (GUILayout.Button("Spawn Shell"))
        {
            spawner.ManualSpawn(new List <int> ()
            {
                0, spawner.testNumberToSpawn
            });
        }
        if (GUILayout.Button("Spawn Lurker"))
        {
            spawner.ManualSpawn(new List <int> ()
            {
                0, 0, spawner.testNumberToSpawn
            });
        }
        if (GUILayout.Button("Spawn Wraith"))
        {
            spawner.ManualSpawn(new List <int> ()
            {
                0, 0, 0, spawner.testNumberToSpawn
            });
        }
        if (GUILayout.Button("Spawn Fracture"))
        {
            spawner.ManualSpawn(new List <int> ()
            {
                0, 0, 0, 0, spawner.testNumberToSpawn
            });
        }
    }
示例#4
0
    private void Update()
    {
        if (!Init)
        {
            if (masterServer.isConnected)
            {
                Init                = true;
                moduleManager       = masterServer.GetComponent <ModuleManager>();
                authModule          = moduleManager.GetModule <ServerAuthentication>();
                chatModule          = moduleManager.GetModule <ChatServer>();
                masterSpawnerModule = moduleManager.GetModule <MasterSpawner>();
                gameModule          = moduleManager.GetModule <ServerGameManager>();
                matchModule         = moduleManager.GetModule <ServerMatchMaking>();
            }
            return;
        }

        spawnerCountText.text        = masterSpawnerModule.registeredSpawners.Count.ToString();
        gameCountText.text           = gameModule.registeredGameServers.Count.ToString();
        userCountText.text           = authModule.registeredUsers.Count.ToString();
        playersInQueueCountText.text = matchModule.playerQueue.Count.ToString();
        activeMatchesCountText.text  = matchModule.matchList.Count.ToString();
    }
示例#5
0
 void Start()
 {
     msObject      = GameObject.Find("SpawnMaster");
     masterSpawner = msObject.GetComponent <MasterSpawner>();
 }
示例#6
0
	void InstantiateIA(MasterSpawner.IAPacket toSpawn) {
		_audio.PlayOneShot (onCreate);
		GameObject obj = Instantiate (toSpawn.IA, this.transform.position, this.transform.rotation) as GameObject;
		//obj.GetComponent<IA>().SetName(toSpawn.Name);
	}