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
Packet
So if you write as example "ship 98", you need to check, if the packetHeader Contains ship. As every packet
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:
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.
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.
And at the end, we have at the packetReader in the Users.cs this code at the end for one simply CLI Command:
Regards,
Requi
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...
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"))
You can easily read types.
So:
Code:
if (packetHeader.StartsWith("ship"))
{
this.Ship.ID = packetHeader.ReadUInt32();
}
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(' ');
}
But you don't want to relog?
Send the RDY packet again.
Code:
private void updateShip()
{
INSERT HERE THE RDY PACKET FROM START
}
Code:
if (packetHeader.StartsWith("ship"))
{
this.Ship.ID = packetHeader.ReadUInt32();
this.updateShip();
}
Requi