I have made a new mod which insures you log into any server whether it is full, or if it is even offline.
In other words, this mod saves you from spamming on the "Refresh" button when you cannot connect to a server. My mod does it for you. All you need to do is wait.
When the server is full, the screen will pop up as "Waiting for available server spot..." and when there is one, it automaticly logs you in.
When the server is offline for whatever reason the screen will then say "Waiting for the server to come online..." and will wait for the server to come back on-line and log you in.
Download: Better Login 1.4.7(this goes in your minecraft.jar file)
Older Versions:
How to install:
*This is only for windows and I will not go into detail with this*
1. If you don't have a file archiver get one.
2. Open the mod file I supplied and minecraft.jar (located at %appdata%\.minecraft\bin\minecraft.jar).
3. Copy the files that are in my file into the minecraft.jar file.
4. Delete the META-INV file that is in the minecraft.jar file.
5. ???
6. Profit!
Compatibility: This mod is compatible with almost all the mods that are available. This mod only edits one *.class (and not a commonly used one).
For people who think this DDoS a server: My mod only polls one server every 2.5 seconds. While on the other hand, you have people spamming the "Refresh" button where they might have multiple servers listed and polling servers that you don't even care about! What's worse? I don't know. The new feature in minecraft of being able to make a LAN world, it scans your local network every X amount of seconds to find some LAN worlds. Same thing.
Copyright:
This mod had no copyright and anyone can use it.
You can use it in your mod packs.
The only thing that I am not happy about is if you post a link of this mod other then this place.
Other then that, I don't care, It's not like I'm making money off of it or anything.
Technical stuff:
Here, I will be explaining how the mod works for people who are just starting with moding.
Code is here:
package net.minecraft.src;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import net.minecraft.client.Minecraft;
public class GuiConnecting extends GuiScreen{
private NetClientHandler clientHandler;
private boolean hideFLButton, loop, cancelled, lastButtonState, connect;
private int port;
private byte count;
private String ip, status;
private Minecraft mc;
public GuiConnecting(Minecraft mc, String ip, int port){
this.ip = ip;
this.port = port;
this.mc = mc;
this.mc.loadWorld((WorldClient)null);
System.out.println("Connecting to " + ip + ", " + port + " by raw data.");
lastButtonState = hideFLButton = true;
count = 49;
status = "connect.connecting";
cancelled = false;
connect = false;
loop = true;
}
public GuiConnecting(Minecraft mc, ServerData sd){
this.mc = mc;
this.mc.setServerData(sd);
this.mc.loadWorld((WorldClient)null);
{
ServerAddress SA = ServerAddress.func_78860_a(sd.serverIP);
this.ip = SA.getIP();
this.port = SA.getPort();
}
System.out.println("Connecting to " + this.ip + ", " + this.port + " by ServerData");
lastButtonState = hideFLButton = true;
count = 49;
status = "connect.connecting";
cancelled = false;
connect = false;
loop = true;
}
private void Connect(){
connect = true;
System.out.println("Actually connecting to " + this.ip + ", " + this.port);
hideFLButton = true;
loop = false;
status = "connect.connecting";
new ThreadConnectToServer(this, this.ip, this.port).start();
}
@Override
public void updateScreen(){
count++;
if (loop && count >= 50){
new ThreadCheckConnection().start();
count = 0;
}else if (this.clientHandler != null){
this.clientHandler.processReadPackets();
status = "connect.authorizing";
}
}
@Override
public void drawScreen(int par1, int par2, float par3){
drawDefaultBackground();
this.drawCenteredString(this.fontRenderer, StringTranslate.getInstance().translateKey(status), this.width / 2, this.height / 2 - 50, 16777215);
if (lastButtonState != hideFLButton){
lastButtonState = hideFLButton;
initGui();
}
super.drawScreen(par1, par2, par3);
}
public void initGui(){
this.controlList.clear();
if (hideFLButton){
this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, StringTranslate.getInstance().translateKey("gui.cancel")));
}else{
this.controlList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, 98, 20, StringTranslate.getInstance().translateKey("gui.cancel")));
this.controlList.add(new GuiButton(1, this.width / 2 + 2, this.height / 4 + 120 + 12, 98, 20, "Force Connect"));
}
}
@Override
protected void actionPerformed(GuiButton id){
if (id.id == 0){
if (this.clientHandler != null) this.clientHandler.disconnect();
cancelled = true;
this.mc.displayGuiScreen(new GuiMainMenu());
}else if (id.id == 1){
Connect();
}
super.actionPerformed(id);
}
static NetClientHandler setNetClientHandler(GuiConnecting par0GuiConnecting, NetClientHandler par1NetClientHandler){
return par0GuiConnecting.clientHandler = par1NetClientHandler;
}
static NetClientHandler getNetClientHandler(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.clientHandler;
}
static Minecraft func_74249_e(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.mc;
}
static Minecraft func_74250_f(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.mc;
}
static Minecraft func_74251_g(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.mc;
}
static Minecraft func_74256_a(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.mc;
}
static boolean isCancelled(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.cancelled;
}
static Minecraft func_74254_c(GuiConnecting par0GuiConnecting){
return par0GuiConnecting.mc;
}
private class ThreadCheckConnection extends Thread{
@Override
public void run() {
System.out.println("Checking server availability...");
Socket net = null;
String[] output = null;
boolean cannotConnect = false;
try{
net = new Socket();
net.setTcpNoDelay(true);
net.setTrafficClass(18);
net.connect(new InetSocketAddress(ip, port), 3000);
DataInputStream in = new DataInputStream(net.getInputStream());
DataOutputStream out = new DataOutputStream(net.getOutputStream());
out.write(254);
if (in.read() != 255){
throw new Exception();
}
String input = Packet.readString(in, 256);
output = input.split("\u00a7");
}catch (Exception e){
cannotConnect = true;
}finally{
try{
net.close();
}catch(Exception e){}
}
if (!connect){
if (cannotConnect){
status = "Waiting for the server to come online...";
hideFLButton = false;
}else if (Integer.parseInt(output[1]) < Integer.parseInt(output[2])){
Connect();
}else{
status = "Waiting for avaliable server spot...";
hideFLButton = false;
}
}
}
}
}
As you can see, this mod only takes up one class (excluding the subclass in here).
So this will be compatible with almost all the mods that are available today.
Let's start with how everything works in order.
When minecraft calls the main method of this class (called GuiConnecting)it will normally pass a "Minecraft" object and a "ServerData" object. Then it will extract the server IP and the port from the ServerData object and set some variables to there default position. Two things to note: it will set the count variable to 49 and the loop variable to true.When the loop variable is true, the "updateScreen" method (that gets called every tick) will check if it's true and increase the count variable by one so it is now 50 and check if the count variable is 50 which it is. It will then create a Thread which will poll the server to check if it is aether offline or full. While it's doing that the count variable is then 0. If your paying attention, this creates a clock which runs the thread every 50 ticks (2.5 seconds) to check if the server can be accessed. When the server can be accessed it calls the "Connect" method which obviously, connects to the server.
There was the explanation of the mod in a nutshell. Obviously there is some more jazz to make the mod work as well as it is now.
The only real problem I can see with this is that if many users are using it to connect to the same server. Wouldn't they be essentially DDoS'ing it with all the rapid connection attempts?
The only real problem I can see with this is that if many users are using it to connect to the same server. Wouldn't they be essentially DDoS'ing it with all the rapid connection attempts?
This doesn't make a deference. You already have a lot of users pressing the "Refresh" button. Most likely faster then 2.5 seconds. Also I am only polling the server. This uses very little networking traffic. I don't think that anyone would be able DDos the server with only that.
The only real problem I can see with this is that if many users are using it to connect to the same server. Wouldn't they be essentially DDoS'ing it with all the rapid connection attempts?
very cool. does it contently spam the server with join requests? or how does it work?
The mod only polls the server which responds "<motd>|<max players>|<players online>" so then I take the max players and the players on-line count compare the two in a if statement like this, if (max players > player count) if this is true, then it will connect. The code is in the spoiler on the bottom of the thread.
FOR PEOPLE WHO WERE USING OLDER VERSIONS:
I have fixed a lot of bugs since the first release of this mod.
Please update the mod to get all the bugs fixed.
*The fixes are only for the 1.3.2 version.*
Great mod I have been looking for a mod that does this forever I was even thinking of coding it my self hope you make more mods that have not been done yet and needs to be
I'm trying to be a modder that improves minecraft in ways that people don't usually think of like my mod does here. The only problem is that it's hard to come up with ideas.
For people who want to know the bugs I fixed since the first release of this mod:
Fixed a rare concurrentModificationException.
Fixed 2 places were the screen would flash back to it's last state.
Miner changes:
changed some text.
Cleaned up the code.
For people who are still using 1.2.5 to run other mods that aren't updated, I have added a version of my mod for minecraft 1.2.5(It's in the older versions spoiler tag).
Hey I love this mod, but right now, I'm really into the MineZ servers. I use the public servers that reserve 5 spots for premium members, which pretty much renders this mod useless because there's no option to keep pinging it if it's not full, even though it is for non-premium members like myself, so I was hoping you could somehow make this work for MineZ servers.
I have made a new mod which insures you log into any server whether it is full, or if it is even offline.
In other words, this mod saves you from spamming on the "Refresh" button when you cannot connect to a server. My mod does it for you. All you need to do is wait.
When the server is full, the screen will pop up as "Waiting for available server spot..." and when there is one, it automaticly logs you in.
When the server is offline for whatever reason the screen will then say "Waiting for the server to come online..." and will wait for the server to come back on-line and log you in.
Download: Better Login 1.4.7(this goes in your minecraft.jar file)
Older Versions:
Better Login 1.4.2
Better Login 1.3.2
Better Login 1.3.1
Better Login 1.2.5
How to install:
*This is only for windows and I will not go into detail with this*
1. If you don't have a file archiver get one.
2. Open the mod file I supplied and minecraft.jar (located at %appdata%\.minecraft\bin\minecraft.jar).
3. Copy the files that are in my file into the minecraft.jar file.
4. Delete the META-INV file that is in the minecraft.jar file.
5. ???
6. Profit!
Compatibility:
This mod is compatible with almost all the mods that are available.
This mod only edits one *.class (and not a commonly used one).
For people who think this DDoS a server:
My mod only polls one server every 2.5 seconds.
While on the other hand, you have people spamming the "Refresh" button where they might have multiple servers listed and polling servers that you don't even care about!
What's worse? I don't know.
The new feature in minecraft of being able to make a LAN world, it scans your local network every X amount of seconds to find some LAN worlds. Same thing.
Copyright:
This mod had no copyright and anyone can use it.
You can use it in your mod packs.
The only thing that I am not happy about is if you post a link of this mod other then this place.
Other then that, I don't care, It's not like I'm making money off of it or anything.
Technical stuff:
Here, I will be explaining how the mod works for people who are just starting with moding.
Code is here:
As you can see, this mod only takes up one class (excluding the subclass in here).
So this will be compatible with almost all the mods that are available today.
Let's start with how everything works in order.
When minecraft calls the main method of this class (called GuiConnecting)it will normally pass a "Minecraft" object and a "ServerData" object. Then it will extract the server IP and the port from the ServerData object and set some variables to there default position. Two things to note: it will set the count variable to 49 and the loop variable to true.When the loop variable is true, the "updateScreen" method (that gets called every tick) will check if it's true and increase the count variable by one so it is now 50 and check if the count variable is 50 which it is. It will then create a Thread which will poll the server to check if it is aether offline or full. While it's doing that the count variable is then 0. If your paying attention, this creates a clock which runs the thread every 50 ticks (2.5 seconds) to check if the server can be accessed. When the server can be accessed it calls the "Connect" method which obviously, connects to the server.
There was the explanation of the mod in a nutshell. Obviously there is some more jazz to make the mod work as well as it is now.
sincerely,
wolfenstein19
This doesn't make a deference. You already have a lot of users pressing the "Refresh" button. Most likely faster then 2.5 seconds. Also I am only polling the server. This uses very little networking traffic. I don't think that anyone would be able DDos the server with only that.
Notice the "hack" tag...
Yes. For sure. I'll pit it on this thread if it's good.
The mod can basicly be installed over anything. If you don't like installing mods yourself, check this out, I use it: http://www.minecraftforum.net/topic/1000645-multimc-31-windows-linux-mac/.
Link Removed
if you would not mind doing me a favor and pressing that little + button? thanks!
The mod only polls the server which responds "<motd>|<max players>|<players online>" so then I take the max players and the players on-line count compare the two in a if statement like this, if (max players > player count) if this is true, then it will connect. The code is in the spoiler on the bottom of the thread.
Indeed. Excellent job!
I have fixed a lot of bugs since the first release of this mod.
Please update the mod to get all the bugs fixed.
*The fixes are only for the 1.3.2 version.*
I'm trying to be a modder that improves minecraft in ways that people don't usually think of like my mod does here. The only problem is that it's hard to come up with ideas.
Fixed a rare concurrentModificationException.
Fixed 2 places were the screen would flash back to it's last state.
Miner changes:
changed some text.
Cleaned up the code.