ServerPlayer.h 579 B

1234567891011121314151617181920212223242526
  1. #ifndef SERVER_PLAYER_H
  2. #define SERVER_PLAYER_H
  3. #include "common/entities/Entity.h"
  4. #include "common/network/toserver/PlayerUpdatePacket.h"
  5. #include "network/Server.h"
  6. #include "utils/RingBuffer.h"
  7. class ServerPlayer : public Entity {
  8. Server::Client& client;
  9. RingBuffer<PlayerUpdatePacket, 40> 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 onUpdatePacket(const PlayerUpdatePacket& p);
  17. private:
  18. void setClientPosition();
  19. };
  20. #endif