Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Browsergames > DarkOrbit
You last visited: Today at 07:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Private Server Info and Support Thread

Discussion on Private Server Info and Support Thread within the DarkOrbit forum part of the Browsergames category.

Reply
 
Old 06/08/2016, 21:30   #2536
 
elite*gold: 0
Join Date: Jun 2012
Posts: 54
Received Thanks: 6
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
HammerTyrs22 is offline  
Old 06/09/2016, 22:47   #2537


 
Requi's Avatar
 
elite*gold: 3570
The Black Market: 244/0/0
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
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
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.
Requi is offline  
Old 06/09/2016, 23:28   #2538
 
elite*gold: 0
Join Date: Jun 2012
Posts: 54
Received Thanks: 6
thx for the tip 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]
HammerTyrs22 is offline  
Old 06/10/2016, 00:02   #2539


 
Requi's Avatar
 
elite*gold: 3570
The Black Market: 244/0/0
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
Quote:
Originally Posted by HammerTyrs22 View Post
thx for the tip 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.


#sweetestPacketParserAndBuilderLife
Requi is offline  
Thanks
1 User
Old 06/11/2016, 20:52   #2540
 
manulaiko3.0's Avatar
 
elite*gold: 0
Join Date: May 2014
Posts: 663
Received Thanks: 1,154
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:

See you!
manulaiko3.0 is offline  
Thanks
8 Users
Old 06/13/2016, 11:23   #2541
 
elite*gold: 0
Join Date: Jun 2012
Posts: 54
Received Thanks: 6
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 ?
HammerTyrs22 is offline  
Old 06/13/2016, 13:02   #2542
 
S7K Yuuki's Avatar
 
elite*gold: 0
Join Date: Apr 2015
Posts: 246
Received Thanks: 398
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.-
S7K Yuuki is offline  
Old 06/20/2016, 06:05   #2543
 
elite*gold: 0
Join Date: Apr 2013
Posts: 25
Received Thanks: 8
someone can give me the source of DarkEmulator v2 whit cms ??
d5d is offline  
Old 06/20/2016, 21:21   #2544
 
ZeusReally's Avatar
 
elite*gold: 0
Join Date: May 2015
Posts: 116
Received Thanks: 37
Hi Guys

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

thanks
ZeusReally is offline  
Thanks
1 User
Old 06/21/2016, 11:40   #2545


 
Requi's Avatar
 
elite*gold: 3570
The Black Market: 244/0/0
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
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.
Requi is offline  
Old 07/09/2016, 23:48   #2546
 
YURI-ELIADE.ITALY's Avatar
 
elite*gold: 15
Join Date: Feb 2014
Posts: 313
Received Thanks: 78
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
YURI-ELIADE.ITALY is offline  
Old 07/10/2016, 18:44   #2547
 
elite*gold: 0
Join Date: Jul 2016
Posts: 3
Received Thanks: 0
When did u planned on releasing it?
BlaXi17 is offline  
Old 07/25/2016, 16:30   #2548
 
elite*gold: 7
Join Date: Dec 2008
Posts: 727
Received Thanks: 119
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.
Nommo is offline  
Old 07/27/2016, 04:29   #2549
 
elite*gold: 0
Join Date: Oct 2014
Posts: 53
Received Thanks: 11
Hey i'm back <3 Dark Aster will be back too soon <3
SultanDP is offline  
Old 07/29/2016, 23:06   #2550
 
MuffinMario's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 896
Received Thanks: 558
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?
MuffinMario is offline  
Thanks
1 User
Reply

Tags
2018, darkorbit, emulator, private, server


Similar Threads Similar Threads
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.



All times are GMT +1. The time now is 07:03.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.