public void CmdEndGame()
    {
        List <CaptainsMessPlayer> players     = GetPlayers();
        NetworkedPlayerScript     bonusPlayer = null;
        float      longestMatchTime           = -1;
        List <int> scoringSongs = new List <int>();

        foreach (CaptainsMessPlayer player in players)
        {
            NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>();

            int sid = nps.GetSongID();

            if (nps.scored_GuessedCorrect)
            {
                float currentMatchTime = nps.matchTime;

                nps.RpcAddScore(5 * Mathf.FloorToInt(currentMatchTime), (int)Score.Time);

                if (currentMatchTime > longestMatchTime)
                {
                    longestMatchTime = currentMatchTime;
                    bonusPlayer      = nps;
                }

                scoringSongs.Add(sid);

                //Hacky bullshit for finding which kind of game we're in?
                GameManagerScript gameManager = FindObjectOfType <GameManagerScript>();
                Assert.IsNotNull <GameManagerScript>(gameManager);
                int songSet = gameManager.GetSongSet();

                Analytics.CustomEvent("guessedCorrect", new Dictionary <string, object>
                {
                    { "matchTime", currentMatchTime },
                    { "songSet", songSet },
                    { "songID", sid }
                });
            }
            else
            {
                for (int i = 0; i < players.Count; i++)
                {
                    NetworkedPlayerScript other_nps = players[i].GetComponent <NetworkedPlayerScript>();

                    if (sid == other_nps.GetSongID())
                    {
                        if (nps.color != other_nps.color)
                        {
                            nps.match_color = other_nps.color;
                            break;
                        }
                    }
                }
            }
        }

        //Bonus for player who guessed first.
        if (bonusPlayer != null) //If this is null, nobody guessed anything. Lame!
        {
            bonusPlayer.RpcAddScore(100, (int)Score.First);
        }

        foreach (CaptainsMessPlayer player in players)
        {
            NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>();

            if (nps.scored_GuessedCorrect)
            {
                nps.RpcAddScore(250, (int)Score.Correct);
            }
            if (scoringSongs.Contains(nps.songID))
            {
                nps.RpcAddScore(500, (int)Score.WasGuessed);
            }

            nps.RpcEndGame();
        }

        mess.FinishGame();
    }