ServerPlayer.h 538 B

1234567891011121314151617181920212223
  1. #ifndef SERVER_PLAYER_H
  2. #define SERVER_PLAYER_H
  3. #include "common/entities/Entity.h"
  4. #include "common/network/toserver/ControllerPacket.h"
  5. #include "network/Server.h"
  6. #include "utils/RingBuffer.h"
  7. class ServerPlayer : public Entity {
  8. Server::Client& client;
  9. RingBuffer<ControllerPacket, 30> history;
  10. public:
  11. ServerPlayer(Server::Client& client);
  12. void tick() override;
  13. void onChat(InPacket& in);
  14. void sendChunk();
  15. void send(OutPacket& out);
  16. void onControllerPacket(const ControllerPacket& cp);
  17. };
  18. #endif