public async void SelectCharacter(Client client, object[] args) { uint characterId = (uint)(int)args[0]; CharacterData characterData = await CharacterDatabase.GetCharacterData(characterId); Vector3 position = characterData.GetPosition(); float heading = characterData.Heading.HasValue ? characterData.Heading.Value : 0; if (position == null) { GamePosition spawnPoint = ServerUtilities.GetRandomSpawnPoint(); position = spawnPoint.GetPosition(); heading = spawnPoint.GetHeading(); } client.SetData(CharacterData.CHARACTER_DATA_KEY, characterData); PlayerData playerData = client.GetData(PlayerData.PLAYER_DATA_KEY); GroupData highestRankedGroup = await GroupDatabase.GetPlayerHighestRankingGroup(playerData.Id); if (highestRankedGroup == null) { return; } if (characterData == null) { return; } ServerUtilities.SetPlayerNametag(client); ServerUtilities.SwitchPlayerPosition(client, position, heading); }