mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Переделано под один мега-проект LMS с общим CMakeLists.txt
This commit is contained in:
114
ServerLMS/Data/Client.h
Normal file
114
ServerLMS/Data/Client.h
Normal file
@@ -0,0 +1,114 @@
|
||||
#ifndef CLIENT_H
|
||||
#define CLIENT_H
|
||||
|
||||
#include <QString>
|
||||
#include <QTcpSocket>
|
||||
#include "typesDataServerClient.h"
|
||||
|
||||
class Client
|
||||
{
|
||||
|
||||
public:
|
||||
Client(QString name, QString address, QString port,QObject *parent = nullptr):
|
||||
login(""),
|
||||
ready(false),
|
||||
TypeClient(TypeClientAutorization::TYPE_SIMPLE)
|
||||
{
|
||||
this->name = name;
|
||||
this->address = address;
|
||||
this->port = port;
|
||||
this->fullName = "Name: " + name + " IP: " + address + " port : " + port + " login: " + login;
|
||||
};
|
||||
~Client();
|
||||
|
||||
public:
|
||||
QString getFullName()
|
||||
{
|
||||
return fullName;
|
||||
};
|
||||
|
||||
void setLogin(QString login)
|
||||
{
|
||||
this->login = login;
|
||||
isLoggedIn = true;
|
||||
fullName = "Name: " + name + " IP: " + address + " port : " + port + " login: " + login;
|
||||
}
|
||||
QString getLogin()
|
||||
{
|
||||
return login;
|
||||
}
|
||||
|
||||
QString getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
QString getPort()
|
||||
{
|
||||
return port;
|
||||
}
|
||||
|
||||
bool getReady()
|
||||
{
|
||||
return ready;
|
||||
}
|
||||
|
||||
void setReady(bool ready)
|
||||
{
|
||||
this->ready = ready;
|
||||
}
|
||||
|
||||
void setUnity(bool flag)
|
||||
{
|
||||
isUnity = flag;
|
||||
}
|
||||
|
||||
bool getIsUnity()
|
||||
{
|
||||
return isUnity;
|
||||
}
|
||||
|
||||
void setTypeClient(TypeClientAutorization TypeClient)
|
||||
{
|
||||
this->TypeClient = TypeClient;
|
||||
}
|
||||
TypeClientAutorization getTypeClient()
|
||||
{
|
||||
return TypeClient;
|
||||
}
|
||||
|
||||
void changePackageResponse()
|
||||
{
|
||||
isUnity = !isUnity;
|
||||
}
|
||||
|
||||
bool operator == (Client* right)
|
||||
{
|
||||
return this->address == right->address;
|
||||
}
|
||||
|
||||
bool getIsLoggedIn()
|
||||
{
|
||||
return isLoggedIn;
|
||||
}
|
||||
|
||||
void setIsLoggedIn(bool value)
|
||||
{
|
||||
isLoggedIn = value;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QString name;
|
||||
QString address;
|
||||
QString port;
|
||||
QString fullName;
|
||||
|
||||
QString login;
|
||||
bool ready;
|
||||
bool isLoggedIn;
|
||||
bool isUnity = false;
|
||||
|
||||
TypeClientAutorization TypeClient;
|
||||
};
|
||||
|
||||
#endif // CLIENT_H
|
||||
Reference in New Issue
Block a user