mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 22:45:17 +02:00
set username instead of UUID in Interface preferences
This commit is contained in:
parent
f36fd47ef7
commit
e9e77d8276
4 changed files with 9 additions and 12 deletions
|
@ -52,11 +52,11 @@ void DataServerClient::putValueForKey(const char* key, const char* value) {
|
|||
void DataServerClient::getValueForKeyAndUUID(const char* key, QUuid &uuid) {
|
||||
if (!uuid.isNull()) {
|
||||
QString uuidString = uuidStringWithoutCurlyBraces(uuid);
|
||||
getValueforKeyAndUserString(key, uuidString);
|
||||
getValueForKeyAndUserString(key, uuidString);
|
||||
}
|
||||
}
|
||||
|
||||
void DataServerClient::getValueforKeyAndUserString(const char* key, QString& userString) {
|
||||
void DataServerClient::getValueForKeyAndUserString(const char* key, QString& userString) {
|
||||
unsigned char getPacket[MAX_PACKET_SIZE];
|
||||
|
||||
// setup the header for this packet
|
||||
|
|
|
@ -17,12 +17,12 @@ class DataServerClient {
|
|||
public:
|
||||
static void putValueForKey(const char* key, const char* value);
|
||||
static void getValueForKeyAndUUID(const char* key, QUuid& uuid);
|
||||
static void getValueforKeyAndUserString(const char* key, QString& userString);
|
||||
static void getValueForKeyAndUserString(const char* key, QString& userString);
|
||||
static void getClientValueForKey(const char* key) { getValueForKeyAndUserString(key, _clientUsername); }
|
||||
static void processConfirmFromDataServer(unsigned char* packetData, int numPacketBytes);
|
||||
static void processGetFromDataServer(unsigned char* packetData, int numPacketBytes);
|
||||
|
||||
static void setClientUsername(QString& clientUsername) { _clientUsername = clientUsername; }
|
||||
static void setClientUsername(const QString& clientUsername) { _clientUsername = clientUsername; }
|
||||
static QString& setClientUsername() { return _clientUsername; }
|
||||
private:
|
||||
static QString _clientUsername;
|
||||
|
|
|
@ -72,13 +72,10 @@ void MyAvatar::setMoveTarget(const glm::vec3 moveTarget) {
|
|||
_moveTargetStepCounter = 0;
|
||||
}
|
||||
|
||||
void MyAvatar::setUUID(const QUuid& uuid) {
|
||||
_uuid = uuid;
|
||||
void MyAvatar::setUsername(const QString& username) {
|
||||
_username = username;
|
||||
|
||||
qDebug() << "giving" << _uuid << "to DSC class.\n";
|
||||
|
||||
// give this UUID to the DataServerClient class as our client UUID
|
||||
DataServerClient::setClientUUID(_uuid);
|
||||
DataServerClient::setClientUsername(username);
|
||||
}
|
||||
|
||||
void MyAvatar::simulate(float deltaTime, Transmitter* transmitter) {
|
||||
|
@ -560,7 +557,7 @@ void MyAvatar::saveData(QSettings* settings) {
|
|||
void MyAvatar::loadData(QSettings* settings) {
|
||||
settings->beginGroup("Avatar");
|
||||
|
||||
setUUID(settings->value("Usernmame").toString();
|
||||
setUsername(settings->value("Username").toString());
|
||||
|
||||
// in case settings is corrupt or missing loadSetting() will check for NaN
|
||||
_bodyYaw = loadSetting(settings, "bodyYaw", 0.0f);
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
void setNewScale(const float scale);
|
||||
void setWantCollisionsOn(bool wantCollisionsOn) { _isCollisionsOn = wantCollisionsOn; }
|
||||
void setMoveTarget(const glm::vec3 moveTarget);
|
||||
void setUsername(const QString& username) { _username = username; }
|
||||
void setUsername(const QString& username);
|
||||
|
||||
// getters
|
||||
float getNewScale() const { return _newScale; }
|
||||
|
|
Loading…
Reference in a new issue