LoginResponseListener



  • I am trying to listen for a login response (to handle bans and locks) but the notify() function is not called when the client logs in

    My current code is

    @ScriptMeta(developer = "Bobbey", desc = "Testing ", name = "Test script")
    public class TestScript extends Script  implements LoginResponseListener {
    
    	@Override
    	public void notify(LoginResponseEvent event) {
    		System.out.println("This is not called");
    	}
    
    //other stuff...
    }
    


  • I just tried it and it seemingly worked for me:

    @Override
        public void notify(LoginResponseEvent event) {
            Log.log(Level.ALL, "Debug", event.getResponse().getMessage());
        }
    

    download.png



  • Ah right. This event is not called when you log in properly


  • Script Developer Sponsor Staff Director

    @Bobbey Yes, the game doesn't send a "response event" for a successful login. This is only if a message is needed to be displayed on the login screen, such as "your account has been disabled"


 

84
Online

8.7k
Users

922
Topics

11.9k
Posts