Set return value based on server's response

This commit is contained in:
Tristan B. Kildaire 2020-09-27 23:01:51 +02:00
parent 27460ccbc2
commit 538607fa56
1 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,7 @@ public class DClient
* @param message the message to send
* @returns bool whether the send worked or not
*/
public void sendMessage(bool isUser, string location, string message)
public bool sendMessage(bool isUser, string location, string message)
{
/* The protocol data to send */
byte[] protocolData;
@ -118,6 +118,11 @@ public class DClient
/* Send the protocol data */
manager.sendMessage(1, protocolData);
/* Receive the server's response */
byte[] resp = manager.receiveMessage(1);
return cast(bool)resp[0];
}
public void disconnect()