Examples of IrcEvent


Examples of com.ensifera.animosity.craftirc.IRCEvent

        this.plugin = (CraftIRC) plugin;
    }

    @EventHandler
    public void onCustomEvent(IRCEvent event) {
        IRCEvent ircEvent = (IRCEvent) event;
        if (!ircEvent.isHandled()) {
            switch (ircEvent.eventMode) {
            case COMMAND:
                if (ircEvent.msgData.message.startsWith("example")) {
                    this.plugin.sendMessageToTag("This is an example custom CraftIRC command. The pen is %red%rrrrrrr%blue%oyal blue!",
                            ircEvent.msgData.srcChannelTag);
                    ircEvent.setHandled(true);
                }
            case AUTHED_COMMAND:
                if (ircEvent.msgData.message.startsWith("authexample")) {
                    this.plugin.sendMessageToTag("This is an example custom %u%authenticated%u% CraftIRC command.",
                            ircEvent.msgData.srcChannelTag);
                    ircEvent.setHandled(true);
                }
            }
        }
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

        assertEquals(event.getArgument("CloseMessage"), "close message");
        assertEquals(event.getEventType(), IrcEventType.Part);
    }

    public void testQuitChangedEvent() {
        IrcEvent event = IrcEvent.tryParse(quitEvent);

        assertNotNull(event);

        assertEquals(event.getUser(), "old_nick");
        assertEquals(event.getHost(), "host.org");
        assertEquals(event.getArgument("QuitMessage"), "quit message");
        assertEquals(event.getEventType(), IrcEventType.Quit);
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

        assertEquals(event.getArgument("QuitMessage"), "quit message");
        assertEquals(event.getEventType(), IrcEventType.Quit);
    }

    public void testKickChangedEvent() {
        IrcEvent event = IrcEvent.tryParse(kickEvent);

        assertNotNull(event);

        assertEquals(event.getUser(), "old_nick");
        assertEquals(event.getHost(), "host.org");
        assertEquals(event.getChannel(), "#test_channel");
        assertEquals(event.getArgument("UserKicked"), "kicked_user_nick");
        assertEquals(event.getArgument("KickMessage"), "kick message");
        assertEquals(event.getEventType(), IrcEventType.Kick);
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

        assertEquals(event.getArgument("KickMessage"), "kick message");
        assertEquals(event.getEventType(), IrcEventType.Kick);
    }

    public void testJoinChangedEvent() {
        IrcEvent event = IrcEvent.tryParse(joinEvent);

        assertNotNull(event);

        assertEquals(event.getUser(), "old_nick");
        assertEquals(event.getHost(), "host.org");
        assertEquals(event.getChannel(), "#test_channel");
        assertEquals(event.getEventType(), IrcEventType.Join);
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

        assertEquals(event.getChannel(), "#test_channel");
        assertEquals(event.getEventType(), IrcEventType.Join);
    }

    public void testModeChangedEvent() {
        IrcEvent event = IrcEvent.tryParse(modeEvent);

        assertNotNull(event);

        assertEquals(event.getUser(), "old_nick");
        assertEquals(event.getHost(), "host.org");
        assertEquals(event.getArgument("User"), "user_nick_name");
        assertEquals(event.getEventType(), IrcEventType.Mode);
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

    private String modeEvent = ":old_nick!host.org MODE #test_channel +o user_nick_name";
    private String joinEvent = ":old_nick!host.org JOIN #test_channel";


    public void testNickChangedEvent() {
        IrcEvent event = IrcEvent.tryParse(nickEvent);

        assertNotNull(event);

        assertEquals(event.getUser(), "old_nick");
        assertEquals(event.getHost(), "host.org");
        assertEquals(event.getArgument("NewNickName"), "new_nick");
        assertEquals(event.getEventType(), IrcEventType.Nick);
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

        assertEquals(event.getArgument("NewNickName"), "new_nick");
        assertEquals(event.getEventType(), IrcEventType.Nick);
    }

    public void testTabClosedChangedEvent() {
        IrcEvent event = IrcEvent.tryParse(tabCloseEvent);

        assertNotNull(event);

        assertEquals(event.getUser(), "old_nick");
        assertEquals(event.getHost(), "host.org");
        assertEquals(event.getChannel(), "#test_channel");
        assertEquals(event.getArgument("CloseMessage"), "close message");
        assertEquals(event.getEventType(), IrcEventType.Part);
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

    @Override
    public void ircMessageReceived(String message) {
        if (message != null) {
            IrcMessage ircMessage = IrcMessage.tryParse(message);
            IrcEvent ircEvent = IrcEvent.tryParse(message);

            if (ircMessage != null) {
                this.taskManager.notifyMessageListeners(ircMessage);
            } else if (ircEvent != null) {
                this.taskManager.notifyEventListeners(ircEvent);
View Full Code Here

Examples of org.jaibo.api.IrcEvent

*/

public final class QuitEventParser implements IrcEventParser {
    @Override
    public IrcEvent tryParse(String message) {
        IrcEvent ircEvent = null;

        if (message != null) {
            Pattern p = Pattern.compile("^:(.*)!(.*) QUIT :(.*)$");

            CharSequence sequence = message.subSequence(0, message.length());
            Matcher matcher = p.matcher(sequence);

            if (matcher.matches()) {
                ircEvent = new IrcEvent();

                ircEvent.setUser(matcher.group(1));
                ircEvent.setHost(matcher.group(2));
                ircEvent.setArgument("QuitMessage", matcher.group(3));
                ircEvent.setEventType(IrcEventType.Quit);
            }
        }

        return ircEvent;
    }
View Full Code Here

Examples of org.jaibo.api.IrcEvent

*/

public final class NickEventParser implements IrcEventParser {
    @Override
    public IrcEvent tryParse(String message) {
        IrcEvent ircEvent = null;

        if (message != null) {
            Pattern p = Pattern.compile("^:(.*)!(.*) NICK :(.*)$");

            CharSequence sequence = message.subSequence(0, message.length());
            Matcher matcher = p.matcher(sequence);

            if (matcher.matches()) {
                ircEvent = new IrcEvent();

                ircEvent.setUser(matcher.group(1));
                ircEvent.setHost(matcher.group(2));
                ircEvent.setArgument("NewNickName", matcher.group(3));
                ircEvent.setEventType(IrcEventType.Nick);
            }
        }

        return ircEvent;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.