Implemented `getProprties` command

This commit is contained in:
Tristan B. Kildaire 2020-10-20 09:41:49 +02:00
parent b8f16ebba2
commit ba72ba2dbf
1 changed files with 32 additions and 0 deletions

View File

@ -191,6 +191,38 @@ public final class DClient
}
/**
* Lists all properties of the given user
*/
public string[] getProperties(string user)
{
/* The protocol data to send */
byte[] data = [15];
data ~= user;
/* Send the protocol data */
DataMessage protocolData = new DataMessage(reqRepQueue.getTag(), data);
bSendMessage(socket, protocolData.encode());
/* Receive the server's response */
byte[] resp = reqRepQueue.dequeue().getData();
/* Received list of properties */
string[] properties;
/* If it worked */
if(cast(bool)resp[0])
{
/* Get the property line */
string propertyLine = cast(string)resp[1..resp.length];
properties = split(propertyLine, ",");
}
return properties;
}
/**
* Lists all the channels on the server
*