Private Server Info and Support Thread

06/01/2016 21:02 LEJYONER(DS)#2521
cryz35, 1 yıldır yokum bro 1 konu hakkında yardımcı olabilicen mi?

Hello, I 'm working on 9.0 emulator, I want to do x and y position according to the database. What should I use instead of the DEFAULT_INC_VALUE?

Code:
package simulator.map_entities;

import simulator.utils.DefaultAssignings;

public class MapEntityPosition
        implements DefaultAssignings {

    // position on map
    protected int mCurrentPositionX = DEFAULT_INC_VALUE;
    protected int mCurrentPositionY = DEFAULT_INC_VALUE;

    public int getCurrentPositionX() {
        return this.mCurrentPositionX;
    }

    protected void setCurrentPositionX(final int pPositionX) {
        this.mCurrentPositionX = pPositionX;
    }

    public int getCurrentPositionY() {
        return this.mCurrentPositionY;
    }

    protected void setCurrentPositionY(final int pPositionY) {
        this.mCurrentPositionY = pPositionY;
    }

    public void setPositionXY(final int pPositionX, final int pPositionY) {
        this.setCurrentPositionX(pPositionX);
        this.setCurrentPositionY(pPositionY);
    }

}
06/01/2016 22:36 ItsTequila#2522
Quote:
Originally Posted by cryz35 View Post
[Only registered and activated users can see links. Click Here To Register...]

Any idea why Spaceplauge and Assembly(crafting) thing are missing titles?
You're missing the resource xmls / language files(not /xml/ folder). I remember to they are located in spacemap folder but under a different server. Use charles and see what's requested when you login to DO.
06/04/2016 11:55 0wnix#2523
Wow lol, just seen this :

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Funny to see that DarkOrbit is taking inspiration from my CMS ehe :D

Maybe one day, pservers devs & darkorbit devs will come to an agreement ? :rolleyes:

06/04/2016 12:03 Destiny#2524
Quote:
Originally Posted by player.elite View Post
Wow lol, just seen this :

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Funny to see that DarkOrbit is taking inspiration from my CMS ehe :D

Maybe one day, pservers devs & darkorbit devs will come to an agreement ? :rolleyes:

hehe its like your :D
06/06/2016 19:38 Chirdo#2525
hey i need p server files i just want it for making 1 vs 1 :D
06/07/2016 18:04 45the45#2526
Quote:
Originally Posted by Chirdo View Post
hey i need p server files i just want it for making 1 vs 1 :D
Download some private server from the start of this thread
06/07/2016 18:11 Chirdo#2527
Quote:
Originally Posted by 45the45 View Post
Download some private server from the start of this thread
The Download links dont work
06/07/2016 23:56 LilYoung#2528
Hey, haven't thought about playin on a P-Server yet so I never checked this thread.

Is there a server with none to little lags, PvP only and up to date?
06/08/2016 10:19 HammerTyrs22#2529
Hello Friends :D

I have a Problem, i can read the first packet (666), we can make the Version Response

AS3 CODE FROM CLIENT(version 10.0.4246):

Code:
public function §_-F27§(param1:Boolean, param2:int, param3:int, param4:int) : void
      {
         var _loc5_:* = null;
         if(param1)
         {
            _loc5_ = new §_-52j§();
            if(_loc5_.major == param2 && _loc5_.minor == param3 && _loc5_.build == param4)
            {
               this.§_-oz§();
               this.§_-n3O§();
            }
            else
            {
               this.§_-mb§();
            }
         }
         else
         {
            this.§_-mb§();
         }
      }

public function handleVersionResponce(param1:Boolean, param2:int, param3:int, param4:int) : void
      {
         this.connectionManager.§_-F27§(param1,param2,param3,param4);
      }
READ:

