Your own CLI Commands in Azure (Private Server)

08/02/2013 02:08 Requi#1
Welcome to a little tutorial, how to add your own CLI Commands in Azure or another private server.
Let' start.

If you write something in to the CLI, the client send this to the server.
Not as a stupid
Code:
A|0|BRB...
Packet

So if you write as example "ship 98", you need to check, if the packetHeader Contains ship. As every packet

Code:
if (packetHeader.StartsWith("ship"))
Then you need to get the ID of the ship. Xdr implented a nice function into the packets.cs
You can easily read types.
So:
Code:
if (packetHeader.StartsWith("ship"))
{
this.Ship.ID = packetHeader.ReadUInt32();
}
As the packets.cs only split at a |, you actually need to write a split function for the " " (Space).

Open the packets.cs and edit one of the first lines, where the | get splitted.
Code:
if (packet.Contains("|"))
{
packetData = packet.Split('|');
}
else //for the spacebar
{
packetData = packet.Split(' ');
}
So, if you write now at the CLI: "ship 98", you need the relog and you have the ship.

But you don't want to relog?
Send the RDY packet again.

Code:
private void updateShip()
{
INSERT HERE THE RDY PACKET FROM START
}
And at the end, we have at the packetReader in the Users.cs this code at the end for one simply CLI Command:
Code:
if (packetHeader.StartsWith("ship"))
{
this.Ship.ID = packetHeader.ReadUInt32();
this.updateShip();
}
Regards,
Requi
08/02/2013 02:10 DrSkyfall™#2
Nice tutorial xD,

I got it before everyone else :o.

Thanks for this useful thread.
08/02/2013 02:20 Peshо#3
Nice one, but why don't you put all tutorials into 1 thread? :o
08/02/2013 08:51 KratonVsPande#4
nice requi ;) is not that hard to understand even for a beginner like me :P thx ^_^
08/02/2013 09:15 arvatadryan#5
Nice tutorial
08/02/2013 13:31 Sήøwy#6
Again guys you feed the noobs :D
08/02/2013 15:17 »Barney«#7
Quote:
Originally Posted by asd26 View Post
Again guys you feed the noobs :D
Someone has to help them, we need programmers here in epvp to make DO better ;)
08/02/2013 17:29 Sήøwy#8
I'm happy to hear that haha...yeah..but i don't care anymore about darkorbit too many idiots at support.
08/03/2013 17:42 Requi#9
If you have any suggestions for tutorials, just tell me.
12/31/2014 04:23 MS-Colder#10
i need my tchat system on