forked from mirror/openmw-tes3mp
[Browser] Do not try to receive packet if sending is failed.
This commit is contained in:
parent
956b573323
commit
d3bf4ec577
1 changed files with 7 additions and 4 deletions
|
@ -41,16 +41,17 @@ QueryClient &QueryClient::Get()
|
||||||
|
|
||||||
map<SystemAddress, QueryData> QueryClient::Query()
|
map<SystemAddress, QueryData> QueryClient::Query()
|
||||||
{
|
{
|
||||||
|
status = -1;
|
||||||
map<SystemAddress, QueryData> query;
|
map<SystemAddress, QueryData> query;
|
||||||
if (Connect() == IS_NOT_CONNECTED)
|
if (Connect() == IS_NOT_CONNECTED)
|
||||||
{
|
|
||||||
status = -1;
|
|
||||||
return query;
|
return query;
|
||||||
}
|
|
||||||
|
|
||||||
BitStream bs;
|
BitStream bs;
|
||||||
bs.Write((unsigned char) (ID_MASTER_QUERY));
|
bs.Write((unsigned char) (ID_MASTER_QUERY));
|
||||||
peer->Send(&bs, HIGH_PRIORITY, RELIABLE_ORDERED, CHANNEL_MASTER, masterAddr, false);
|
int code = peer->Send(&bs, HIGH_PRIORITY, RELIABLE_ORDERED, CHANNEL_MASTER, masterAddr, false);
|
||||||
|
|
||||||
|
if (code == 0)
|
||||||
|
return query;
|
||||||
|
|
||||||
pmq->SetServers(&query);
|
pmq->SetServers(&query);
|
||||||
status = GetAnswer();
|
status = GetAnswer();
|
||||||
|
@ -106,6 +107,8 @@ MASTER_PACKETS QueryClient::GetAnswer()
|
||||||
update = false;
|
update = false;
|
||||||
id = pid;
|
id = pid;
|
||||||
break;
|
break;
|
||||||
|
case ID_CONNECTION_REQUEST_ACCEPTED:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue