示例#1
0
        public static void InitializePlayer(VRCPlayerApi player)
        {
            int id = nextPlayerID;

            player.Log("Assigning player id " + id);
            ++nextPlayerID;

            playerIDs[player] = id;
            players[id]       = player;
            player.AddToList();

            if (masterID == -1)
            {
                player.Log("Player is now master");
                masterID = id;
                Debug.Assert(player.isMaster, "VRCP_PlayerManager:InitializePlayer Player should be considered master!");
            }
            else
            {
                Debug.Assert(!player.isMaster, "VRCP_PlayerManager:InitializePlayer Player should not be considered master!");
            }

            Debug.Assert(player.playerId == id, "VRCP_PlayerManager:InitializePlayer Player's id does not match assigned id!");

            if (networkReady)
            {
                CyanEmuMain.PlayerJoined(player);
            }
            else
            {
                waitingPlayers.Add(player);
            }
        }
示例#2
0
        public static void OnNetworkReady()
        {
            networkReady = true;
            foreach (var player in waitingPlayers)
            {
                CyanEmuMain.PlayerJoined(player);
            }

            waitingPlayers.Clear();
        }