From 962639aa6d58d88fae32159ed4e2c70ec120991e Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 11 Nov 2013 12:59:59 -0600 Subject: Added data structures for Mojang Account. --- logic/auth/MojangAccount.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 logic/auth/MojangAccount.cpp (limited to 'logic/auth/MojangAccount.cpp') diff --git a/logic/auth/MojangAccount.cpp b/logic/auth/MojangAccount.cpp new file mode 100644 index 00000000..f796794e --- /dev/null +++ b/logic/auth/MojangAccount.cpp @@ -0,0 +1,55 @@ +/* Copyright 2013 MultiMC Contributors + * + * Authors: Orochimarufan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MojangAccount.h" + +#include + +MojangAccount::MojangAccount(const QString& username, QObject* parent) : + QObject(parent) +{ + // Generate a client token. + m_clientToken = QUuid::createUuid().toString(); + + m_username = username; +} + +MojangAccount::MojangAccount(const QString& username, const QString& clientToken, + const QString& accessToken, QObject* parent) : + QObject(parent) +{ + m_username = username; + m_clientToken = clientToken; + m_accessToken = accessToken; +} + + +QString MojangAccount::username() const +{ + return m_username; +} + +QString MojangAccount::clientToken() const +{ + return m_clientToken; +} + +QString MojangAccount::accessToken() const +{ + return m_accessToken; +} + -- cgit v1.2.3