Beispiel #1
0
 private void OnPlayerJoined(ClientJoinedEventArgs e)
 {
     foreach (EventListener bl in Plugins)
     {
         IPlayerListener pl = (IPlayerListener)bl.Listener;
         if (bl.Event == Event.PlayerJoined)
             pl.OnPlayerJoined(e);
     }
 }
 public void OnPlayerJoined(ClientJoinedEventArgs e)
 {
 }
Beispiel #3
0
        internal void OnJoined()
        {
            LoggedIn = true;
            string DisplayMessage = DisplayName + " has logged in";
            //Event
            ClientJoinedEventArgs e = new ClientJoinedEventArgs(Client);
            Server.PluginManager.CallEvent(Event.PlayerJoined, e);
            //We kick the player because it would not work to use return.
            if (e.EventCanceled)
            {
                _client.Kick("");
                return; //return here so we do not display message
            }
            DisplayMessage = e.BrodcastMessage;
            //End Event
            Server.Broadcast(DisplayMessage);

            if(!string.IsNullOrEmpty(ChraftConfig.ServerTextureUrl))
            {
                string message = ChraftConfig.ServerTextureUrl + '\0' + 16;
                _client.SendPacket(new PluginMessagePacket
                    {
                        Channel = "MC|TPack",
                        Message = Encoding.UTF8.GetBytes(message),
                    });
            }
        }
Beispiel #4
0
 internal void OnJoined()
 {
     LoggedIn = true;
     string DisplayMessage = DisplayName + " has logged in";
     //Event
     ClientJoinedEventArgs e = new ClientJoinedEventArgs(Client);
     Server.PluginManager.CallEvent(Event.PlayerJoined, e);
     //We kick the player because it would not work to use return.
     if (e.EventCanceled)
     {
         _client.Kick("");
         return; //return here so we do not display message
     }
     DisplayMessage = e.BrodcastMessage;
     //End Event
     Server.Broadcast(DisplayMessage);
 }