set username instead of UUID in Interface preferences

This commit is contained in:
Stephen Birarda 2013-10-07 13:35:16 -07:00
parent f36fd47ef7
commit e9e77d8276
4 changed files with 9 additions and 12 deletions

View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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; }