Don't update/send to inavlidated clients

This commit is contained in:
Pontus Fransson 2014-02-21 13:54:04 +01:00
parent 5742f45392
commit 1c71d7ef80
2 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ using namespace DanBias;
{
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();
}
@ -108,7 +108,7 @@ using namespace DanBias;
bool returnValue = false;
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);
returnValue = true;
@ -122,7 +122,7 @@ using namespace DanBias;
{
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);
return true;

View File

@ -36,8 +36,8 @@ GameSession::GameSession()
this->isCreated = false;
this->isRunning = false;
this->gameSession = this;
this->logicFrameTime = DELTA_TIME_20;
this->networkFrameTime = DELTA_TIME_20;
this->logicFrameTime = DELTA_TIME_60;
this->networkFrameTime = DELTA_TIME_60;
this->networkTimer.reset();
this->logicTimer.reset();