Exemple #1
0
 internal async Task PlayerLeftNotification(PlayerLeftNotification notification)
 {
     if (PlayerLeft != null)
     {
         await PlayerLeft?.Invoke(notification);
     }
 }
 public async Task Handle(PlayerLeftNotification notification, CancellationToken cancellationToken)
 {
     _state.CurrentPlayers.Remove(notification.PlayerName);
     await _mediator.Publish(new MinecraftStateNotification
     {
         CurrentState = _state
     });
 }
 public async Task Minecraft_PlayerLeft(PlayerLeftNotification playerLeftEvent)
 {
     await Application.Current.Dispatcher.InvokeAsync(delegate
     {
         PlayerList.Items.Remove(playerLeftEvent.PlayerName);
         PlayerListLabel.Content = $"Players online {PlayerList.Items.Count}/20";
     });
 }
 public async Task Handle(PlayerLeftNotification notification, CancellationToken cancellationToken)
 {
     foreach (var plugin in _pluginLoader.Enabled)
     {
         try
         {
             await plugin.OnPlayerLeft(notification, _pluginContext);
         }
         catch (Exception ex)
         {
             await _mediator.Publish(new PluginLogNotification
             {
                 Exception = ex,
                 Message   = $"Error in {nameof(plugin.OnPlayerLeft)} for plugin {plugin.Name}"
             });
         }
     }
 }
Exemple #5
0
 public override void PlayerLeft(IRpcController controller, PlayerLeftNotification request, Action<NO_RESPONSE> done)
 {
     throw new NotImplementedException();
 }
 public override void PlayerLeft(IRpcController controller, PlayerLeftNotification request, Action <NO_RESPONSE> done)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
 public override void PlayerLeft(IRpcController controller, PlayerLeftNotification request, Action<NO_RESPONSE> done)
 {
     ProtoOutputBuffer.Write(request.GetType(), request.ToString());
 }
 public override async Task OnPlayerLeft(PlayerLeftNotification notification, IPluginContext context)
 {
     await _minecraftDiscordClient.SendMessageAsync($"**{notification.PlayerName}** has left the game.");
 }
Exemple #9
0
 public override void PlayerLeft(Google.ProtocolBuffers.IRpcController controller, PlayerLeftNotification request, Action <bnet.protocol.NO_RESPONSE> done)
 {
     throw new NotImplementedException();
 }
Exemple #10
0
 public override void PlayerLeft(IRpcController controller, PlayerLeftNotification request, Action <NO_RESPONSE> done)
 {
     ProtoOutputBuffer.Write(request.GetType(), request.ToString());
 }
 public async Task Handle(PlayerLeftNotification notification, CancellationToken cancellationToken)
 {
     await _relayEventHandler.PlayerLeftNotification(notification);
 }
 public virtual Task OnPlayerLeft(PlayerLeftNotification notification, IPluginContext context)
 {
     return(Task.CompletedTask);
 }