Hey guys and girls,
So I've been having an issue that I just can't wrap my head around anymore. I have my rsps up on a VPS and it is online at the moment. People on windows computers are connecting just fine to the server, so it is port forwarded correctly, and I do have the proper IP address set into my gui.java class as well as my client.java class where it calls for "server = *ip address here*" For whatever reason, whenever someone on a mac tries to log in, (by putting in user and password), it gives them an error connecting to server issue. This is definitely not a cache direction issue, because the cache is downloading just fine as their client does in fact boot up. It is a connection issue, but only with the MAC Operating system. The player in question trying to log in has java 1.6 jdk downloaded (i believe) I will paste my login method from within my client.java class (client sided) below. Any help is greatly appreciated because I am at a loss at this point.
Code:
private void login(String s, String s1, boolean flag)
{
signlink.errorname = s;
try
{
if(myUsername.endsWith(" ") || myUsername.endsWith("_")){
loginMessage1 = "";
loginMessage2 = "@[email protected] spaces after username. Please try again.";
return;
}
if(!flag)
{
loginMessage1 = "";
loginMessage2 = "Connecting to server...";
drawLoginScreen(true);
}
socketStream = new RSSocket(this, openSocket(43594));
long l = TextClass.longForName(s);
int i = (int)(l >> 16 & 31L);
stream.currentOffset = 0;
stream.writeWordBigEndian(14);
stream.writeWordBigEndian(i);
socketStream.queueBytes(2, stream.buffer);
for(int j = 0; j < 8; j++)
socketStream.read();
int k = socketStream.read();
int i1 = k;
if(k == 0)
{
socketStream.flushInputStream(inStream.buffer, 8);
inStream.currentOffset = 0;
aLong1215 = inStream.readQWord();
int ai[] = new int[4];
ai[0] = (int)(Math.random() * 99999999D);
ai[1] = (int)(Math.random() * 99999999D);
ai[2] = (int)(aLong1215 >> 32);
ai[3] = (int)aLong1215;
stream.currentOffset = 0;
stream.writeWordBigEndian(10);
stream.writeDWord(ai[0]);
stream.writeDWord(ai[1]);
stream.writeDWord(ai[2]);
stream.writeDWord(ai[3]);
stream.writeDWord(12345);
stream.writeString(s);
stream.writeString(s1);
stream.writeString(CreateUID.generateUID());
stream.doKeys();
aStream_847.currentOffset = 0;
if(flag)
aStream_847.writeWordBigEndian(18);
else
aStream_847.writeWordBigEndian(16);
aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
aStream_847.writeWordBigEndian(255);
aStream_847.writeWord(317);
aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
for(int l1 = 0; l1 < 9; l1++)
aStream_847.writeDWord(expectedCRCs[l1]);
aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
stream.encryption = new ISAACRandomGen(ai);
for(int j2 = 0; j2 < 4; j2++)
ai[j2] += 50;
encryption = new ISAACRandomGen(ai);
socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
k = socketStream.read();
}
if(k == 1)
{
try
{
Thread.sleep(2000L);
}
catch(Exception _ex) { }
login(s, s1, flag);
return;
}
if(k == 2)
{
myPrivilege = socketStream.read();
flagged = socketStream.read() == 1;
aLong1220 = 0L;
anInt1022 = 0;
mouseDetection.coordsIndex = 0;
super.awtFocus = true;
aBoolean954 = true;
loggedIn = true;
stream.currentOffset = 0;
inStream.currentOffset = 0;
pktType = -1;
anInt841 = -1;
anInt842 = -1;
anInt843 = -1;
pktSize = 0;
anInt1009 = 0;
anInt1104 = 0;
anInt1011 = 0;
anInt855 = 0;
menuActionRow = 0;
menuOpen = false;
super.idleTime = 0;
for(int j1 = 0; j1 < 100; j1++)
chatMessages[j1] = null;
itemSelected = 0;
spellSelected = 0;
loadingStage = 0;
anInt1062 = 0;
anInt1278 = (int)(Math.random() * 100D) - 50;
anInt1131 = (int)(Math.random() * 110D) - 55;
anInt896 = (int)(Math.random() * 80D) - 40;
minimapInt2 = (int)(Math.random() * 120D) - 60;
minimapInt3 = (int)(Math.random() * 30D) - 20;
minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
anInt1021 = 0;
anInt985 = -1;
destX = 0;
destY = 0;
playerCount = 0;
npcCount = 0;
for(int i2 = 0; i2 < maxPlayers; i2++)
{
playerArray[i2] = null;
aStreamArray895s[i2] = null;
}
for(int k2 = 0; k2 < 16384; k2++)
npcArray[k2] = null;
myPlayer = playerArray[myPlayerIndex] = new Player();
aClass19_1013.removeAll();
aClass19_1056.removeAll();
for(int l2 = 0; l2 < 4; l2++)
{
for(int i3 = 0; i3 < 104; i3++)
{
for(int k3 = 0; k3 < 104; k3++)
groundArray[l2][i3][k3] = null;
}
}
aClass19_1179 = new NodeList();
fullscreenInterfaceID = -1;
anInt900 = 0;
friendsCount = 0;
dialogID = -1;
backDialogID = -1;
openInterfaceID = -1;
invOverlayInterfaceID = -1;
anInt1018 = -1;
aBoolean1149 = false;
tabID = 3;
inputDialogState = 0;
menuOpen = false;
messagePromptRaised = false;
aString844 = null;
anInt1055 = 0;
anInt1054 = -1;
aBoolean1047 = true;
method45();
welcome();
for(int j3 = 0; j3 < 5; j3++)
anIntArray990[j3] = 0;
for(int l3 = 0; l3 < 5; l3++)
{
atPlayerActions[l3] = null;
atPlayerArray[l3] = false;
}
anInt1175 = 0;
anInt1134 = 0;
anInt986 = 0;
anInt1288 = 0;
anInt924 = 0;
anInt1188 = 0;
anInt1155 = 0;
anInt1226 = 0;
int anInt941 = 0;
int anInt1260 = 0;
resetImageProducers2();
return;
}
if(k == 3)
{
loginMessage1 = "";
loginMessage2 = "Invalid username or password.";
return;
}
if(k == 4)
{
loginMessage1 = "";
loginMessage2 = "Your account has been disabled.";
return;
}
if(k == 5)
{
loginMessage1 = "";
loginMessage2 = "Your account is already logged in.";
return;
}
if(k == 6)
{
loginMessage1 = "";
loginMessage2 = "UPDATE: Please reload this page.";
return;
}
if(k == 7)
{
loginMessage1 = "";
loginMessage2 = "Full World: Please use a different world.";
return;
}
if(k == 8)
{
loginMessage1 = "";
loginMessage2 = "Login server offline.";
return;
}
if(k == 9)
{
loginMessage1 = "";
loginMessage2 = "Too many connections from your address.";
return;
}
if(k == 10)
{
loginMessage1 = "";
loginMessage2 = "Unable to connect.Bad session id.";
return;
}
if(k == 11)
{
loginMessage2 = "";
loginMessage2 = "Please try again.";
return;
}
if(k == 12)
{
loginMessage1 = "";
loginMessage2 = "Please subscribe, or use a different world.";
return;
}
if(k == 13)
{
loginMessage1 = "";
loginMessage2 = "Could not complete login.";
return;
}
if(k == 14)
{
loginMessage1 = "";
loginMessage2 = "UPDATE: Please wait 1 minute and try again.";
return;
}
if(k == 15)
{
loggedIn = true;
stream.currentOffset = 0;
inStream.currentOffset = 0;
pktType = -1;
anInt841 = -1;
anInt842 = -1;
anInt843 = -1;
pktSize = 0;
anInt1009 = 0;
anInt1104 = 0;
menuActionRow = 0;
menuOpen = false;
aLong824 = System.currentTimeMillis();
return;
}
if(k == 16)
{
loginMessage1 = "";
loginMessage2 = "Please wait 1 minute and try again.";
return;
}
if(k == 17)
{
loginMessage1 = "";
loginMessage2 = "To play on this world move to a free area first";
return;
}
if(k == 20)
{
loginMessage1 = "";
loginMessage2 = "Please try using a different world.";
return;
}
if(k == 21)
{
for(int k1 = socketStream.read(); k1 >= 0; k1--)
{
loginMessage1 = "You have only just left another world";
loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
drawLoginScreen(true);
try
{
Thread.sleep(1000L);
}
catch(Exception _ex) { }
}
login(s, s1, flag);
return;
}
if(k == 22) {
loginMessage1 = "";
loginMessage2 = "Please appeal ban on the forums.";
return;
}
if(k == -1)
{
if(i1 == 0)
{
if(loginFailures < 2)
{
try
{
Thread.sleep(2000L);
}
catch(Exception _ex) { }
loginFailures++;
login(s, s1, flag);
return;
} else
{
loginMessage1 = "";
loginMessage2 = "";
return;
}
} else
{
loginMessage1 = "";
loginMessage2 = "Refresh Page:Too many incorrect attempts/IP's in use.";
return;
}
} else
{
System.out.println("response:" + k);
loginMessage1 = "";
loginMessage2 = "Please try again later.";
return;
}
}
catch(IOException _ex)
{
loginMessage1 = "";
}
catch(Exception e) {
System.out.println("Error while generating uid. Skipping step.");
e.printStackTrace();
}
loginMessage2 = "Error connecting to server.";
}