123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef EditorServer_H
- #define EditorServer_H
- #include <Server.h>
- #include <Thread.h>
- #include <Datei.h>
- #include <Text.h>
- #include <InitDatei.h>
- #include "Datenbank.h"
- #include "KarteEditor.h"
- using namespace Framework;
- using namespace Network;
- class EdSKlient;
- class EditorServer : public Thread
- {
- private:
- Server *server;
- Server *aServer;
- InitDatei *ini;
- EdSDatenbank *db;
- CRITICAL_SECTION cs;
- RCArray< EdSKlient > *klients;
- Text *fehler;
- int klientAnzahl;
- int id;
- bool nichtPausiert;
- int empfangen;
- int gesendet;
- bool end;
- int ref;
- public:
- // Konstruktor
- EditorServer( InitDatei *zIni );
- // Destruktor
- virtual ~EditorServer();
- // 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( EdSKlient *zKlient );
- void addGesendet( int bytes );
- void addEmpfangen( int bytes );
- // conatant
- bool istAn() const;
- Server *zServer() const;
- EdSDatenbank *zDB() const;
- InitDatei *zIni() const;
- bool hatClients() const;
- int getId() const;
- char *getLetzterFehler() const;
- // Reference Counting
- EditorServer *getThis();
- EditorServer *release();
- };
- class EdSAKlient : public Thread
- {
- private:
- SKlient *klient;
- Text *name;
- Text *passwort;
- int adminId;
- EditorServer *eds;
- public:
- // Konstruktor
- EdSAKlient( SKlient *klient, EditorServer *eds );
- // Destruktor
- virtual ~EdSAKlient();
- // nicht constant
- void thread();
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient
- };
- class EdSKlient : public Thread
- {
- private:
- SKlient *klient;
- unsigned int klientNummer;
- EditorServer *eds;
- KarteEditor *ked;
- int ref;
- public:
- // Konstruktor
- EdSKlient( SKlient *klient, EditorServer *eds );
- // Destruktor
- virtual ~EdSKlient();
- // nicht constant
- void absturz();
- void thread();
- // constant
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient
- int getKlientNummer() const;
- // Reference Counting
- EdSKlient *getThis();
- EdSKlient *release();
- };
- #endif
|