mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
173 lines
3.1 KiB
C++
173 lines
3.1 KiB
C++
#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_QT_CLIENT)
|
|
{
|
|
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(TypeClientAutorization type)
|
|
{
|
|
typeClient = type;
|
|
}
|
|
|
|
TypeClientAutorization getClientType()
|
|
{
|
|
return typeClient;
|
|
}
|
|
|
|
void setTypeClient(TypeClientAutorization TypeClient)
|
|
{
|
|
this->typeClient = TypeClient;
|
|
}
|
|
TypeClientAutorization getTypeClient()
|
|
{
|
|
return typeClient;
|
|
}
|
|
|
|
void changePackageResponse()
|
|
{
|
|
if (typeClient == TypeClientAutorization::TYPE_QT_CLIENT)
|
|
typeClient = TypeClientAutorization::TYPE_UNITY_CLIENT;
|
|
else if (typeClient == TypeClientAutorization::TYPE_UNITY_CLIENT)
|
|
typeClient = TypeClientAutorization::TYPE_QT_CLIENT;
|
|
}
|
|
|
|
bool operator == (Client* right)
|
|
{
|
|
return this->address == right->address;
|
|
}
|
|
|
|
bool getIsLoggedIn()
|
|
{
|
|
return isLoggedIn;
|
|
}
|
|
|
|
void setIsLoggedIn(bool value)
|
|
{
|
|
isLoggedIn = value;
|
|
}
|
|
|
|
void setAccessType(UserType type)
|
|
{
|
|
userType = type;
|
|
}
|
|
UserType getAccessType()
|
|
{
|
|
return userType;
|
|
}
|
|
|
|
QString getId()
|
|
{
|
|
return id;
|
|
}
|
|
|
|
void setId(QString value)
|
|
{
|
|
id = value;
|
|
}
|
|
|
|
QByteArray getClientHash()
|
|
{
|
|
return clientHash;
|
|
}
|
|
void setClientHash(const QByteArray &value)
|
|
{
|
|
clientHash = value;
|
|
}
|
|
|
|
QList<FileData> getFileSendList() const
|
|
{
|
|
return fileSendList;
|
|
}
|
|
|
|
void setFileSendList(const QList<FileData> &value)
|
|
{
|
|
fileSendList = value;
|
|
}
|
|
|
|
QList<FileData> getFileDeleteList() const
|
|
{
|
|
return fileDeleteList;
|
|
}
|
|
|
|
void setFileDeleteList(const QList<FileData> &value)
|
|
{
|
|
fileDeleteList = value;
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
QString name;
|
|
QString address;
|
|
QString port;
|
|
QString fullName;
|
|
QString id;
|
|
|
|
QString login;
|
|
bool ready;
|
|
bool isLoggedIn;
|
|
|
|
TypeClientAutorization typeClient;
|
|
UserType userType;
|
|
QByteArray clientHash;
|
|
QList<FileData> fileSendList;
|
|
QList<FileData> fileDeleteList;
|
|
};
|
|
|
|
#endif // CLIENT_H
|
|
|
|
|