public static void Init() { if (Instance == null) { Instance = BeatSaberUI.CreateCustomMenu <CustomMenu>("Waiting for players"); middleViewController = BeatSaberUI.CreateViewController <ListViewController>(); Instance.SetMainViewController(middleViewController, true, (firstActivation, type) => { try { if (firstActivation) { level = middleViewController.CreateText("", new Vector2(BASE.x + 40f, BASE.y)); level.alignment = TMPro.TextAlignmentOptions.Center; SteamAPI.SendPlayerPacket(Controllers.PlayerController.Instance._playerInfo); } if (firstInit) { firstInit = false; RefreshData(); } } catch (Exception e) { Logger.Error(e); } }); } }
void BroadcastPlayerPacket() { try { UpdatePlayerPacket(); SteamAPI.SendPlayerPacket(_playerInfo); } catch (Exception e) { Logger.Error(e); } }