Commit graph

17 commits

Author SHA1 Message Date
VladimirMangos
17d8c4d075 [9553] Make GCC really happy... 2010-03-08 23:42:28 +03:00
VladimirMangos
c8fd454a79 [9551] Add and use PackedGuid wrapper.
Also
* use more wide bytebuff << >> operators for objects
* use at read packet faisl alsways exception way instead some time used bool results.
2010-03-08 20:23:16 +03:00
VladimirMangos
ad9243ebd0 [9550] Hide unsafe templated ByteBuffer::append function only for internal use. 2010-03-08 19:41:41 +03:00
VladimirMangos
fe6e2e1746 [9122] Updated copyright notice for new year.
Also fix some lost in past cases.
2010-01-08 00:02:21 +03:00
VladimirMangos
35121cdd34 [8389] Implement check really read received packet size and warning it not all data read.
* This let more easy catch packet structure chnages at client switch.
* Fixed structure CMSG_GUILD_BANK_SWAP_ITEMS
* Fixed structure CMSG_SPLIT_ITEM, CMSG_SELL_ITEM
* Added read data amount fixes for some other packets.

Thanks to TOM_RUS in help check correct packets structure.

Note: not all packets possible fixed. Please report for not fixed cases at errors:
"opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)"
2009-08-19 00:45:24 +04:00
VladimirMangos
2372623a5b [8384] Restore build mangos at Unix/Linux.
* Also fixed wrong read_skip<char*>() code.
* Also fixed some warnings in related code.
2009-08-18 16:58:48 +04:00
VladimirMangos
2b534cbc23 [8382] Implement ByteArray functions for skip read of fields not needed for server in received packets.
* Use this fucntions in some case.
* Change some packets to form: read fields first check later for better control recieved packets structure.
* Fix CMSG_STAND_STATE_CHANGE packet structure to more correct.
2009-08-18 03:49:50 +04:00
arrai
a24f39a36f [8378] Use exceptions instead of explicit size checking for each packet
CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd
could crash due to the asserts in ByteBuffer.h. That was exploitable by
malicious players.
Furthermore, there were duplicate checks: Additionally to
CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye
on not exceeding the packet boundaries - just to crash the server for
sure in such a case.
To prevent memory leaks or other undesirable states, please read in
every handler all variables _before_ doing any concrete handling.
2009-08-16 23:50:22 +02:00
tomrus88
90d4d70f0c [7999] Added appendPackXYZ to ByteBuffer class. 2009-06-12 16:11:20 +04:00
VladimirMangos
ef2d0df05d [7968] In packet compression use real writed data size. 2009-06-06 08:54:34 +04:00
VladimirMangos
fb45529eff [7929] Some fixes and optimizations for work with packet guids.
* Allocate only minimal required buffer size for object packet guid cache, avoid it realocation.
* At adding aboyher buffer content copy only until wpos (really writed to buffer data)
* In appendPackGUID check buffer size before data write.
2009-05-31 22:18:48 +04:00
Naicisum
60e450166d [7925] Correct minor output format error inside ByteBuffer class
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-31 09:33:10 +04:00
VladimirMangos
f4482f247f [7532] Avoid warnings at use size_t with printf fromat strings. 2009-03-24 06:03:22 +03:00
arrai
c6f48843ad [7017] Updated copyright notice for new year 2009-01-03 18:09:51 +01:00
VladimirMangos
9c5dab1248 [6953] Cleanup packed guids write/read code.
* Remove unused function writeGUID and move function readGUID (with some changes) to ByteBuffer class.
* Remove now empty Tools.cpp/Tools.h from project.
2008-12-27 17:27:20 +03:00
TheLuda
92441a0241 Applied new coding standard, see http://github.com/mangos/mangos/wikis/codingstandards for more. 2008-10-15 18:25:33 +02:00
TheLuda
800ee76535 Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/svnroot/mangos/trunk/ 2008-10-14 00:29:20 +02:00