you are writing bytes directly to the byte array instead of the real int, short, bool, whatever.
For example, major, minor and build must be integers (1 int == 4 bytes) instead of using 4 bytes for that variable you're using only 1.
Also you're missing the whole packet structure which is:
Code:
2 bytes => packet length
2 bytes => packet ID
*VARIABLE FOR EACH PACKET*
Then you've to take a look into the packet class (the 'answer' of VersionRequest has ID 667). If I'm not wrong the correct structure for that one was:
Code:
2 bytes => length
2 bytes => packet ID (667)
4 bytes => major
4 bytes => minor
4 bytes => build
1 byte => that boolean
Try using DataOutputStream (example):
Code:
public void SendVersionResponse() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream os = new DataOutputStream(baos);
os.writeShort(15); // If my awesome maths aren't wrong 2+4+4+4+1=15 (Packet Length)
os.writeShort(667); // Packet ID
os.writeInt(this.major); // Param 1 (Major)
os.writeInt(this.minor); // Param 2 (minor)
os.writeInt(this.build); // Param 3 (Build)
os.writeBool(true); // Param 4 | True or Flase (1/0)
byte[] data = baos.toByteArray();
YOURSOCKETOBJECT.getOutputStream().write(data, 0, data.length);
YOURSOCKETOBJECT.getOutputStream().flush();
System.out.println(Arrays.toString(data));
}
Hope it helps!
Regards.-
Quote:
Originally Posted by S7K Yuuki
The boolean was set to true, which is correct.
But as Requi said, I bet the problem is on the param order. As I wrote in the example I think the bool was the last param instead of the first one. I can't remember the packet structure right now and I'm 3lazy to decompile main now.
Regards.-
Quote:
Originally Posted by olitis1
The byte array you should send is:
1. (short) Lenght of the byte array.
2. (short) ID of the packet. // In your case, 667
And now starts the reading of the variables of that packet:
3. (int) Major. // Should be the same one that client sends you in packet 666.
4. (bool) Server agrees that version. // Should be true.
5. (int) Minor. // Should be the same one that client sends you in packet 666.
6. (int) Build. // "
hmmm it's not work :/ the client cancel connection to the Server, why ? I have no idea... hmmm
The byte array you should send is:
1. (short) Lenght of the byte array.
2. (short) ID of the packet. // In your case, 667
And now starts the reading of the variables of that packet:
3. (int) Major. // Should be the same one that client sends you in packet 666.
4. (bool) Server agrees that version. // Should be true.
5. (int) Minor. // Should be the same one that client sends you in packet 666.
6. (int) Build. // "
The order of the parameters can change.
Quote:
Originally Posted by HammerTyrs22
hmmm it's not work :/ the client cancel connection to the Server, why ? I have no idea... hmmm
Kannst mir mal einen gefallen tun und den Code Deobfuscator mit rüber jagen lassen wenn du schon jpexs nutzt. Dann kann man den code um einiges besser lesen.
I've decided to start (or continue) a private server. It will be hosted on github so everyone on this section can take a look and contribute (I'll be accepting pull requests).
It will have 2009 client and a custom CMS design.
If you want to contribute:
The CMS is on branch cms
The emulator is on branch emulator
The database is on branch master
Read README.md on branch master for more info
If readme files aren't enough you can find me on the discord server or through my skype
hello I'm back here as long as I showed in the forum, I hope you are all right :-)
I'm working on my private server project that does not release any training for two years now working there alone quietly (do not try it sun aide).
or changed many things new new new maps laser companies, many events alien ships, items that will be programmed automatically during the week.
(They will design new iris)
There will be many beautiful things I brought to the emulator version 6.5.0.0 with automatic restart every 15 hours.
I am now working on java and flash player version 4.9.3.
Ofc all datas from Object are correct..
It shows red square insted of ship. TAG/Name/Rank/GG etc. works perfectly. Maybe theres some kind of files problem? It is based on 2008 client.
compared it to my text file
0|C|UserID|ShipID|laserLook|Clanname|Username|posX |posY|company|clanID|ranking|showRedSquareOnMinima p|clanstatus|galaxy gates|usebigfont
apparently there must be something wrong in the object value otherwise it should be right.
Or try to add a |0 after the galaxygates, i'm not sure if we are using the same version.
if not, try to use this as an example string
Code:
0|C|20|4|1||-=[ NO USERNAME ]=-|4946|185|1|1|15|1|1|2|1
I dont know your program, but do you need that null terminator at the end?
Private private server :P READ FOR MORE INFO 12/01/2010 - SRO Private Server - 12 Replies hey guys im wondering if there is anyway to make a real private server like ZSZC or SWSRO or MYSRO but to where i can only play and level a character and as if it was a real private server. but just for me, not like an emulator where im already lvl 90 or 120 or whatever. i mean one where i set the rates and i level. if not then ok u can close this. but i was just wondering.