123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #ifndef KartenServer_H
- #define KartenServer_H
- #include <Server.h>
- #include <Thread.h>
- #include <Datei.h>
- #include <Text.h>
- #include <InitDatei.h>
- #include "Datenbank.h"
- #include "Updater.h"
- using namespace Framework;
- using namespace Network;
- class KSKlient;
- class KartenServer : public Thread
- {
- private:
- Server *server;
- Server *aServer;
- InitDatei *ini;
- KSDatenbank *db;
- CRITICAL_SECTION cs;
- RCArray< KSKlient > *klients;
- Text *fehler;
- Updater *updater;
- int updateKarte;
- int klientAnzahl;
- int id;
- bool nichtPausiert;
- int empfangen;
- int gesendet;
- bool end;
- int ref;
- public:
- // Konstruktor
- KartenServer( InitDatei *zIni );
- // Destruktor
- virtual ~KartenServer();
- // nicht constant
- void runn();
- void thread();
- void close();
- bool serverStarten();
- bool serverPause();
- bool serverFortsetzen();
- bool serverBeenden();
- bool setMaxKarten( int mk );
- bool absturzKlient( int klientId );
- bool removeKlient( KSKlient *zKlient );
- void addGesendet( int bytes );
- void addEmpfangen( int bytes );
- void karteUpdateStart( int karteId );
- void karteUpdateEnde();
- // conatant
- bool istAn() const;
- Server *zServer() const;
- KSDatenbank *zDB() const;
- InitDatei *zIni() const;
- bool hatClients() const;
- int getId() const;
- char *getLetzterFehler() const;
- bool wirdKarteGeupdatet( int id ) const;
- // Reference Counting
- KartenServer *getThis();
- KartenServer *release();
- };
- class KSAKlient : public Thread
- {
- private:
- SKlient *klient;
- Text *name;
- Text *passwort;
- int adminId;
- KartenServer *ks;
- public:
- // Konstruktor
- KSAKlient( SKlient *klient, KartenServer *ks );
- // Destruktor
- virtual ~KSAKlient();
- // nicht constant
- void thread();
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient
- };
- class KSKlient : public Thread
- {
- private:
- SKlient *klient;
- unsigned int klientNummer;
- KartenServer *ks;
- int ref;
- void suchDateien( const char *pf, RCArray< Text > *zDL, const char *rem );
- public:
- // Konstruktor
- KSKlient( SKlient *klient, KartenServer *ks );
- // Destruktor
- virtual ~KSKlient();
- // nicht constant
- void absturz();
- void thread();
- // constant
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient
- int getKlientNummer() const;
- // Reference Counting
- KSKlient *getThis();
- KSKlient *release();
- };
- #endif
|