Coder Social home page Coder Social logo

ajgeiss0702 / ajqueue Goto Github PK

View Code? Open in Web Editor NEW
51.0 4.0 20.0 965 KB

Add a queue for your servers when they are restarting or full!

Home Page: https://wiki.ajg0702.us/ajqueue/

License: GNU General Public License v3.0

Java 100.00%
bungeecord bungee-plugin velocity-plugin velocity

ajqueue's People

Contributors

ajgeiss0702 avatar jake-moore avatar jt122406 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ajqueue's Issues

Unexpected NullPointerException error

Error

[22:07:59 ERROR]: java.lang.NullPointerException: at index 511                                                                                               
[22:07:59 ERROR]:       at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:229)                                                 
[22:07:59 ERROR]:       at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:219)                                                
[22:07:59 ERROR]:       at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:213)                                                
[22:07:59 ERROR]:       at com.google.common.collect.ImmutableList.construct(ImmutableList.java:353)                                                         
[22:07:59 ERROR]:       at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:265)                                                            
[22:07:59 ERROR]:       at us.ajg0702.queue.common.queues.QueueServerImpl.getQueue(QueueServerImpl.java:101)                                                 
[22:07:59 ERROR]:       at us.ajg0702.queue.common.QueueManagerImpl.sendMessage(QueueManagerImpl.java:507)                                                   
[22:07:59 ERROR]:       at us.ajg0702.queue.common.QueueManagerImpl.sendMessages(QueueManagerImpl.java:491)                                                  
[22:07:59 ERROR]:       at us.ajg0702.queue.common.TaskManager.lambda$scheduleAtFixedRate$0(TaskManager.java:140)                                            
[22:07:59 ERROR]:       at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)                                                 
[22:07:59 ERROR]:       at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)                                                        
[22:07:59 ERROR]:       at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)          
[22:07:59 ERROR]:       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)                                         
[22:07:59 ERROR]:       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)                                         
[22:07:59 ERROR]:       at java.base/java.lang.Thread.run(Thread.java:833)       

Steps to reproduce

Unknown.

Environment

Velocity 3.2.0-SNAPSHOT (git-37fedf50-b260)

ajQueue Cooldowns Memory Leak

Cooldowns appear to be initiating a severe memory leak; uptime is 23 hours as this heap is generated. Only ~230 players were online during this heap generation.

image

My presumption is that user data isn't clearing after cache; overtime, building up memory usage excessively.

Exception after stop the server

I've noticed that when i stop the server with the / stop command i can see this stack trace in the proxy console:

[17:58:32] [Netty NIO Worker #11/ERROR]: Exception during connect; status = null
java.util.concurrent.CompletionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /127.0.0.1:30002
	at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:?]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /127.0.0.1:30002
Caused by: java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
	at sun.nio.ch.Net.pollConnectNow(Unknown Source) ~[?:?]
	at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) ~[?:?]
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:707) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	... 4 more
[17:58:37] [Netty NIO Worker #11/ERROR]: Exception during connect; status = null
java.util.concurrent.CompletionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /127.0.0.1:30002
	at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:?]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /127.0.0.1:30002
Caused by: java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
	at sun.nio.ch.Net.pollConnectNow(Unknown Source) ~[?:?]
	at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) ~[?:?]
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:707) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[proxy.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
	... 4 more

Proxy: Velocity 3.1.2-SNAPSHOT
Server: Paper #260

Add custom max-tries value for specific server OR if stated in the command

Basically what the title says

OPTION 1 - custom max-tries value for specific server

max-tries:
  default: 10 # set -1 to disable or 0 for forever
  authlobby1: 0

also, making that 0 will mean that it will try to send player until it either successfully sends it (if for example server was offline/restarting and has gone back online), player manually leaves the queue (by executing his own command), or he leaves the server (network)

OPTION 2 - state specifically in the command
e.g. /ajqueue send TestPlayer hub -t50 where -t50 will mean try 50 times until successful
or /ajqueue send TestPlayer hub -f where -f will mean try forever until successful or until server closes/player leaves the server or the queue manually

  • NOTE (for option 2): for this, making sure that ajQueue has this on spigot side to so we can also execute from spigot console /server TestPlayer hub -f to try sending TestPlayer to hub server trying forever until successful.....

Folia support

I hope someday this plugin will support Folia.
Folia isn't a stable release yet, so don't rush.

Currently, 'ProtocolLib, Vault, LuckPerms, PlaceholderAPI, EssentialsX, ViaVersion, ViaBackwards, CoreProtect, DiscordSRV, Chunky, Spark' plugins already support Folia, or Folia support is ready in pull requests.

https://docs.papermc.io/folia

TAB complete throws error/warn

1) go to proxy (bungee) console and type in leavequeue
2) press tab to autocomplete

get the error (here it is):

[02:20:01] [main/INFO]: An internal error occurred whilst executing this command, please check the console log for details.
[02:20:01] [main/WARN]: Error in dispatching command
java.lang.ClassCastException: class net.md_5.bungee.command.ConsoleCommandSender cannot be cast to class net.md_5.bungee.api.connection.ProxiedPlayer (net.md_5.bungee.command.ConsoleCommandSender and net.md_5.bungee.api.connection.ProxiedPlayer are in unnamed module of loader 'app')
	at us.ajg0702.queue.platforms.bungeecord.BungeeMethods.senderToPlayer(BungeeMethods.java:58) ~[?:?]
	at us.ajg0702.queue.commands.commands.leavequeue.LeaveCommand.autoComplete(LeaveCommand.java:108) ~[?:?]
	at us.ajg0702.queue.platforms.bungeecord.commands.BungeeCommand.onTabComplete(BungeeCommand.java:26) ~[?:?]
	at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:225) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at net.md_5.bungee.api.plugin.PluginManager.tabCompleteCommand(PluginManager.java:268) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at io.github.waterfallmc.waterfall.console.ConsoleCommandCompleter.complete(ConsoleCommandCompleter.java:21) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4381) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4347) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4286) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3778) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:679) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:468) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at net.minecrell.terminalconsole.SimpleTerminalConsole.readCommands(SimpleTerminalConsole.java:158) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at net.minecrell.terminalconsole.SimpleTerminalConsole.start(SimpleTerminalConsole.java:141) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:57) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]
	at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[FlameCord.jar:git:Waterfall-Bootstrap:1.19-R0.1-SNAPSHOT:e3cbb01:unknown]

Multi proxying

Is there a redis platform support already in AjQueue, if not, would you mind if I implemented it?

Console Command to Join Players to a Queue

A common use case for servers is using console commands or some other elevated command executor to do things to players. A big one for us involves using NPCs from BetonQuest and Citizens to move people between servers. We ended up implementing our own version of this, a so-called cqueue command (console-queue), but also made a few breaking changes on the way for Java 17 and formatting, etc.

That fork can be found here.

Couldn't pass PluginMessageEvent to ajqueue

Couldn't pass PluginMessageEvent to ajqueue
java.lang.NullPointerException: Cannot invoke "us.ajg0702.queue.api.players.AdaptedPlayer.hasPermission(String)" because "player" is null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.