Giter Site home page Giter Site logo

bstn1802 / autoreconnect Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 35.0 388 KB

Minecraft fabric mod which automatically reconnects the client to the last known server after disconnection

Home Page: https://www.curseforge.com/minecraft/mc-mods/autoreconnect

License: GNU Lesser General Public License v3.0

Java 100.00%
fabric minecraft minecraft-mod mod

autoreconnect's People

Contributors

bstn1802 avatar icaitlyn avatar tinyoverflow 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

Watchers

 avatar  avatar  avatar  avatar  avatar

autoreconnect's Issues

[FEATURE SUGGESTION] Add a way to join back from lobby servers.

Add a way to reconnect to servers that kick you into a lobby instead of kicking you out of the server completely, just add a way to enable/disable automatically typing /join survival for example every time you change worlds (thats why it has to be a toggle option) to join back the survival server, along side automatically reconnecting when kicked.

Config

Can't change the time it takes to reconnect, changing the config file does nothing.
Also if possible can the config be updated to work with the Mod Menu mod UI.
Thanks in advance.

Game Crash

i dropped the mod into my mods folder and now the game will immediately crash on attempting to load. i remove it and it works fine.

1.20 Compatibility

I believe this mod may be dead but if you're still out there is there a chance this will be updated? I love this mod

1.20.2

could you port mod to 1.20.2

Error with it trying to reconnect, but unable

The game crashed whilst unexpected error
Error: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "this.delays" is null

`---- Minecraft Crash Report ----
// Who set us up the TNT?

Time: 3/31/23, 12:19 AM
Description: Unexpected error

java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "this.delays" is null
at autoreconnect.config.ModConfig.getDelays(ModConfig.java:25)
at autoreconnect.AutoReconnect.onDisconnected(AutoReconnect.java:111)
at autoreconnect.event.DisconnectListener.lambda$static$0(DisconnectListener.java:11)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at autoreconnect.event.DisconnectListener.lambda$static$1(DisconnectListener.java:11)
at net.minecraft.class_419.handler$zzb000$autoreconnect$init(class_419.java:523)
at net.minecraft.class_419.(class_419.java:19)
at net.minecraft.class_634.method_10839(class_634.java:717)
at net.minecraft.class_2535.method_10768(class_2535.java:413)
at net.minecraft.class_636.method_2927(class_636.java:276)
at net.minecraft.class_310.method_1574(class_310.java:1698)
at net.minecraft.class_310.method_1523(class_310.java:1081)
at net.minecraft.class_310.method_1514(class_310.java:728)
at net.minecraft.client.main.Main.main(Main.java:217)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head --
Thread: Render thread
Stacktrace:
at autoreconnect.config.ModConfig.getDelays(ModConfig.java:25)
at autoreconnect.AutoReconnect.onDisconnected(AutoReconnect.java:111)
at autoreconnect.event.DisconnectListener.lambda$static$0(DisconnectListener.java:11)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at autoreconnect.event.DisconnectListener.lambda$static$1(DisconnectListener.java:11)
at net.minecraft.class_419.handler$zzb000$autoreconnect$init(class_419.java:523)
at net.minecraft.class_419.(class_419.java:19)
at net.minecraft.class_634.method_10839(class_634.java:717)
at net.minecraft.class_2535.method_10768(class_2535.java:413)
at net.minecraft.class_636.method_2927(class_636.java:276)

-- Last reload --
Details:
Reload number: 4
Reload reason: manual
Finished: No
Packs: Default, Fabric Mods
Stacktrace:
at net.minecraft.class_6360.method_36565(class_6360.java:49)
at net.minecraft.class_310.method_1587(class_310.java:2406)
at net.minecraft.class_310.method_1514(class_310.java:752)
at net.minecraft.client.main.Main.main(Main.java:217)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
`

[Question] How do I config the mod?

I am very new to Fabric mods. I've been playing 1.8.9 PvP for the longest time but when I finally found a good vanilla SMP, I joined it but it required 1.19.1-1.19.3. After my application was accepted, I installed Fabric (1.19.2 because there are more mods for that version). Another member of the SMP sent this mod in the Discord and I realized that I really needed this to AFK fish farm overnight despite restarts happening at ~5 am every night. But the server reopens after ~2 minutes and because the server tries 4 times in about 1 minute, I can't rejoin the server overnight and I'm pretty sure my fish rates are being affected by this.

