When Client sends message longer than 256 bytes, kick him instead of handling message (#4514)
When Client sends message longer than 256 bytes, kick him instead of handling message (#4514)

* Wrong overload of function push() got called when pushing a cEntity*.
Using a const cEntity * fixes this.

* Fixed accidental wrong indentation

* Compiler didn't like old style cast

* Kicking player when writing chat message longer than 2048

* Accounted for Astrings size() method returning bits, not bytes

* Fixed typo

* Changed MAX_STRING_SIZE to 1024, removed unnecessary division by 8

* Handling message length check in cClientHandle:HandleChat

* Guard clause instead of if else

* Remove stale changes

* Fixed formatting

Co-authored-by: mluchterhand <324c28785b205bf40f31ceff478f6254197f4eaf@max.de>
Co-authored-by: Peter Bell <c3136ef301fb69ad6a423adde17aac80cdd4c1b0@live.co.uk>
Co-authored-by: Mattes D <64b2b6d12bfe4baae7dad3d018f8cbf6b0e7a044@xoft.cz>
mc-server/MCServer,mc-server/MCServer,mc-server/MCServer,mc-server/MCServer,mc-server/MCServer,mc-server/MCServer