Array

Plugin Reload & API Docs

Avatar

By Scrumplex 5 May 2016 10:08

Admin · 2,147,483,647 comments
Stealth_^ wrote

ClientProperty.CONNECTION_CLIENT_IP

Is there a possibility of getting a getIP for clientInfo?

clientInfo.getIp()


The Developer of the Sprummlbot and the Admin of this forum.

Avatar

By Stealth_^ 5 May 2016 16:36

Member · 55 comments
Scrumplex wrote
Stealth_^ wrote

ClientProperty.CONNECTION_CLIENT_IP

Is there a possibility of getting a getIP for clientInfo?

clientInfo.getIp()


Is that the same for the ClientJoinEvent?

I try to do e.getIP and it doesn't show the option.

Avatar

By Scrumplex 5 May 2016 20:44

Admin · 2,147,483,647 comments
Stealth_^ wrote
Scrumplex wrote
Stealth_^ wrote

ClientProperty.CONNECTION_CLIENT_IP

Is there a possibility of getting a getIP for clientInfo?

clientInfo.getIp()


Is that the same for the ClientJoinEvent?

I try to do e.getIP and it doesn't show the option.

I think you will have to get the ClientInfo and work with that


The Developer of the Sprummlbot and the Admin of this forum.

Avatar

By Stealth_^ 6 May 2016 02:07

Member · 55 comments
Scrumplex wrote
Stealth_^ wrote
Scrumplex wrote

clientInfo.getIp()


Is that the same for the ClientJoinEvent?

I try to do e.getIP and it doesn't show the option.

I think you will have to get the ClientInfo and work with that

How would I do that from the Event Listener?

Avatar

By Stealth_^ 20 May 2016 09:40

Member · 55 comments

What's the proper usage for getConfig?

Avatar

By Scrumplex 20 May 2016 17:28

Admin · 2,147,483,647 comments
Stealth_^ wrote

What's the proper usage for getConfig?

Example

        Config conf = getConfig();
        Ini defaultIni = new Ini();
        Profile.Section defaultSec = defaultIni.add("Test");
        defaultSec.put("This will", "be added to config if not existing!");
        defaultSec.put("This is an integer", 13);
        defaultSec.put("This is a boolean", true);
        //Will define the default config
        conf.setDefaultConfig(defaultIni);
        try {
            //Will create/update ini file and get
            Ini ini = conf.compare().getIni();
            Profile.Section sec = ini.get("Test");
            String s = sec.get("This will");
            int i = sec.get("This is an integer", Integer.class);
            boolean b = sec.get("This is a boolean", Boolean.class);
            System.out.println(s);
            System.out.println(i);
            System.out.println(b);
            /*Will return:
            be added to config if not existing!
            13
            true
             */
        } catch (IOException e) {
            //Exception if default Ini could not be created.
            System.err.println("oh no an error occurred :c");
        }

The Developer of the Sprummlbot and the Admin of this forum.

Avatar

By Stealth_^ 22 May 2016 20:52

Member · 55 comments

Would I have to put that in every function I need to use it then?

Or how would I get information from the config in a different function. Example given: get a response from the config if a command is run and getting a join message that's set in the config.

Avatar

By Scrumplex 23 May 2016 05:13

Admin · 2,147,483,647 comments

You could do this in every function:

Ini ini = getConfig.getIni();

And work with that. The other function i did is initialization


The Developer of the Sprummlbot and the Admin of this forum.

Avatar

By Stealth_^ 23 May 2016 16:43

Member · 55 comments

That's what I thought, thanks!

Avatar

By Stealth_^ 27 May 2016 07:18

Member · 55 comments

I saw that you made an Issue Report for the same thing I'm trying to figure out.
https://github.com/TheHolyWaffle/TeamSp … /issues/68

What did you do to make it work (if anything)?

EDIT: I guess it's worth mentioning that I'm trying to remove all groups on client disconnect.

Last edited by Stealth_^ (27 May 2016 08:20)

Array