123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #pragma once
- #include <Text.h>
- #include <Array.h>
- #include <Writer.h>
- #include <Critical.h>
- Framework::Text randomSecret();
- class RegisteredPlayer : public Framework::ReferenceCounter
- {
- private:
- int id;
- Framework::Text name;
- Framework::Text secret;
- public:
- RegisteredPlayer(int id, Framework::Text name);
- RegisteredPlayer(Framework::StreamReader* zReader);
-
- int getId() const;
- Framework::Text getName() const;
- Framework::Text getSecret() const;
- void save(Framework::StreamWriter* zWriter) const;
- };
- class PlayerRegister : public Framework::ReferenceCounter
- {
- private:
- Framework::RCArray<RegisteredPlayer> players;
- Framework::Critical cs;
- Framework::Text path;
-
- public:
- PlayerRegister(Framework::Text worldPath);
-
- Framework::Text addPlayer(Framework::Text name);
- bool hasPlayer(Framework::Text name);
- int getPlayerId(Framework::Text name);
- bool checkSecret(Framework::Text name, Framework::Text secret);
- void save();
- };
|