fix reconnect
This commit is contained in:
parent
f0212d54cf
commit
f488cc4b69
|
@ -39,6 +39,10 @@
|
||||||
<source>%1 logged out</source>
|
<source>%1 logged out</source>
|
||||||
<translation>玩家 <b>%1</b> 离开服务器</translation>
|
<translation>玩家 <b>%1</b> 离开服务器</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>%1 backed</source>
|
||||||
|
<translation>玩家 <b>%1</b> 回到了游戏</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
<context>
|
<context>
|
||||||
|
|
|
@ -307,7 +307,10 @@ void Server::handleNameAndPassword(ClientSocket *client, const QString &name,
|
||||||
if (player->getState() == Player::Offline) {
|
if (player->getState() == Player::Offline) {
|
||||||
auto room = player->getRoom();
|
auto room = player->getRoom();
|
||||||
player->setSocket(client);
|
player->setSocket(client);
|
||||||
|
player->alive = true;
|
||||||
client->disconnect(this);
|
client->disconnect(this);
|
||||||
|
broadcast("ServerMessage",
|
||||||
|
tr("%1 backed").arg(player->getScreenName()));
|
||||||
room->pushRequest(QString("%1,reconnect").arg(id));
|
room->pushRequest(QString("%1,reconnect").arg(id));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue