Hi here is the initial download of my Universal Profile Editor tool.
For those who havn't seen my project thread, the aim off this is to build a unique and universal tool for editing .dat files written using an ObjectOutputStream. The tool makes use of reflection found within the java api. The use of reflection enables the tool to be as universal as it is.
My Universal Profile Editor tool can be downloaded from here.
Version is now 1.1 Version 1.1 allows for selecting of profile loading class from any directory. Using this version you do not need to manually specify the file name as an argument and the file can be loaded from anywhere.
This is only the initial release and there are other things I will be implementing such as array expanding, custom profile creation (accounts with pre set settings) and more. There are a couple of interface changes I will be making aswell. The source is fully open source although I havn't included any licencing thats because I havn't got time for that shit.
Spoiler for How to use can be found here.:
The tool uses reflection to gather information about veriables within a class. It then displays this information and allows you to edit it from simple to use interface.
Firstly you need to create a class which implements ProfileImpl which can be found within the download. This class is the fundimental loading/saving class and its up to you to load the values within your save files. The ProfileImpl interface contains three methods. load(ObjectInputStream), save(ObjectOutputStream) and prepare(). there is no need to open new files etc because the tool handles that. Hence why its giving you an Object stream in the parameter. Now for each value you need to load, create a new local veriable with the correct type. and then load them. This may sound hard but its really not. Its just how I've explained it really.
Spoiler for Example:
Code:
public class TestProfile implements ProfileImpl {
/*
* Our variables we are going to read from our save file
*/
public char testChar;
public float testFloat;
public double testDouble;
public String testString;
public int testInt;
public long testLong;
public boolean testBoolean;
public byte testByte;
public short testShort;
public Item[] inventoryItems;
@Override
public void load(ObjectInputStream in) throws IOException {
testChar = in.readChar();
testByte = in.readByte();
testFloat = in.readFloat();
testDouble = in.readDouble();
testString = in.readUTF();
testInt = in.readInt();
testLong = in.readLong();
testBoolean = in.readBoolean();
testShort = in.readShort();
for (int index = 0; index < inventoryItems.length; index++) {
int id = in.readInt();
if (id > -1) {
int amount = in.readInt();
inventoryItems[index] = new Item(id, amount);
}
}
}
@Override
public void save(ObjectOutputStream out) throws IOException {
out.writeChar(testChar);
out.writeByte(testByte);
out.writeFloat(testFloat);
out.writeDouble(testDouble);
out.writeUTF(testString);
out.writeInt(testInt);
out.writeLong(testLong);
out.writeBoolean(testBoolean);
out.writeShort(testShort);
for (int index = 0; index < inventoryItems.length; index++) {
Item item = inventoryItems[index];
if (item == null) {
out.writeInt(-1);
} else {
out.writeInt(item.getId());
out.writeInt(item.getAmount());
}
}
}
@Override
public void prepare() {
/**
* Here we can initialize values that may possibly be overwritten when loading.
* This is particually useful when loading a couple of values and then the
* rest off the values can be initialized to there default state here. This
* method is called immediately before load().
*/
inventoryItems = new Item[28];
}
}
Once you've made the loading/saving class add it within the source file and make sure that it compiles into the bin directiory. The class can be compiled on its own and then you can manually coppy the compiled .class file into the bin folder. Open up the Run.bat file and add the file name as an argument.
Spoiler for Example:
Code:
@echo off
title Profile Editor
java -Xmx800m -cp bin; ProfileEditor Profile
pause
Where Profile is the name of the class we just made.
Now once you've made the class, added the class name as an argument then you can run and edit your save files.
Now there is a demo class called TestProfile within the source. It is there for an example and it won't load any profiles. There is also another example class called Profile.java and it is a working example. add 'Profile' as the argument and then you can load the 'lolol.dat' file I've included. The Profile class has been coppied directly from my server.
First. This looks really nice, going to check it out and hope to see further development.
There is going to be further development. Any bugs just please post. Its supported by my main server project. So if that needs extra features then I'm going to implement them.
please update to 637 verson or create alternative pl0x would be amazing! i would even be willing to pay for it! add the ability to make players honor or premium , moderator , administrator etc. like i said , i would pay for it dude. hmu and let me know (=
please update to 637 verson or create alternative pl0x would be amazing! i would even be willing to pay for it! add the ability to make players honor or premium , moderator , administrator etc. like i said , i would pay for it dude. hmu and let me know (=
please update to 637 verson or create alternative pl0x would be amazing! i would even be willing to pay for it! add the ability to make players honor or premium , moderator , administrator etc. like i said , i would pay for it dude. hmu and let me know (=
Its not restricted to any revision. As long as you do as I have said within my first post then any revision is possible. It uses reflection and therefore has nothing to do with client versions.