public AuthenticaitonProcessor(LobbyHost host, BanProcessor bans)
        {
            Host = host;
            Bans = bans;

            Start();
        }
Beispiel #2
0
        private void ButtonStartServer_Click(object sender, EventArgs e)
        {
            Player player = CreatePlayer();

            LobbyHost.LobbySettings settings = new LobbyHost.LobbySettings()
            {
                MapManager    = new MapManager(),
                Password      = TextPassword.Text,
                SerializedMap = "",
            };

            LobbyHost host = LobbyHost.CreateLobby(player, settings);

            _context = host.Context;
            TextConnectionInformation.Text = "Created lobby";
            TextLocalIP.Text = string.Join(", ", _context.GetServerIPs().Select(ip => ip.ToString()).ToArray());
            Task.Factory.StartNew(() => {
                while (true)
                {
                    host.Update();
                    Invoke(new Action(() => {
                        string players = string.Join(", ", host.GetLobbyMembers().Select(p => p.Name).ToArray());
                        TextConnectionInformation.Text = "Lobby Players=" + players;
                    }));
                }
            });
        }
Beispiel #3
0
    void Start()
    {
        lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();

        // Game에 참가한 Player만 점수판 표시
        for (int i = 0; i < playerTable.Length; i++)
        {
            if (i < lobbyHost.GetPlayerCount())
            {
                // 연결이 끊어진 Player는 표시 하지 않음
                if (lobbyHost.selectedPlayerCharacter[i] == (int)CHARACTER_TYPE.CHARACTER_DISCONNECTED)
                {
                    playerTable[i].SetActive(false);
                }
                else
                {
                    playerTable[i].SetActive(true);
                    playerName[i].GetComponent <UISprite>().spriteName = nameSpriteName[(int)lobbyHost.selectedPlayerCharacter[i]];
                }
            }
            else
            {
                playerTable[i].SetActive(false);
            }
        }

        CalculateRank();

        for (int i = 0; i < player1ItemScoreLabel.Length; i++)
        {
            player1ItemScoreLabel[i].text = "0";
        }
        for (int i = 0; i < player2ItemScoreLabel.Length; i++)
        {
            player2ItemScoreLabel[i].text = "0";
        }
        for (int i = 0; i < player3ItemScoreLabel.Length; i++)
        {
            player3ItemScoreLabel[i].text = "0";
        }
        for (int i = 0; i < player4ItemScoreLabel.Length; i++)
        {
            player4ItemScoreLabel[i].text = "0";
        }
        for (int i = 0; i < player5ItemScoreLabel.Length; i++)
        {
            player5ItemScoreLabel[i].text = "0";
        }
        for (int i = 0; i < player6ItemScoreLabel.Length; i++)
        {
            player6ItemScoreLabel[i].text = "0";
        }

        for (int i = 0; i < playerTotalScore.Length; i++)
        {
            playerTotalScore[i].GetComponent <UILabel>().text = "" + lobbyHost.totalScore[i];
        }
    }
    void Start()
    {
#if UNITY_ANDROID || UNITY_IOS
        Handheld.PlayFullScreenMovie("tutorial.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput);
#endif

        lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();
        lobbyHost.StartInGame();
    }
Beispiel #5
0
 private static void HostLobby(LobbyHost lobbyHost)
 {
     _hostingLobby  = true;
     _game          = lobbyHost.Game;
     _map           = lobbyHost.Map;
     _lobbyMembers  = new List <Player>();
     _playersToKick = new List <uint>();
     _logger.Info("Requesting lobby host - Game: " + _game.Name + " - Server ID: " + _game.ServerId);
     _lobbyCreated = DateTime.UtcNow;
     _dotaClient.CreateLobby(_game.ServerId, _game.GameMode, _map.MapId, _game.CustomGameMode, _game.CustomGameCrc, _game.CustomGameTimestamp, _map.MinPlayers, _map.MaxPlayers, _game.Teams);
 }
Beispiel #6
0
    void Start()
    {
#if UNITY_STANDALONE || UNITY_EDITOR
        lobbyHost.StartInGame();
        return;

        ((MovieTexture)GetComponent <Renderer>().material.mainTexture).Play();
        AudioSource tutorialMovieSound = this.GetComponent <AudioSource>();
        tutorialMovieSound.Play();
#endif
        StartCoroutine(StartGameLoading());

        lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();
    }
    void Start()
    {
        lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();

        for (int i = 0; i < playerNumber.Length; i++)
        {
            playerNumber[i].SetActive(false);
        }
        for (int i = 0; i < lobbyHost.GetPlayerCount(); i++)
        {
            playerNumber[i].SetActive(true);
        }

        for (int i = 0; i < lobbyHost.selectedPlayerCharacter.Length; i++)
        {
            lobbyHost.selectedPlayerCharacter[i] = (int)CHARACTER_TYPE.CHARACTER_NONE;
        }
    }
Beispiel #8
0
    void Start()
    {
        lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();

        characterType = lobbyHost.selectedPlayerCharacter[playerNumber];

        if (characterType == (int)CHARACTER_TYPE.CHARACTER_DISCONNECTED)
        {
            this.gameObject.SetActive(false);
            return;
        }

        if (characterType != (int)CHARACTER_TYPE.CHARACTER_NONE)
        {
            character[(int)characterType].SetActive(true);
        }

        previousAngle = (int)this.transform.eulerAngles.y;
    }
Beispiel #9
0
    public void StartTutorial()
    {
        if (isTutorialWatched == false)
        {
            isTutorialWatched = true;

            SendAll("StartTutorial");

#if UNITY_ANDROID && !UNITY_EDITOR
            Application.LoadLevel("TutorialBS_Android");
#else
            LobbyHost lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();
            lobbyHost.StartInGame();
            //Application.LoadLevel("TutorialBS_PC");
#endif
        }
        else
        {
            StartInGame();
        }
    }
    void Start()
    {
        lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();

        lobbyHost.SendAll("StartInGame");

        for (int i = 0; i < lobbyHost.totalScore.Length; i++)
        {
            lobbyHost.totalScore[i] = 0;
        }

        for (int i = 0; i < lobbyHost.itemScore.GetLength(0); i++)
        {
            for (int j = 0; j < lobbyHost.itemScore.GetLength(1); j++)
            {
                lobbyHost.itemScore[i, j] = 0;
            }
        }

        for (int i = 0; i < lobbyHost.GetPlayerCount(); i++)
        {
            if (lobbyHost.selectedPlayerCharacter[i] == (int)CHARACTER_TYPE.CHARACTER_DISCONNECTED)
            {
                continue;
            }

            scoreBoard[i].SetActive(true);
            scoreBoard[i].GetComponent <UISprite>().spriteName = boardSpriteName[(int)lobbyHost.selectedPlayerCharacter[i]];
        }

        switch (lobbyHost.GetPlayerCount())
        {
        case 1:
            character[0].transform.position = new Vector3(0, character[0].transform.position.y, 0);
            character[1].SetActive(false);
            character[2].SetActive(false);
            character[3].SetActive(false);
            character[4].SetActive(false);
            character[5].SetActive(false);
            break;

        case 2:
            character[0].transform.position = new Vector3(0, character[0].transform.position.y, 10);
            character[1].transform.position = new Vector3(0, character[1].transform.position.y, -10);
            character[2].SetActive(false);
            character[3].SetActive(false);
            character[4].SetActive(false);
            character[5].SetActive(false);
            break;

        case 3:
            character[0].transform.position = new Vector3(0, character[0].transform.position.y, 10);
            character[1].transform.position = new Vector3(-10, character[1].transform.position.y, -5);
            character[2].transform.position = new Vector3(10, character[2].transform.position.y, -5);
            character[3].SetActive(false);
            character[4].SetActive(false);
            character[5].SetActive(false);
            break;

        case 4:
            character[0].transform.position = new Vector3(-10, character[0].transform.position.y, 5);
            character[1].transform.position = new Vector3(10, character[1].transform.position.y, 5);
            character[2].transform.position = new Vector3(-10, character[2].transform.position.y, -5);
            character[3].transform.position = new Vector3(10, character[3].transform.position.y, -5);
            character[4].SetActive(false);
            character[5].SetActive(false);
            break;

        case 5:
            character[0].transform.position = new Vector3(-10, character[0].transform.position.y, 5);
            character[1].transform.position = new Vector3(0, character[1].transform.position.y, 10);
            character[2].transform.position = new Vector3(10, character[2].transform.position.y, 5);
            character[3].transform.position = new Vector3(-7, character[3].transform.position.y, -5);
            character[4].transform.position = new Vector3(7, character[4].transform.position.y, -5);
            character[5].SetActive(false);
            break;

        case 6:
            character[0].transform.position = new Vector3(-10, character[0].transform.position.y, 5);
            character[1].transform.position = new Vector3(0, character[1].transform.position.y, 10);
            character[2].transform.position = new Vector3(10, character[2].transform.position.y, 5);
            character[3].transform.position = new Vector3(-10, character[3].transform.position.y, -5);
            character[4].transform.position = new Vector3(0, character[4].transform.position.y, -10);
            character[5].transform.position = new Vector3(10, character[5].transform.position.y, -5);
            break;
        }

        timeLabel.text = "02:00";

        storeManager.SetActive(false);
        itemMaker.SetActive(false);

        Camera.main.transform.position = cameraStartPosition;
        Camera.main.orthographicSize   = cameraStartSize;

        iTween.MoveTo(Camera.main.gameObject, iTween.Hash("position", cameraFinalPosition,
                                                          "easetype", iTween.EaseType.easeOutExpo,
                                                          "time", cameraStartTime,
                                                          "delay", 3.0f));
        iTween.ValueTo(this.gameObject, iTween.Hash("from", cameraStartSize,
                                                    "to", cameraFinalSize,
                                                    "time", cameraStartTime,
                                                    "easetype", iTween.EaseType.easeOutExpo,
                                                    "onupdate", "UpdateOrthographicCameraSize",
                                                    "delay", 3.0f));
    }
Beispiel #11
0
 void Start()
 {
     hostLobby = GameObject.Find("LobbyHost").GetComponent <LobbyHost> ();
     StartCoroutine(SetQR());
 }
 void Start()
 {
     lobbyHost = GameObject.Find("LobbyHost").GetComponent <LobbyHost>();
 }