mirror of
https://github.com/QuasarApp/Hanoi-Towers.git
synced 2025-05-12 17:39:33 +00:00
added world
This commit is contained in:
parent
2ee55e8b6e
commit
e56e34cfcc
@ -436,7 +436,15 @@ void BackEnd::setOnlineStatus(QH::ClientStatus onlineStatus) {
|
||||
return;
|
||||
|
||||
if (_profile.isOnline() && onlineStatus == QH::ClientStatus::Connected) {
|
||||
_client->login(DataConverter::toUserMember(_profile));
|
||||
if (!_client->login(DataConverter::toUserMember(_profile))) {
|
||||
QuasarAppUtils::Params::log("Fail to login.", QuasarAppUtils::Error);
|
||||
}
|
||||
}
|
||||
|
||||
if (_profile.isOnline() && onlineStatus == QH::ClientStatus::Logined) {
|
||||
if (!_client->subscribeToWorld()) {
|
||||
QuasarAppUtils::Params::log("Fail to subscribe to world.", QuasarAppUtils::Error);
|
||||
}
|
||||
}
|
||||
|
||||
_onlineStatus = static_cast<OnlineStatus>(onlineStatus);
|
||||
|
@ -41,7 +41,7 @@ HanoiClient::HanoiClient() {
|
||||
registerPackageType<World>();
|
||||
registerPackageType<WorldUpdate>();
|
||||
|
||||
_world = nullptr;
|
||||
_world = QSharedPointer<World>::create();
|
||||
}
|
||||
|
||||
HanoiClient::~HanoiClient() {
|
||||
@ -213,6 +213,10 @@ bool HanoiClient::setNewAvatar(const QString &userId, const QByteArray &image) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HanoiClient::subscribeToWorld() {
|
||||
return subscribe(_world->subscribeId());
|
||||
}
|
||||
|
||||
bool HanoiClient::addProfile(const LocalUser& user) {
|
||||
|
||||
if (!db())
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
QList<UserPreview> localUsersPreview();
|
||||
|
||||
bool setNewAvatar(const QString &userId, const QByteArray& image);
|
||||
bool subscribeToWorld();
|
||||
\
|
||||
|
||||
protected:
|
||||
|
@ -181,17 +181,17 @@
|
||||
<context>
|
||||
<name>HanoiClient</name>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>Local user has been updated</source>
|
||||
<translation>Local user has been updated</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>local user accept nbew data from the server.</source>
|
||||
<translation>Local user accept new data from the server.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="122"/>
|
||||
<location filename="../hanoiclient.cpp" line="132"/>
|
||||
<source>Internal Error, server send invalid data, and this data can't be saved into local database.</source>
|
||||
<translation>Internal Error, server send invalid data, and this data can't be saved into local database.</translation>
|
||||
</message>
|
||||
|
@ -192,17 +192,17 @@
|
||||
<context>
|
||||
<name>HanoiClient</name>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>Local user has been updated</source>
|
||||
<translation>ローカルユーザーが更新されました</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>local user accept nbew data from the server.</source>
|
||||
<translation>ローカルユーザはサーバからNBEWデータを受け入れます。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="122"/>
|
||||
<location filename="../hanoiclient.cpp" line="132"/>
|
||||
<source>Internal Error, server send invalid data, and this data can't be saved into local database.</source>
|
||||
<translation>内部エラー、サーバーが無効なデータを送信し、このデータをローカルデータベースに保存することはできません。</translation>
|
||||
</message>
|
||||
|
@ -192,17 +192,17 @@
|
||||
<context>
|
||||
<name>HanoiClient</name>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>Local user has been updated</source>
|
||||
<translation>Локальный пользователь обновлён</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>local user accept nbew data from the server.</source>
|
||||
<translation>Локальный пользователь принял новые данные с сервера.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="122"/>
|
||||
<location filename="../hanoiclient.cpp" line="132"/>
|
||||
<source>Internal Error, server send invalid data, and this data can't be saved into local database.</source>
|
||||
<translation>Внутренняя ошибка, сервер отправил неверные данные, и эти данные не могут быть сохранены в локальной базе данных.</translation>
|
||||
</message>
|
||||
|
@ -193,17 +193,17 @@ Bu seviye için minimum adımlar: %2</translation>
|
||||
<context>
|
||||
<name>HanoiClient</name>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>Local user has been updated</source>
|
||||
<translation>Yerel kullanıcı güncellendi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>local user accept nbew data from the server.</source>
|
||||
<translation>yerel kullanıcı sunucudan yeni verileri kabul eder.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="122"/>
|
||||
<location filename="../hanoiclient.cpp" line="132"/>
|
||||
<source>Internal Error, server send invalid data, and this data can't be saved into local database.</source>
|
||||
<translation>Dahili Hata, sunucu geçersiz veri gönderdi ve bu veriler yerel veritabanına kaydedilemez.</translation>
|
||||
</message>
|
||||
|
@ -193,17 +193,17 @@
|
||||
<context>
|
||||
<name>HanoiClient</name>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>Local user has been updated</source>
|
||||
<translation>Локальний користувач був оновлений</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="65"/>
|
||||
<location filename="../hanoiclient.cpp" line="70"/>
|
||||
<source>local user accept nbew data from the server.</source>
|
||||
<translation>локальний користувач приймає нові дані з сервера.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../hanoiclient.cpp" line="122"/>
|
||||
<location filename="../hanoiclient.cpp" line="132"/>
|
||||
<source>Internal Error, server send invalid data, and this data can't be saved into local database.</source>
|
||||
<translation>Внутрішня помилка, сервер надсилає недійсні дані, і ці дані не можна зберегти в локальній базі даних.</translation>
|
||||
</message>
|
||||
|
2
Heart
2
Heart
@ -1 +1 @@
|
||||
Subproject commit d976c8ea528dd61b0d3078cd2abdf18ed21a834b
|
||||
Subproject commit 2ef6fa1fce974c27497e62ffac1d3008aa1773fa
|
2
Patronum
2
Patronum
@ -1 +1 @@
|
||||
Subproject commit 7cf2f8049a189fbf30a83cdf0ac58ba45e309f13
|
||||
Subproject commit fe050508257162bdfc736c5a990c3f610047cf99
|
Loading…
x
Reference in New Issue
Block a user