예제 #1
0
        private async void OnNavigationBarAddClicked(object sender, EventArgs e)
        {
            var clientData = await ViewModel.SaveNewClient();

            if (ClientCreated != null)
            {
                ClientCreated.Invoke(clientData);
            }
        }
예제 #2
0
        public static PrimusClient CreateClient()
        {
            var client = new PrimusClient(Guid.NewGuid());

            _clients.Add(client.Guid, client);

            ClientCreated?.Invoke(client);

            return(client);
        }
예제 #3
0
        public void Awake()
        {
            instance = this;
            DontDestroyOnLoad(this);
            GetUserInfo.UpdateUserInfo();
            playerInfo = new PlayerInfo(GetUserInfo.GetUserName(), GetUserInfo.GetUserID());
            NetPeerConfiguration Config = new NetPeerConfiguration("BeatSaberMultiplayer")
            {
                MaximumHandshakeAttempts = 2, AutoFlushSendQueue = false
            };

            NetworkClient = new NetClient(Config);
            ClientCreated?.Invoke();
        }
예제 #4
0
 internal static void RaiseClientCreated(ConnectionClient client)
 {
     Log.Out.Info($"Raising 'ClientCreated' event for {client.EndPoint}");
     ClientCreated?.Invoke(new ClientCreatedEventArgs(client));
 }