TLDR: help config please idk why i typed this entire thing

cloth-config-9.0.92-fabric incompatible

I'm using latest cloth config (9.0.92) and I get this error:

Incompatible mod set!
net.fabricmc.loader.impl.FormattedException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install cloth-config2, version 6.0.0 or later.

cloth-config2 6.0.0

Hi, When i run my fabric with Autoreconnect mod i am getting this error.

Incompatible mod set!
net.fabricmc.loader.impl.FormattedException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install cloth-config2, version 6.0.0 or later.
Unmet dependency listing:
- Mod 'AutoReconnect' (autoreconnect) 2.1.0-beta requires version 6.0.0 or later of cloth-config2, which is missing!
at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:190)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:148)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

Fabric Loader ver: fabric-loader-0.14.10-1.19.2
List of mods:
autoreconnect-2.1.0-beta.jar
cloth-config-6.4.90-forge.jar
fabric-api-0.66.0+1.19.2.jar
modmenu-4.1.0.jar

[FEATURE REQUEST] add a total number of reconnects toggle

say I don't want to reconnect until I come back to the computer and disable it, but I only want to reconnect a certain number of times or for a certain amount of time (say 3 hours) you add an option to limit the total number of reconnects, and make it so you could either do; number of minutes (or hours) before reconnect attempts are stopped, or a number of total (successful) reconnects are made.
so:
Stop Reconnecting after: [3 button cycle] {Off} {Time} {# of attempts}
Time: 3 hours (180 min)
Number of Attempts: 15
would that be possible?
I don't want to afk all night but I don't know how to make my laptop sleep after a certain amount of time while closed. i just think this would be a neat addition and would make the process easier.

AutoMessages send old sent message in 1.20.2 and that is kind of dangerous

It litteraly killed me in my survival with friends 😢
image
When i reconnect, it actually send the message that i used to sent before i go afk, it's dangerous
image
The messages that i set in the parameter was actually never write, it always write something that i use to write from my chat history i guess
to fix the issues and not die i remove the AutoMessage features, need a fix and if you can't reproduce that problem i can make a video
i use this mods with Fabulous Optimized Modpack, thanks in advance

(slight) incompatibility with MultiConnect

I have a speculation, that using the latest version of MultiConnect makes this mod a big issue.

When used alongside each other, some sort of error occurs when you manually leave a server with the disconnect button, and AutoReconnect will try to put you back into the server, as if you were kicked out.
If you click back to the server list with the button within the time limit of being reconnected, your account will connect to the server, but the client will remain in the server list, and the account will stay connected until you close Minecraft entirely.

Now, here's the fun part. If you instead join another server, your account will technically be in both servers. You can move around on the one you just joined, and there will be several glitches, including the skybox alternating between the ones on the two servers.
I have not tried it with three servers, and I don't want to. My computer doesn't like me doing it in the first place.

Point is, you have to fix it. MultiConnect is the only mod that seems to be doing it, but I have some other mods enabled too, which could be contributing to it. I will come back after I've done some testing.

Compile mod for older versions.

Many players still prefer to play older versions of Minecraft(like 1.12.2 and 1.7.10), it would be nice to give them another useful mod.

Can I use your config code in my mod?

I'm making a mod that uses nested lists in its configuration system, similar to AutoReconnect; but I have no idea how to make a config screen for that myself.
Can I use your config code in my mod?
If/when my mod is released, due credit will be given

Auto Message not working

I am trying to get auto message to work with the current source code as the fix for commands is not out yet and once I eventually got it built I boot up Minecraft and the autoreconnect part of it worked but it did not send and messages, so to check my basis I used the current release and that also doesnt even send messages not commands as that doesnt work on 2.1.0-dev.

So am I doing something wrong or is there a specific way that you need to type in the server/world it targets?

Gives an error in log if there is no config file

Pretty small error since it still creates the default config file, but worth correcting. Could be changed to a warning if the behaviour is desireable.

Here's the error:
[22:53:18] [main/ERROR]: [AutoReconnect] NoSuchFileException: E:\minecraft\multiMC\mmc-stable-win32\MultiMC\instances\Single Mod Test\.minecraft\config\autoreconnect.json

The mod spam the .log

Hi.

The mob is spamming the logs kinda hard

[19:49:43] [main/INFO]: [STDOUT]: class_408
[19:49:43] [main/INFO]: [STDOUT]: class_408
[19:49:43] [main/INFO]: [STDOUT]: reset
[19:49:43] [main/INFO]: [STDOUT]: GuiChatOF
[19:49:43] [main/INFO]: [STDOUT]: GuiChatOF
[19:49:43] [main/INFO]: [STDOUT]: reset
[19:49:53] [main/INFO]: [STDOUT]: null
[19:49:53] [main/INFO]: [STDOUT]: null
[19:49:53] [main/INFO]: [STDOUT]: reset
[19:49:53] [main/INFO]: [STDOUT]: null
[19:49:53] [main/INFO]: [STDOUT]: null
[19:49:53] [main/INFO]: [STDOUT]: reset
[19:50:27] [main/INFO]: [STDOUT]: class_408
[19:50:27] [main/INFO]: [STDOUT]: class_408
[19:50:27] [main/INFO]: [STDOUT]: reset
[19:50:27] [main/INFO]: [STDOUT]: GuiChatOF
[19:50:27] [main/INFO]: [STDOUT]: GuiChatOF
[19:50:27] [main/INFO]: [STDOUT]: reset
[19:54:01] [main/INFO]: [STDOUT]: null
[19:54:01] [main/INFO]: [STDOUT]: null
[19:54:01] [main/INFO]: [STDOUT]: reset
[19:54:01] [main/INFO]: [STDOUT]: null
[19:54:01] [main/INFO]: [STDOUT]: null
[19:54:01] [main/INFO]: [STDOUT]: reset

These come on only when i have AutoReconnect on, making the logs kind of unreadable.

Hope you'll be able to push a fix for it, thanks a lot ! :)

1.19.4 finish code for connect

MinecraftClient client = MinecraftClient.getInstance();
Screen screen = client.currentScreen;
InetSocketAddress inetSocketAddress;

try {
Optional<InetSocketAddress> optional = AllowedAddressResolver.DEFAULT.resolve(address).map(Address::getInetSocketAddress);

inetSocketAddress = optional.get();
ClientConnection connection = ClientConnection.connect(inetSocketAddress, client.options.shouldUseNativeTransport());
connection.setPacketListener(new ClientLoginNetworkHandler(connection, client, info, screen, false, null, CurrentClass::setStatus));
connection.send(new HandshakeC2SPacket(inetSocketAddress.getHostName(), inetSocketAddress.getPort(), NetworkState.LOGIN));
connection.send(new LoginHelloC2SPacket(client.getSession().getUsername(), Optional.ofNullable(client.getSession().getUuidOrNull())));
} catch (Exception var6) {
}

private static void setStatus(Text status) {
      LOGGER.info("Reconnected to server: " + status.getString());
}

private static ServerInfo info =  new ServerInfo("name", "ip", false);
private static ServerAddress address = ServerAddress.parse("ip");

Incompatibility/Crashing on world create

AutoReconnect seems to be throwing an NPE, causing other mods that require a join hook to fail and inevitably crash the game when loading into a newly generated world.

I'm unsure what all mods this effects, but it does cause a crash with Litematica/Malilib, We deduced that it stems from this:

java.lang.NullPointerException: Cannot invoke "autoreconnect.reconnect.ReconnectHandler.isAttempting()" because "this.reconnectHandler" is null

2022-03-24-4.log

Switch to LGPL 3.0 license

This mod is licensed under GPL-3.0. While this is usually a good thing, in the case of a Minecraft mod it actually restricts the freedom of users due to the linking restrictions (this is why the Quilt template mod default README states that it is incompatible).

Another source is Modrinth's licensing guide: https://blog.modrinth.com/p/licensing-guide
Check the "Copyleft license" section

None of this is legal advice, just information that I have seen/received from other sources
No warranty is given regarding this information, and I (TechPro424) disclaim liability for damages resulting in using this information given on an "as-is" basis.

Feature Request

Also add AutoRespawn. The interface is same, when you die there is a timer that count down that will respawn you

Config is reset every time game launches.

This may be a new bug since the config file was changed. After manually editing the config, when the game launches, it resets to the default values. Also, after editing the times using the mod menu, the config is reset when the game re-launches.

Auto Message

Hi i recently needed a mod that auto reconnects and has a auto message feature this seemed perfect soo i downloaded it and it works but the only issue i have is that auto message does not work i tried it multiple times restarted minecraft re added messages but i couldn't fix it it doesn't crash or anything like that i would like if i can get some help :D

1.19.3 Support

Hello,

Do you know what is wrong with the 1.19.3 and could I help update it. I really like your mod and have been using it for years to keep a server bot working. Without this mod we lose connection too often.

Getting disconnected from a Singleplayer world causes unexpected behaviour

When the player is booted from a Singleplayer world in such a way that they would be sent to the Multiplayer screen, AutoReconnect will trigger and attempt to send the player to whatever server they were most recently connected to. If the player hasn't connected to any servers since launching the game, it will instead display a "Could not connect" error.

The simplest way to reproduce is to get kicked from a Singleplayer world for spamming:

  1. Enter a Singleplayer world where Cheats aren't enabled
  2. Send a message in chat
  3. Cyclically press T, up, and enter to send the message repeatedly
  4. The player will be automatically kicked for spamming, which triggers AutoReconnect. Once the timer expires, AutoReconnect will attempt to send the player to the most recent server they've joined. If none have been joined in the current session, it will display a "Could not connect" error.

The most straightforward fix would be for AutoReconnect to simply not trigger when the player is kicked from Singleplayer, but if I may, I'd like to request that instead this be fixed by having AutoReconnect send the player back into their Singleplayer world. I've been using the Textile Backup mod recently, and when you restore a backup in-game it causes a disconnect to the Multiplayer menu (and triggering AutoReconnect). I downloaded AutoReconnect because I was curious if it would save me a few clicks every time I restore a backup, so I'd be very happy if it could do that. Of course, this isn't even a particularly significant issue in the first place, since I'd assume most players will never experience a Singleplayer disconnect, so it might not warrant a fix anyways.

Crashes for 1.19.2

I press open Minecraft or whatever cpu gose 2 100 percent and it crashes this is the first time a game has ever capped my cpu that usually goes to blender

Auto Reconnect trigging while in server.

I have been having an issue where I would get the screen like it is joining a server even though I was already in a server. I believe it is the mod cause when I remove it, it doesn't happen. It doesn't happen a lot but it still happens every so often which can be annoying when your dueling someone. .-.

Doesn't work with newer version of fabricloader

net.fabricmc.loader.impl.FormattedException: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install fabric, version 0.30.0 or later.
Unmet dependency listing:
- Mod 'AutoReconnect' (autoreconnect) 1.3.2 requires any version of fabric, which is missing!
Inactive mods:
- mod 'Fabric API Base' (fabric-api-base) 0.3.0+a02b446388, reason: newer version active
- mod 'Fabric Resource Loader (v0)' (fabric-resource-loader-v0) 0.4.8+a00e834b88, reason: newer version active
at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:188)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:142)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Caused by: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install fabric, version 0.30.0 or later.
Unmet dependency listing:
- Mod 'AutoReconnect' (autoreconnect) 1.3.2 requires any version of fabric, which is missing!
Inactive mods:
- mod 'Fabric API Base' (fabric-api-base) 0.3.0+a02b446388, reason: newer version active
- mod 'Fabric Resource Loader (v0)' (fabric-resource-loader-v0) 0.4.8+a00e834b88, reason: newer version active
at net.fabricmc.loader.impl.discovery.ModResolver.findCompatibleSet(ModResolver.java:183)
at net.fabricmc.loader.impl.discovery.ModResolver.resolve(ModResolver.java:48)
at net.fabricmc.loader.impl.FabricLoaderImpl.setup(FabricLoaderImpl.java:222)
at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:186)
... 3 more

[Feature Request] Avoid reconnecting conditions

a way to add conditions to avoid reconnecting.
For example, let's say that you are afk-ing on a farm, but suddenly the farm started to lag the server (without you knowing or because you haven't been afk before that long), so some staff kicks you out, but then you would reconnect again, therefore the staff decides to ban you so you won't reconnect.
In this case you could add a Conditions feature to select what types of disconnecting message you got will trigger to autorecconect to the server...
The easier way I can think of to do it would be to add a text input to add some text that the disconnected message should match, like: if ( text contains input ) then { trigger }.
The more elaborate would be adding a selection of the most common disconnected options (looking up all the possible error messages or scenarios) and select from it, I believe this is more elaborate because you would need to add some options and, if a new message is added to the game, update the options to choose from.
in the end this would either trigger as a blacklist or whitelist.

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.