Private Server Info and Support Thread

06/08/2016 21:30 HammerTyrs22#2536
Quote:
Originally Posted by S7K Yuuki View Post
Hey there!

Assuming that the rest of the code works properly. The main problem is here...

Code:
public void SendVersionResponse() throws IOException {
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	baos.write(1); // Param 1 |  True or Flase (1 /0)
	baos.write(this.major); // Param 2 (Major)
	baos.write(this.minor); // Param 3 (minor)
	baos.write(this.build); // Param 4 (Build)
	baos.flush();
	byte[] data = baos.toByteArray();
	System.out.println(Arrays.toString(data));
}
When you are using
Code:
baos.write();
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 View Post
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 View Post
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:confused::confused::confused:
06/09/2016 22:47 Requi#2537
Quote:
Originally Posted by olitis1 View Post
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 View Post
hmmm it's not work :/ the client cancel connection to the Server, why ? I have no idea... hmmm:confused::confused::confused:
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.
[Only registered and activated users can see links. Click Here To Register...]
06/09/2016 23:28 HammerTyrs22#2538
thx for the tip :D here ^^
Code:
package net.bigpoint.darkorbit.net.netty.commands
{
   import §_-j2L§.ICommand;
   import flash.utils.IDataInput;
   import flash.utils.IDataOutput;
   import §_-j3I§.§_-q2F§;
   import §_-13y§.§_-gR§;
   
   public class §_-h8§ implements ICommand
   {
      
      public static const ID:int = 667;
       
      public var major:int = 0;
      
      public var minor:int = 0;
      
      public var build:int = 0;
      
      public var §_-p3q§:Boolean = false;
      
      public function §_-h8§(param1:int = 0, param2:int = 87, param3:int = 7, param4:Boolean = false)
      {
         super();
         this.major = param1;
         this.minor = param2;
         this.build = param3;
         this.§_-p3q§ = param4;
      }
      
      public function §_-S4o§() : int
      {
         return ID;
      }
      
      public function §_-i3r§() : int
      {
         return 13;
      }
      
      public function read(param1:IDataInput) : void
      {
         this.major = param1.readInt();
         this.minor = param1.readInt();
         this.build = param1.readInt();
         this.§_-p3q§ = param1.readBoolean();
      }
      
      public function write(param1:IDataOutput) : void
      {
         param1.writeShort(ID);
         this.§_-8z§(param1);
      }
      
      protected function §_-8z§(param1:IDataOutput) : void
      {
         param1.writeInt(this.major);
         param1.writeInt(this.minor);
         param1.writeInt(this.build);
         param1.writeBoolean(this.§_-p3q§);
      }
   }
}
and my Response from Server:
Code:
public void SendVersionResponse(Socket clientSocket) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream os = new DataOutputStream(baos);
        os.writeShort(15);
        os.writeShort(667);
        os.writeInt(this.major);
        os.writeInt(this.minor);
        os.writeInt(this.build);
        os.writeBoolean(true);

        byte[] data = baos.toByteArray();
        clientSocket.getOutputStream().write(data,0, data.length);
        clientSocket.getOutputStream().flush();
        clientSocket.getOutputStream().close();
        System.out.println(Arrays.toString(data));
    }
