1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include "KeepAlive.h"
- #include "../Global/Variablen.h"
- // Inhalt der KeepAliveTh Klasse aus KeepAlive.h
- // Konstruktor
- KeepAliveTh::KeepAliveTh()
- : Thread()
- {
- exit = 0;
- start();
- }
- // nicht constant
- void KeepAliveTh::thread()
- {
- while( !exit )
- {
- if( loginClient && loginClient->istVerbunden() )
- loginClient->keepAlive();
- if( registerClient && registerClient->istVerbunden() )
- registerClient->keepAlive();
- if( infoClient && infoClient->istVerbunden() )
- infoClient->keepAlive();
- if( chatClient && chatClient->istVerbunden() )
- chatClient->keepAlive();
- if( anmeldungClient && anmeldungClient->istVerbunden() )
- anmeldungClient->keepAlive();
- if( spielClient && spielClient->istVerbunden() )
- spielClient->keepAlive();
- if( shopClient && shopClient->istVerbunden() )
- shopClient->keepAlive();
- if( newsClient && newsClient->istVerbunden() )
- newsClient->keepAlive();
- if( editorClient && editorClient->istVerbunden() )
- editorClient->keepAlive();
- if( minigameClient && minigameClient->istVerbunden() )
- minigameClient->keepAlive();
- for( int i = 0; i < 300 && !exit; i++ )
- Sleep( 100 );
- }
- run = 0;
- }
- void KeepAliveTh::doExit()
- {
- exit = 1;
- }
|