Code:
public void run() {
        try {
            DataInputStream in = new DataInputStream(clientSocket.getInputStream());
            byte[] buffer = new byte[8192];    //If you handle larger data use a bigger buffer size
            int length = in.readShort();
            if (length > 0)
            {
                byte[] byteArray = new byte[length];
                in.read(byteArray, 0, length);
                ByteArrayInputStream packetBAIS = new ByteArrayInputStream(byteArray, 0, byteArray.length);
                DataInputStream packet = new DataInputStream(packetBAIS);
                int id = packet.readShort();
                switch (id)
                {
                    case 666:
                        LOG.INFO(this.serverName, "VERSION REQUEST");
                        VersionRequest vr = new VersionRequest();
                        vr.read(packet);
                        System.out.println("[IN] PacketID: "+ ID + " MAJOR: " +vr.major+ " BUILD: "+vr.build+" MINOR: "+vr.minor);
                        vr.SendVersionResponse();
                        break;
                    default:
                        LOG.INFO(this.serverName, "REQUEST-NOT FUND: " + id);
                        break;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

my try (don't work):
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));
    }
Result:

Code:
[08.06.2016 - 10:20:55][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 86
[1, 0, 86, 7] <---- Array from SendVersionResponse()
can you help me ?
06/08/2016 12:39 S7K Yuuki#2530
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.-
06/08/2016 13:45 HammerTyrs22#2531
Thanks S7K Yuuki , this way :
Code:
public void SendVersionResponse(Socket clientSocket) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream os = new DataOutputStream(baos);
        os.writeShort(15);
        os.writeShort(667);
        os.writeBoolean(true);
        os.writeInt(this.major);
        os.writeInt(this.minor);
        os.writeInt(this.build);

        byte[] data = baos.toByteArray();
        clientSocket.getOutputStream().write(data,0, data.length);
        clientSocket.getOutputStream().flush();
        System.out.println(Arrays.toString(data));
    }
RESULT:
Code:
[08.06.2016 - 13:41:32][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 86
[0, 15, 2, -101, 1, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 7]
i have the Problem , i connect to the Server , the server send this packet and the client
cancel connection to the Server, why ?
06/08/2016 14:53 Requi#2532
Quote:
Originally Posted by HammerTyrs22 View Post
Thanks S7K Yuuki , this way :
Code:
public void SendVersionResponse(Socket clientSocket) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream os = new DataOutputStream(baos);
        os.writeShort(15);
        os.writeShort(667);
        os.writeBoolean(true);
        os.writeInt(this.major);
        os.writeInt(this.minor);
        os.writeInt(this.build);

        byte[] data = baos.toByteArray();
        clientSocket.getOutputStream().write(data,0, data.length);
        clientSocket.getOutputStream().flush();
        System.out.println(Arrays.toString(data));
    }
RESULT:
Code:
[08.06.2016 - 13:41:32][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 86
[0, 15, 2, -101, 1, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 7]
i have the Problem , i connect to the Server , the server send this packet and the client
cancel connection to the Server, why ?
Either the order of the packet is wrong or you sent false for the boolean.
Order of packets change each version.

Or your packet is not netty encoded (didn't look at the code).

Find the command of the VersionResponse in your decompiled files by searching for "667".

Look for the "read(data:DataInput)" and look at the order it's getting read. You have to write in the same order.
06/08/2016 15:29 S7K Yuuki#2533
Quote:
Originally Posted by HammerTyrs22 View Post

[08.06.2016 - 13:41:32][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 86
[0, 15, 2, -101, 1, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 7]
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.-
06/08/2016 18:02 HammerTyrs22#2534
AS3 Code for paket 667:
Code:
package net.bigpoint.darkorbit.net.netty.commands
{
   import §_-N3c§.ICommand;
   import net.bigpoint.darkorbit.map.model.ship.§_-X1E§;
   import §_-R24§.§_-B4Z§;
   import §_-h3g§.§_-u4a§;
   import net.bigpoint.darkorbit.§_-t8§;
   import flash.utils.IDataInput;
   import flash.utils.IDataOutput;
   
   public class §_-l3C§ implements ICommand
   {
      
      public static const ID:int = 667;
      
      {
         var _loc1_:Boolean = false;
         var _loc2_:Boolean = true;
         if(!_loc2_)
         {
         }
      }
      
      public var major:int = 0;
      
      public var minor:int = 0;
      
      public var build:int = 0;
      
      public var §_-l1H§:Boolean = false;
      
      public function §_-l3C§(param1:int = 0, param2:int = 87, param3:int = 7, param4:Boolean = false)
      {
         var _loc6_:Boolean = false;
         if(_loc5_)
         {
            super();
            if(!_loc6_)
            {
               if(!_loc5_)
               {
                  addr37:
                  while(true)
                  {
                     this.build = param3;
                     if(_loc5_)
                     {
                        if(!_loc6_)
                        {
                           if(!_loc6_)
                           {
                           }
                           this.§_-l1H§ = param4;
                        }
                     }
                  }
               }
               addr82:
               while(true)
               {
                  this.major = param1;
                  if(_loc5_)
                  {
                     if(_loc5_)
                     {
                     }
                     this.minor = param2;
                  }
               }
            }
            while(true)
            {
               if(_loc6_)
               {
                  break;
               }
               §§goto(addr37);
            }
            return;
         }
         while(true)
         {
            if(!_loc5_)
            {
               §§goto(addr82);
            }
            §§goto(addr122);
         }
      }
      
      public function §_-m4Q§() : int
      {
         var _loc1_:Boolean = true;
         var _loc2_:Boolean = false;
         return ID;
      }
      
      public function §_-z5§() : int
      {
         var _loc1_:Boolean = false;
         var _loc2_:Boolean = true;
         §§push(13);
         if(!_loc2_)
         {
            return -§§pop() + 58 + 1;
         }
      }
      
      public function read(param1:IDataInput) : void
      {
         if(_loc3_)
         {
            this.major = param1.readInt();
            if(_loc3_)
            {
               if(_loc2_)
               {
                  addr40:
                  while(true)
                  {
                     this.§_-l1H§ = param1.readBoolean();
                     if(_loc3_)
                     {
                        if(!_loc2_)
                        {
                        }
                        break;
                     }
                  }
                  return;
               }
               while(true)
               {
                  this.minor = param1.readInt();
                  if(!_loc3_)
                  {
                  }
               }
            }
            while(true)
            {
               if(!_loc2_)
               {
               }
               this.build = param1.readInt();
            }
         }
         while(true)
         {
            if(!_loc2_)
            {
               §§goto(addr40);
            }
            §§goto(addr112);
         }
      }
      
      public function write(param1:IDataOutput) : void
      {
         var _loc2_:Boolean = true;
         var _loc3_:Boolean = false;
         if(!_loc3_)
         {
            param1.writeShort(ID);
            if(_loc3_)
            {
            }
            addr29:
            return;
         }
         this.§_-435§(param1);
         §§goto(addr29);
      }
      
      protected function §_-435§(param1:IDataOutput) : void
      {
         if(!_loc3_)
         {
            param1.writeInt(this.major);
            if(!_loc3_)
            {
               if(_loc3_)
               {
                  loop0:
                  while(true)
                  {
                     param1.writeBoolean(this.§_-l1H§);
                     if(!_loc3_)
                     {
                        if(_loc3_)
                        {
                        }
                     }
                     addr98:
                     while(true)
                     {
                        if(!_loc2_)
                        {
                           break loop0;
                        }
                        continue loop0;
                     }
                  }
                  return;
               }
               addr69:
               while(true)
               {
                  param1.writeInt(this.minor);
               }
            }
            while(_loc3_)
            {
               §§goto(addr69);
            }
            §§goto(addr109);
         }
         while(true)
         {
            if(!_loc3_)
            {
            }
            param1.writeInt(this.build);
            §§goto(addr98);
         }
      }
   }
}
and the server send the Command :
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.writeBoolean(true);
        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();
        System.out.println(Arrays.toString(data));
    }
RESULT:
Code:
[08.06.2016 - 18:01:15][GAMESERVER][INFO]: VERSION REQUEST
[IN] PacketID: 666 MAJOR: 0 BUILD: 7 MINOR: 86
[0, 15, 2, -101, 0, 0, 0, 0, 1, 0, 0, 0, 86, 0, 0, 0, 7]
the order is the same or not ?
06/08/2016 20:39 olitis1#2535
Quote:
Originally Posted by HammerTyrs22 View Post
the order is the same or not ?
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. // "