RESULT:
Code:
[09.06.2016 - 23:31:06][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 87
[0, 15, 2, -101, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 7, 1]
06/10/2016 00:02 Requi#2539
Quote:
Originally Posted by HammerTyrs22 View Post
thx for the tip :D here ^^
Code:
package net.bigpoint.darkorbit.net.netty.commands
{
   import §_-j2L§.ICommand;
   import flash.utils.IDataInput;
   import flash.utils.IDataOutput;
   import §_-j3I§.§_-q2F§;
   import §_-13y§.§_-gR§;
   
   public class §_-h8§ implements ICommand
   {
      
      public static const ID:int = 667;
       
      public var major:int = 0;
      
      public var minor:int = 0;
      
      public var build:int = 0;
      
      public var §_-p3q§:Boolean = false;
      
      public function §_-h8§(param1:int = 0, param2:int = 87, param3:int = 7, param4:Boolean = false)
      {
         super();
         this.major = param1;
         this.minor = param2;
         this.build = param3;
         this.§_-p3q§ = param4;
      }
      
      public function §_-S4o§() : int
      {
         return ID;
      }
      
      public function §_-i3r§() : int
      {
         return 13;
      }
      
      public function read(param1:IDataInput) : void
      {
         this.major = param1.readInt();
         this.minor = param1.readInt();
         this.build = param1.readInt();
         this.§_-p3q§ = param1.readBoolean();
      }
      
      public function write(param1:IDataOutput) : void
      {
         param1.writeShort(ID);
         this.§_-8z§(param1);
      }
      
      protected function §_-8z§(param1:IDataOutput) : void
      {
         param1.writeInt(this.major);
         param1.writeInt(this.minor);
         param1.writeInt(this.build);
         param1.writeBoolean(this.§_-p3q§);
      }
   }
}
and my Response from Server:
Code:
public void SendVersionResponse(Socket clientSocket) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream os = new DataOutputStream(baos);
        os.writeShort(15);
        os.writeShort(667);
        os.writeInt(this.major);
        os.writeInt(this.minor);
        os.writeInt(this.build);
        os.writeBoolean(true);

        byte[] data = baos.toByteArray();
        clientSocket.getOutputStream().write(data,0, data.length);
        clientSocket.getOutputStream().flush();
        clientSocket.getOutputStream().close();
        System.out.println(Arrays.toString(data));
    }
RESULT:
Code:
[09.06.2016 - 23:31:06][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 87
[0, 15, 2, -101, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 7, 1]
Dein DataOutputStream macht irgendwas falsch:
Code:
[0, 15, 2, 155, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 7, 1]
ist wie das bytearray aussehen muss. Ein byte geht von 0-255. Ein byte kann nicht negativ sein.

[Only registered and activated users can see links. Click Here To Register...]
#sweetestPacketParserAndBuilderLife
06/11/2016 20:52 manulaiko3.0#2540
Hi!

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

This is the repository: [Only registered and activated users can see links. Click Here To Register...]

See you!
06/13/2016 11:23 HammerTyrs22#2541
Hey Guys, i have a question ,
how can find the response packet to a Requestpacket ?

I have from the client the Packet ID = 10966 , how is the Response ID ? and Where find this ?
06/13/2016 13:02 S7K Yuuki#2542
Quote:
Originally Posted by HammerTyrs22 View Post
Hey Guys, i have a question ,
how can find the response packet to a Requestpacket ?

I have from the client the Packet ID = 10966 , how is the Response ID ? and Where find this ?
Reverse engineering, there isn't a magic way to get them. Find the command handler and continue from there, most of the times is extremely easy.

Good luck!
Regards.-
06/20/2016 06:05 d5d#2543
someone can give me the source of DarkEmulator v2 whit cms ??
06/20/2016 21:21 ZeusReally#2544
Hi Guys

i how to make extra slot menu ? who help me.

thanks
06/21/2016 11:40 Requi#2545
Quote:
Originally Posted by ZeusReally View Post
Hi Guys

i how to make extra slot menu ? who help me.

thanks
Look how the client initializes and handles slotmenus.
07/09/2016 23:48 YURI-ELIADE.ITALY#2546
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.

best regards YURI-ELIADE.ITALY
07/10/2016 18:44 BlaXi17#2547
When did u planned on releasing it?
07/25/2016 16:30 Nommo#2548
Hello!
I am trying to revive my node.JS DO server project and Im stuck at sending other users ships info.

My packet looks like:
Code:
sock.write('0|C|' + id + '|' + value['shipid'] + '|3|' + value['clantag'] + '|' + value['username'] + '|' + value['x'] + '|' + value['y'] + '|' + value['company'] + '|' + value['clanid'] + '|' + value['rank'] + '|0|' + diplo + '|' + value['galaxygatesdone'] + '\0');
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.

Regards,
Nommo.
07/27/2016 04:29 SultanDP#2549
Hey i'm back <3 Dark Aster will be back too soon <3
07/29/2016 23:06 MuffinMario#2550
Quote:
Originally Posted by Nommo View Post
Hello!
Code:
sock.write('0|C|' + id + '|' + value['shipid'] + '|3|' + value['clantag'] + '|' + value['username'] + '|' + value['x'] + '|' + value['y'] + '|' + value['company'] + '|' + value['clanid'] + '|' + value['rank'] + '|0|' + diplo + '|' + value['galaxygatesdone'] + '\0');
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?