Don't update/send to inavlidated clients
This commit is contained in:
parent
5742f45392
commit
1c71d7ef80
|
@ -97,7 +97,7 @@ using namespace DanBias;
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < this->gClients.Size(); i++)
|
for (unsigned int i = 0; i < this->gClients.Size(); i++)
|
||||||
{
|
{
|
||||||
if(this->gClients[i] )
|
if(this->gClients[i] && !this->gClients[i]->IsInvalid())
|
||||||
{
|
{
|
||||||
this->gClients[i]->UpdateClient();
|
this->gClients[i]->UpdateClient();
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ using namespace DanBias;
|
||||||
bool returnValue = false;
|
bool returnValue = false;
|
||||||
for (unsigned int i = 0; i < this->gClients.Size(); i++)
|
for (unsigned int i = 0; i < this->gClients.Size(); i++)
|
||||||
{
|
{
|
||||||
if(this->gClients[i])
|
if(this->gClients[i] && !this->gClients[i]->IsInvalid())
|
||||||
{
|
{
|
||||||
this->gClients[i]->GetClient()->Send(message);
|
this->gClients[i]->GetClient()->Send(message);
|
||||||
returnValue = true;
|
returnValue = true;
|
||||||
|
@ -122,7 +122,7 @@ using namespace DanBias;
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < this->gClients.Size(); i++)
|
for (unsigned int i = 0; i < this->gClients.Size(); i++)
|
||||||
{
|
{
|
||||||
if(this->gClients[i] && this->gClients[i]->GetClient()->GetID() == ID)
|
if(this->gClients[i] && !this->gClients[i]->IsInvalid() && this->gClients[i]->GetClient()->GetID() == ID)
|
||||||
{
|
{
|
||||||
this->gClients[i]->GetClient()->Send(protocol);
|
this->gClients[i]->GetClient()->Send(protocol);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -36,8 +36,8 @@ GameSession::GameSession()
|
||||||
this->isCreated = false;
|
this->isCreated = false;
|
||||||
this->isRunning = false;
|
this->isRunning = false;
|
||||||
this->gameSession = this;
|
this->gameSession = this;
|
||||||
this->logicFrameTime = DELTA_TIME_20;
|
this->logicFrameTime = DELTA_TIME_60;
|
||||||
this->networkFrameTime = DELTA_TIME_20;
|
this->networkFrameTime = DELTA_TIME_60;
|
||||||
this->networkTimer.reset();
|
this->networkTimer.reset();
|
||||||
this->logicTimer.reset();
|
this->logicTimer.reset();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue