123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef RegisterServer_H
- #define RegisterServer_H
- #include "Datenbank.h"
- #include <Server.h>
- #include <Thread.h>
- #include <Datei.h>
- #include <Text.h>
- #include <InitDatei.h>
- using namespace Framework;
- using namespace Network;
- class RSKlient;
- class RegisterServer : public Thread
- {
- private:
- Server *server;
- Server *aServer;
- InitDatei *ini;
- RSDatenbank *db;
- CRITICAL_SECTION cs;
- RCArray< RSKlient > *klients;
- Text *fehler;
- int klientAnzahl;
- int id;
- bool nichtPausiert;
- int empfangen;
- int gesendet;
- bool update;
- bool end;
- int ref;
- public:
- // Konstruktor
- RegisterServer( InitDatei *zIni );
- // Destruktor
- virtual ~RegisterServer();
- // nicht constant
- void runn();
- void thread();
- void close();
- bool serverStarten();
- bool serverPause();
- bool serverFortsetzen();
- bool serverBeenden();
- bool setMaxKlients( int mc );
- bool absturzKlient( int klientId );
- bool removeKlient( RSKlient *zKlient );
- void addGesendet( int bytes );
- void addEmpfangen( int bytes );
- // conatant
- bool istAn() const;
- Server *zServer() const;
- RSDatenbank *zDB() const;
- bool hatClients() const;
- int getId() const;
- char *getLetzterFehler() const;
- InitDatei *zIni() const;
- // Reference Counting
- RegisterServer *getThis();
- RegisterServer *release();
- };
- class RSAKlient : public Thread
- {
- private:
- SKlient *klient;
- Text *name;
- Text *passwort;
- int adminId;
- RegisterServer *rs;
- int version;
- public:
- // Konstruktor
- RSAKlient( SKlient *klient, RegisterServer *rs );
- // Destruktor
- virtual ~RSAKlient();
- // nicht constant
- void thread();
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient
- };
- class RSKlient : public Thread
- {
- private:
- SKlient *klient;
- unsigned int klientNummer;
- RegisterServer *rs;
- int ref;
- public:
- // Konstruktor
- RSKlient( SKlient *klient, RegisterServer *rs );
- // Destruktor
- virtual ~RSKlient();
- // nicht constant
- void absturz();
- void thread();
- // constant
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient
- int getKlientNummer() const;
- // Reference Counting
- RSKlient *getThis();
- RSKlient *release();
- };
- #endif
|