Search in sources :

Example 1 with RedisNetwork

use of me.itsmas.network.server.network.redis.RedisNetwork in project Network-depr by Mas281.

the class Core method onEnable.

@Override
public void onEnable() {
    saveDefaultConfig();
    moduleManager = new ModuleManager();
    database = new MongoDB(this);
    commandManager = new CommandManager(this);
    chatManager = new ChatManager(this);
    network = new RedisNetwork(this);
    userManager = new UserManager(this);
    taskManager = new TaskManager(this);
    lang = new Lang(this);
}
Also used : CommandManager(me.itsmas.network.server.command.CommandManager) TaskManager(me.itsmas.network.server.task.TaskManager) UserManager(me.itsmas.network.server.user.UserManager) RedisNetwork(me.itsmas.network.server.network.redis.RedisNetwork) MongoDB(me.itsmas.network.server.database.MongoDB) Lang(me.itsmas.network.server.lang.Lang) ModuleManager(me.itsmas.network.server.module.ModuleManager) ChatManager(me.itsmas.network.server.chat.ChatManager)

Example 2 with RedisNetwork

use of me.itsmas.network.server.network.redis.RedisNetwork in project Network-depr by Mas281.

the class BungeeListener method onPluginMessageReceived.

@Override
public void onPluginMessageReceived(String channel, Player unused, byte[] data) {
    ByteArrayDataInput in = ByteStreams.newDataInput(data);
    if (channel.equals("BungeeCord")) {
        switch(in.readUTF()) {
            case "GetServer":
                {
                    String serverName = in.readUTF();
                    log("Received server name: %s ", serverName);
                    module.setServerName(serverName);
                    if (module instanceof RedisNetwork) {
                        ((RedisNetwork) module).resetQueue();
                    }
                    break;
                }
            case "GetServers":
                {
                    Set<String> servers = Sets.newHashSet(in.readUTF().split(", "));
                    module.setServers(Collections.unmodifiableSet(servers));
                    break;
                }
        }
    } else if (channel.equals("ServerUpdates")) {
        switch(in.readUTF()) {
            case "ProxyLeave":
                {
                    String player = in.readUTF();
                    module.removeTrackingData(player);
                }
        }
    }
}
Also used : Set(java.util.Set) RedisNetwork(me.itsmas.network.server.network.redis.RedisNetwork) ByteArrayDataInput(com.google.common.io.ByteArrayDataInput)

Aggregations

RedisNetwork (me.itsmas.network.server.network.redis.RedisNetwork)2 ByteArrayDataInput (com.google.common.io.ByteArrayDataInput)1 Set (java.util.Set)1 ChatManager (me.itsmas.network.server.chat.ChatManager)1 CommandManager (me.itsmas.network.server.command.CommandManager)1 MongoDB (me.itsmas.network.server.database.MongoDB)1 Lang (me.itsmas.network.server.lang.Lang)1 ModuleManager (me.itsmas.network.server.module.ModuleManager)1 TaskManager (me.itsmas.network.server.task.TaskManager)1 UserManager (me.itsmas.network.server.user.UserManager)1