PDA

View Full Version : 614 Lobby



SiniSoul
November 2nd, 2010, 16:12
Since I resigned from doing Perplexity at all I have resided to doing a shit load of tutorials in the next month along with the release of Unity/Harmony/Infinity.

If you don't know how to use these, don't ask me how to.

Special Note: You will get a RSString Error EVERY TIME, do this to your StreamBuffer



final String readGJString(byte i) {
anInt6813++;
byte i_66_ = (buffer[position++]);
System.out.println("ReadGJString: "+i_66_);
/*if (i_66_ != 0)
throw new IllegalStateException("Bad version number in gjstr2");*/
if (i < 45)
readShort(-105);
int i_67_ = position;
while ((buffer[position++]) != 0) {
/* empty */
}


I have no idea why, but it will send me that error. It works when you remove that.

Decrypt File:



public void execute(Player player, int size, Instream in) {
Outstream opcode = new Outstream(1);
/* PacketSize Verification */
int packetSize = in.readShort();
if(packetSize != in.getRemaining()) {
return;
}
/* Incorrect Version Verification */
int version = in.readInt();
if(version != LoginConstants.VERSION) {
opcode.writeByte(LoginConstants.OUT_OF_DATE);
player.isocket.writeOutstream(opcode);
return;
}
int a = in.readInt() & 0xff;
int b = in.readInt() & 0xff;
in.skip(20);
in.readString();
in.readInt();
/* TODO Cache Idx Verification */
int[] CacheIdxs = new int[34];
for(int i = 0; i < 34; i++) {
CacheIdxs[i] = in.readInt();
}
for(;;) {
if(in.readByte() == 10) {
break;
}
}
in.readLong();
in.readLong();
String user = Misc.formatPlayerNameForServer(Misc.longToPlayerNa me(in.readLong()));
System.out.println(user);
String pass = in.readString();
in.readLong();
in.readLong();
player.loginPlayer(user);
}


Login Reponse



public void sendLoginPacket() {
Outstream out = new Outstream(300);
Outstream out1 = new Outstream(500);
out.writeByte(player.getCredentials().getRights()) ;
out1.writeByte(2);
out1.writeByte(2);
out1.writeByte(0);
out1.writeByte(0);
out1.writeByte(0);
out1.writeShort(31);
out1.writeShort(1);
out1.writeShort(0);
out1.writeShort(player.getCredentials().getLastLog gedIn());
out1.writeInt(Misc.IPAddressToNumber("68.33.152.118"));
out1.writeByte(0);
out1.writeShort(0);
out1.writeShort(1);
out1.writeByte(0);
out1.putGJString2(player.getCredentials().getUsern ame());
out1.writeByte(0);
out1.writeInt(1);
out1.writeShort(1);
out1.putGJString2("68.33.152.118");
int length = out.getOffset();
out.writeByte((byte) length);
out.addBytes(out.buffer(), 0, length);
player.isocket.writeOutstream(out);
player.frames.sendWorldList(true);
player.frames.sendUnlockIgnoreList();
player.frames.sendUnlockFriendList();
player.frames.sendChatMessage(0, "Welcome To Perplexity!");
player.frames.sendChatMessage(11, "Welcome To Perplexity!");
}



OH And btw the world list is EXACTLY, the same as 602. So really no need to post. But here it is anyway.

Packet



public void sendWorldList(boolean getWorldConfiguration) {
Outstream worldbuffer = new Outstream(2000);
Outstream out = new Outstream(1000);
HarmonyServer.Lobby.getWorldList().loadWorldList(w orldbuffer, getWorldConfiguration);
out.writePacketVarShort(48);
out.writeByte(1);
out.addBytes(worldbuffer.getBuffer(), 0, worldbuffer.getOffset());
out.endPacketVarShort();
player.isocket.writeOutstream(out);
}


WorldList


/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package Harmony.util;

import Harmony.io.Outstream;
import java.util.ArrayList;

/**
* @author Hadyn Fitzgerald
* @version 1.0
*/
public class WorldList {

private static final ArrayList<WorldDef> worldList = new ArrayList<WorldDef>();

public WorldList() {
worldList.add(new WorldDef(1, 1, 1, "Alpha", "68.33.152.118", "USA", 76));
worldList.add(new WorldDef(2, 1, 1, "Beta", "68.33.152.118", "USA", 76));
worldList.add(new WorldDef(3, 1, 1, "Perplexity", "68.33.152.118", "USA", 76));
}

public void loadWorldList(Outstream out, boolean b) {
if (b == true)
getData(out, true, true);
else
getData(out, false, true);
}

public void getData(Outstream stream, boolean worldConfiguration, boolean worldStatus) {
stream.writeByte(worldStatus ? 2 : 0);
stream.writeByte(worldConfiguration ? 1 : 0);
if (worldConfiguration)
populateConfiguration(stream);
if (worldStatus)
populateStatus(stream);
}

/* COOORRREEEECCCCTTT */
private void populateConfiguration(Outstream buffer) {
putSmart(buffer, worldList.size());
setCountry(buffer);
putSmart(buffer, 0);
putSmart(buffer, (worldList.size() + 1));
putSmart(buffer, worldList.size());
for (WorldDef w : worldList) {
putSmart(buffer, w.getWorldId());
buffer.writeByte(w.getLocation());
buffer.writeInt(w.getFlag());
System.out.println("Offset Start: "+buffer.getOffset());
buffer.putGJString2(w.getActivity()); // activity
buffer.putGJString2(w.getIp()); // ip address
System.out.println("Offset End: "+buffer.getOffset());
}
buffer.writeInt(0x94DA4A87); // != 0
}

/* Correct... */
private void populateStatus(Outstream buffer) {
for (WorldDef w : worldList) {
putSmart(buffer, w.getWorldId()); // world id
int online = 0;
buffer.writeShort(online); // player count
}
}

private void putSmart(Outstream buffer, int value) {
if (value > -128)
buffer.writeByte((byte) value);
else
buffer.writeShort((short) value);
}

private void setCountry(Outstream buffer) {
for (WorldDef w : worldList) {
putSmart(buffer, w.getCountry());
buffer.putGJString2(w.getRegion());
}
}
}


WorldDef



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package Harmony.util;

/**
* @author Hadyn Fitzgerald
* @version 1.0
*/
public class WorldDef {

private int worldId;
private String activity;
private int location;
private String ip;
private int flag;
private String region;
private int country;

public WorldDef(int worldId, int location, int flag, String activity, String ip, String region, int country) {
this.worldId = worldId;
this.location = location;
this.flag = flag;
this.activity = activity;
this.ip = ip;
this.region = region;
this.country = country;
}

public String getRegion() {
return region;
}

public int getCountry() {
return country;
}

public int getFlag() {
return flag;
}

public int getLocation() {
return location;
}

public String getIp() {
return ip;
}

public int getWorldId() {
return worldId;
}

public String getActivity() {
return activity;
}
}



Enjoy.

Stacx
November 2nd, 2010, 16:17
int length = out.getOffset();

Lol'd.

what was

in.skip(20);

for?

SiniSoul
November 2nd, 2010, 16:19
int length = out.getOffset();

Lol'd.

what was

in.skip(20);

for?

Don't be dissing my code seeing as it works :P

I think (not sure) the in.skip(20); are settings but they never worked just right for me.

Stacx
November 2nd, 2010, 16:22
Don't be dissing my code seeing as it works :P

I think (not sure) the in.skip(20); are settings but they never worked just right for me.

Noone is "dissing" your code whatsoever, where are the width height and type being written though o.o

EDIT: nvm it seems to send it later ;P

SiniSoul
November 2nd, 2010, 16:24
Noone is "dissing" your code whatsoever, where are the width height and type being written though o.o

in those 20 bytes I am pretty sure...

Stacx
November 2nd, 2010, 16:26
in those 20 bytes I am pretty sure...

They are shorts, but they get sent later so don't worry lal :P

`Conner
November 2nd, 2010, 16:27
You should have figured those "settings" bytes out, lolz.

SiniSoul
November 2nd, 2010, 16:31
You should have figured those "settings" bytes out, lolz.

Unless you know how to use them they are POINTLESS lol.

`Conner
November 2nd, 2010, 16:32
Unless you know how to use them they are POINTLESS lol.

Well what's inside aside from width/height props? :|

SiniSoul
November 2nd, 2010, 16:33
Well what's inside aside from width/height props? :|

The setting string.

Cjay0091
November 2nd, 2010, 19:20
The skips are settings.

`Conner
November 3rd, 2010, 16:26
The setting string.

Ahhh, the randomly generated settings string. wkndjochosounjajd172631dhjws, something like? Lol.

Good job anyway, i will definitely check this out.

battlezone
November 4th, 2010, 01:04
Since I resigned from doing Perplexity at all I have resided to doing a shit load of tutorials in the next month along with the release of Unity/Harmony/Infinity.
great another person like emily or the dick who realsed runeslay to ruin rsps and the real programmers work.

Jon
November 4th, 2010, 01:16
great another person like emily or the dick who realsed runeslay to ruin rsps and the real programmers work.

He did lobby lol >_<

alboboy94
November 4th, 2010, 01:18
great another person like emily or the dick who realsed runeslay to ruin rsps and the real programmers work.

like you knew how to do this.

Cjay0091
November 4th, 2010, 01:19
Again... more trolling....

@ The people above me, its not hard as Mgi released this already...

blood rush20
November 4th, 2010, 01:33
great another person like emily or the dick who realsed runeslay to ruin rsps and the real programmers work.

he makes me laugh every time he's so hardcore i'm surprise if he's be nice enough to tell someone how to turn on a computer.... cause u know they could make something better than he could... ha

SiniSoul
November 4th, 2010, 15:21
great another person like emily or the dick who realsed runeslay to ruin rsps and the real programmers work.

And another duche bag who doesn't realize I did this all by myself. Yes I will run RSPS to the ground, I release 614 lobby and I have ruined everything. Get over it.

BTW I am not as cool as emily but I am alot nicer xD


Again... more trolling....

@ The people above me, its not hard as Mgi released this already...

HE released what to send. And actually he got most of it wrong. Yes please, refrain from trolling.

Stacx
November 4th, 2010, 15:26
great another person like emily or the dick who realsed runeslay to ruin rsps and the real programmers work.

Coming from the guy who doesn't know anything but likes to act cool around rl.

SiniSoul
November 4th, 2010, 15:46
Coming from the guy who doesn't know anything but likes to act cool around rl.

^This.

kaos
November 4th, 2010, 18:24
Cheers for the tuts :D. Might start 600+ soon :D.