To get the source into eclipse, just Right click on project list, select import and choose in the list "Git", "project from git"
Choose URI, and type this as URI : https://******.com/Mxous/jOryx.git
Let Eclipse download files....
Now you need to make usual modifications to the code (same modifications than when updating marine/get older proxy source to work)
* Change build in WorldState.java
Code:
public void connected(Client client) {
HelloPacket hp = new HelloPacket();
hp.buildVersion = "123.5.1";
* Update Packet.Java with new headers (and modify code )
Code:
public static final int FAILURE = 0;
public static final int CANCELTRADE = 1;
public static final int USEPORTAL = 3;
public static final int INVRESULT = 4;
public static final int JOINGUILD = 5;
public static final int PING = 6;
public static final int MOVE = 7;
public static final int GUILDINVITE = 8;
public static final int GLOBAL_NOTIFICATION = 9;
public static final int SETCONDITION = 10;
public static final int UPDATEACK = 11;
public static final int TRADEDONE = 12;
public static final int SHOOT = 13;
public static final int GOTOACK = 14;
public static final int CREATEGUILD = 15;
public static final int PONG = 16;
public static final int HELLO = 17;
public static final int TRADEACCEPTED = 18;
public static final int ENEMYSHOOT = 19;
public static final int NAMERESULT = 20;
public static final int REQUESTTRADE = 21;
public static final int SHOOTACK = 22;
public static final int TRADECHANGED = 23;
public static final int PLAYERHIT = 24;
public static final int TEXT = 25;
public static final int UPDATE = 26;
public static final int BUYRESULT = 27;
public static final int PIC = 28;
public static final int USEITEM = 30;
public static final int CREATE_SUCCESS = 31;
public static final int CHOOSENAME = 33;
public static final int QUESTOBJID = 34;
public static final int INVDROP = 35;
public static final int CREATE = 36;
public static final int CHANGETRADE = 37;
public static final int PLAYERSHOOT = 38;
public static final int RECONNECT = 39;
public static final int CHANGEGUILDRANK = 40;
public static final int DEATH = 41;
public static final int ESCAPE = 42;
public static final int PLAYSOUND = 44;
public static final int LOAD = 45;
public static final int ACCOUNTLIST = 46;
public static final int DAMAGE = 47;
public static final int CHECKCREDITS = 48;
public static final int TELEPORT = 49;
public static final int BUY = 50;
public static final int SQUAREHIT = 51;
public static final int GOTO = 52;
public static final int EDITACCOUNTLIST = 53;
public static final int CLIENTSTAT_FILE = 55;
public static final int SHOW_EFFECT = 56;
public static final int ACCEPTTRADE = 57;
public static final int CREATEGUILDRESULT = 58;
public static final int AOEACK = 59;
public static final int MAPINFO = 60;
public static final int TRADEREQUESTED = 61;
public static final int NEW_TICK = 62;
public static final int NOTIFICATION = 63;
public static final int GROUNDDAMAGE = 64;
public static final int INVSWAP = 65;
public static final int OTHERHIT = 66;
public static final int TRADESTART = 67;
public static final int AOE = 68;
public static final int PLAYERTEXT = 69;
public static final int ALLYSHOOT = 74;
public static final int CLIENTSTAT = 75;
public static final int ENEMYHIT = 76;
public static final int INVITEDTOGUILD = 77;
public static final int GUILDREMOVE = 78;
* Modify the UseItem/HelloPacket Packet as stated in the other "proxy" threads
Code:
/* oryx-hates-java
* Copyright (C) 2011-2012 Furyhunter <furyhunter600@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.oryxhatesjava.net;
import java****.DataInput;
import java****.DataOutput;
import java********Exception;
import java.nio.charset.Charset;
import java.util.Arrays;
import com.oryxhatesjava.net.data.Parsable;
/**
* <p>
* Sent by client to ensure it is up to date.
* </p>
* <p>
* Started Mar 2, 2011
* </p>
*
* @Author Furyhunter
*/
public class HelloPacket extends Packet implements Parsable {
public String buildVersion;
public int gameId; //int
public String guid;
public String password;
public String secret;
public int keyTime; //int
public byte[] key;
public String unkStr;
public String pk = "";
public String Tq = "";
public String H = "";
public String playPlatform = "";
public HelloPacket(DataInput read) {
try {
parseFromDataInput(read);
type = Packet.HELLO;
} catch (IOException e) {
}
}
public HelloPacket() {
type = Packet.HELLO;
}
@override
public void parseFromDataInput(DataInput read) throws IOException {
this.buildVersion = read.readUTF();
this.gameId = read.readInt();
this.guid = read.readUTF();
this.password = read.readUTF();
secret = read.readUTF();
keyTime = read.readInt();
int size = read.readUnsignedShort();
if (size > 0) {
key = new byte[size];
read.readFully(key);
}
size = read.readInt();
if (size > 0) {
byte[] buf = new byte[size];
read.readFully(buf);
unkStr = new String(buf, Charset.forName("UTF-8"));
}
pk = read.readUTF();
Tq = read.readUTF();
H = read.readUTF();
playPlatform = read.readUTF();
}
@override
public String toString() {
return "HELLO " + buildVersion + " " + gameId + " guid=" + guid + " pw="
+ password + " secret=" + secret + " " + keyTime + " " + Arrays.toString(key) + " " + unkStr;
}
@override
public void writeToDataOutput(DataOutput write) throws IOException {
write.writeUTF(buildVersion);
write.writeInt(gameId);
write.writeUTF(guid);
write.writeUTF(password);
write.writeUTF(secret);
write.writeInt(keyTime);
if (key != null) {
write.writeShort(key.length);
write.write(key);
} else {
write.writeShort(0);
}
if (unkStr != null) {
byte[] buf = unkStr.getBytes("UTF-8");
write.writeInt(buf.length);
write.write(buf);
} else {
write.writeInt(0);
}
write.writeUTF(pk);
write.writeUTF(Tq);
write.writeUTF(H);
write.writeUTF(playPlatform);
}
}
Code:
/*
* Copyright (C) 2011 Furyhunter <furyhunter600@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the creator nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.oryxhatesjava.net;
import java****.DataInput;
import java****.DataOutput;
import java********Exception;
import com.oryxhatesjava.net.data.Item;
import com.oryxhatesjava.net.data.Location;
import com.oryxhatesjava.net.data.Parsable;
public class UseItemPacket extends Packet implements Parsable {
public int time; //int
public Item MyItem ; //unsigned byte
public Location usePos;
public UseItemPacket(DataInput in) {
try {
type = Packet.USEITEM;
parseFromDataInput(in);
} catch (IOException e) {
}
}
public UseItemPacket() {
type = Packet.USEITEM;
}
@override
public void parseFromDataInput(DataInput in) throws IOException {
time = in.readInt();
MyItem = new Item(in);
usePos = new Location(in);
}
@override
public void writeToDataOutput(DataOutput out) throws IOException {
out.writeInt(time);
MyItem.writeToDataOutput(out);
usePos.writeToDataOutput(out);
}
@override
public String toString() {
return "USEITEM " + time + " " + MyItem.toString() + " " + usePos;
}
}
* Change Server and Client Encryption key in Proxy.Java
Code:
public static byte[] CLIENTKEY = fromHexString("311F80691451C71B09A13A2A6E");
public static byte[] SERVERKEY = fromHexString("72C5583CAFB6818995CBD74B80");
private static byte[] fromHexString(final String encoded) {
if ((encoded.length() % 2) != 0)
throw new IllegalArgumentException("Input string must contain an even number of characters");
final byte result[] = new byte[encoded.length() / 2];
final char enc[] = encoded.toCharArray();
for (int i = 0; i < enc.length; i += 2) {
StringBuilder curr = new StringBuilder(2);
curr.append(enc[i]).append(enc[i + 1]);
int ix = Integer.parseInt(curr.toString(), 16);
result[i / 2] = (byte) ix;
}
return result;
}
Your joryx should be able to connect to nexus/realm/dungeon...