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