PICloud change protocol > server_uuid

This commit is contained in:
2021-04-12 11:35:34 +03:00
parent f75ce1e8e0
commit dbd2267a8c
12 changed files with 56 additions and 33 deletions

View File

@@ -1,8 +1,8 @@
#include "cloudserver.h"
CloudServer::CloudServer(DispatcherClient * c, const PIString & sname) : server(c) {
setName(sname);
server_name = sname;
CloudServer::CloudServer(DispatcherClient * c, const PIByteArray & sname) : server(c) {
setName(sname.toHex());
server_uuid = sname;
CONNECTL(c, dataReadedServer, ([this](uint id, PIByteArray & ba){
DispatcherClient * cl = index_clients.value(id, nullptr);
if (cl) cl->sendData(ba);
@@ -17,8 +17,8 @@ CloudServer::~CloudServer() {
}
PIString CloudServer::serverName() const {
return server_name;
PIByteArray CloudServer::serverUUID() const {
return server_uuid;
}
@@ -49,7 +49,7 @@ PIVector<DispatcherClient *> CloudServer::getClients() {
void CloudServer::printStatus() {
piCout << " " << "Clients for" << server->address() << server_name << ":";
piCout << " " << "Clients for" << server->address() << server_uuid.toHex() << ":";
for (auto c: clients) {
piCout << " " << c->address() << c->clientId();
}