123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- #ifndef LoginServer_H
- #define LoginServer_H
- #include <Server.h>
- #include <Thread.h>
- #include <Datei.h>
- #include <Text.h>
- #include <InitDatei.h>
- #include "Datenbank.h"
- using namespace Framework;
- using namespace Network;
- class LSKlient;
- class LoginServer : public Thread
- {
- private:
- Server *server;
- Server *aServer;
- InitDatei *ini;
- LSDatenbank *db;
- CRITICAL_SECTION cs;
- RCArray< LSKlient > *klients;
- Text *fehler;
- int klientAnzahl;
- int id;
- bool nichtPausiert;
- int empfangen;
- int gesendet;
- bool end;
- int ref;
- public:
- // Konstruktor
- LoginServer( InitDatei *zIni );
- // Destruktor
- virtual ~LoginServer();
- // 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( LSKlient *zKlient );
- void addGesendet( int bytes );
- void addEmpfangen( int bytes );
- // conatant
- bool istAn() const;
- Server *zServer() const;
- LSDatenbank *zDB() const;
- bool hatClients() const;
- int getId() const;
- char *getLetzterFehler() const;
- // Reference Counting
- LoginServer *getThis();
- LoginServer *release();
- };
- class LSAKlient : public Thread
- {
- private:
- SKlient *klient;
- Text *name;
- Text *passwort;
- int adminId;
- LoginServer *ls;
- int version;
- public:
- // Konstruktor
- LSAKlient( SKlient *klient, LoginServer *ls );
- // Destruktor
- virtual ~LSAKlient();
- // nicht constant
- void thread();
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient
- };
- class LSKlient : public Thread
- {
- private:
- SKlient *klient;
- unsigned int klientNummer;
- LoginServer *ls;
- int ref;
- public:
- // Konstruktor
- LSKlient( SKlient *klient, LoginServer *ls );
- // Destruktor
- virtual ~LSKlient();
- // nicht constant
- void absturz();
- void thread();
- // constant
- void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient
- int getKlientNummer() const;
- // Reference Counting
- LSKlient *getThis();
- LSKlient *release();
- };
- class MSGWeiterleitung
- {
- private:
- LoginServer *ls;
- int ref;
- public:
- // Konstruktor
- MSGWeiterleitung( LoginServer *ls );
- // Destruktor
- ~MSGWeiterleitung();
- // nicht constant
- bool spielErstelltAbbrechen( int spielErstelltId );
- bool spielerLeavesGruppe( int gruppeId, int accountId );
- bool setGruppeAdmin( int gruppeId, int adminId );
- bool spielerLeavesChatroom( int chatroomId, int accountId );
- bool setChatroomAdmin( int chatroomId, int adminId );
- bool kickSpielerAusGruppe( int gruppeId );
- // constant
- // Reference Counting
- MSGWeiterleitung *getThis();
- MSGWeiterleitung *release();
- };
- #endif
|