123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef Datenbank_H
- #define Datenbank_H
- #include <sql.h>
- #include "SSDatenbankV.h"
- #include <Text.h>
- #include <Array.h>
- #include <Zeit.h>
- #include <InitDatei.h>
- using namespace Framework;
- using namespace sql;
- namespace Admin_Recht
- {
- const int SSStarten = 32;
- const int SSBeenden = 34;
- const int SSPausieren = 35;
- const int SSMSChange = 36;
- }
- class SSDatenbank : private SSDatenbankV
- {
- private:
- Datenbank *datenbank;
- CRITICAL_SECTION cs;
- InitDatei *ini;
- int ref;
- public:
- // Konstruktor
- SSDatenbank( InitDatei *zIni );
- // Destruktor
- virtual ~SSDatenbank();
- // nicht constant
- void lock();
- void unlock();
- Text *getKlientKey( int cId );
- int istAdministrator( const char *name, const char *passwort );
- bool adminHatRecht( int id, int recht );
- bool setServerStatus( int id, int status );
- bool setMaxSpiele( int id, int maxS );
- bool serverIstNichtPausiert( int id );
- virtual int getAccountId( int clientId );
- virtual Text *getSpielArtName( int spielId );
- virtual Text *getKarteName( int karteId );
- virtual int getSpielArtId( int karteId );
- int erstelleSpiel( int serverId );
- bool deleteSpielErstelltNext( int serverId );
- int getSpielErstelltId( int serverId );
- int getSpielErstelltSpieler( int spielErstelltId, Array< int > *accountIds );
- int getKarteVonErstelltemSpiel( int spielErstelltId );
- bool getChatServerPortIp( int accountId, int *port, Text *zIp );
- bool spielErstelltAbbruch( int spielErstelltId, int anzahl, Array< int > *accounts, Array< int > *status, Array< bool > *inWarteschlange, RCArray< Zeit > *zeit );
- int spielErstelltFortsetzen( int spielErstelltId );
- void spielSetTeams( int spielId, int sAnzahl, Array< int > *accounts, Array< int > *team );
- void spielSetSpielerNummern( int spielId, int sAnzahl, Array< int > *accounts, Array< int > *spielerNummern );
- int getSpielerAusGruppe( int gruppeId, Array< int > *accounts );
- int getAktionForKlient( int serverId, int accountId, int *id );
- bool setSpielStatusIsRunning( int spielId );
- virtual bool setSpielStatusBeendet( int spielId, int status );
- virtual bool setSpielSpielerStatus( int spielId, int accountId, int punkte, int status );
- virtual bool addSpielerStatistik( int accountId, int spielId );
- virtual Text *getAccountRufName( int accountId );
- bool suchHistorieServer( short *port, Text *ip );
- bool getKartenServer( int karteId, int *port, Text *ip );
- Text *getSpielPfad( int karteId );
- // constant
- Text *getLetzterFehler() const;
- // Reference Counting
- virtual SSDatenbankV *getThis();
- virtual SSDatenbankV *release();
- };
- #endif
|