145 Commits

Author SHA1 Message Date
Kamil Chojnowski
80b35b8308 Fix an issue with Connection class linkage 2019-10-14 07:54:39 +02:00
Kamil Chojnowski
869de6886f Tidy up the source code
* Replaced push_back calls with emplace_back where applicable.
* Replaced size() == 0 and size() != 0 with empty() and !empty().
* Replaced C style loops for range for loops where applicable.
* Fixed mismatching arg names between function declarations and definitions.
* Replaced NULL and 0 (in the context of pointers) with nullptr.
* Remove unnecessary calls to string::c_str() where applicable.
* Replaced deprecated C headers with proper C++ headers.
* Removed unnecessary null pointer checks when deleting pointers
(deleting a null pointer has no effect).
* Fixed a potential memory leak in apngloader.cpp file.
* Replaced unsafe strcpy with strncpy in the demangle_name function.
2019-10-10 00:59:24 +02:00
Konrad Kuśnierz
779eb56068
Fix setBuffer of InputMessage class 2019-03-09 23:35:52 +01:00
Konrad Kuśnierz
1c8cea513c
Fix setBuffer of the OutputMessage class 2019-03-06 14:48:46 +01:00
Konrad Kuśnierz
92532a958e
Merge pull request #967 from EgzoT/EgzoT-OutputMessage_setBuffer_2
Add setBuffer() method to OutputMessage class
2019-03-06 14:46:24 +01:00
Daniel Speichert
dc729d9846
Fix formatting 2018-07-16 08:47:31 -04:00
Daniel Speichert
ad769d6614 Fix compilation errors (READ_TIMEOUT, READ_TIMEOUT) 2018-07-15 17:03:21 -04:00
Malizia R
b813508eb7
Fixing a typo 2018-05-09 06:56:14 -03:00
EgzoT
9e9d88f184 Add setBuffer() method to OutputMessage class 2018-04-24 23:21:58 +02:00
Konrad Kuśnierz
c87c450905 Fix #703 2017-05-01 18:15:16 +02:00
Bruno Minervino
882be286d9 Update copyright year for 2017 2017-01-13 08:47:07 -02:00
Ranieri Althoff
2f1f62a916
Update copyright year for 2016 2016-07-09 22:11:34 -03:00
Gabriel Pedro
04b516a1a0 Update copyright for 2015 2015-03-04 10:36:51 -04:00
BenDol
d7429c201c Started 1050 implementation and fix ups:
* Dat now loads (new animations aren't yet functional).
* Fixed the way we reference client versions.

TODO: Write new animation functionality & find out protocol changes.
2014-08-03 10:02:28 +12:00
BenDol
547b18db9a Update copyright for 2014 2014-04-01 18:36:42 +13:00
Shawak
d20c263912 Ability to get buffer from inputmessage 2014-03-22 18:09:11 +01:00
Shawak
07e40afa3d Ability to get buffer from inputmessage 2014-03-22 18:07:13 +01:00
Shawak
8179915e06 Ability to get buffer from inputmessage 2014-03-22 18:05:32 +01:00
Eduardo Bart
d32f71c2b9 Partial support for protocol 1020 and minimize lag
I am able to login in global Tibia however there are game protocol errors
* there is a new opcode 167, which I dont know what it is
* there are changes in opcode 147 which handles text messages that I don't know too

Connection writing was optimized, playing "lag" should improve by 10ms,
and improve much more in systems with low fps
2013-11-10 20:10:04 -02:00
Eduardo Bart
38dec168ee Fix boost::asio misuse that would cause lag
io_service::reset was not called before io_service::poll, meaning that new events would be really polled in the next Connection::poll call, this could lead to network lag in computers with low framerate (ie: a user with 10 fps would have 100ms lag just because of that)
2013-10-22 21:42:35 -02:00
Eduardo Bart
e9e4dcd71b Improve walk when lagging 2013-03-13 20:55:20 -03:00
Eduardo Bart
24664714bd Fix rare but serious bug in Connection
* Implement output pooling for writing data in connection,
this should fix rare cases where sending would fail
2013-03-12 00:18:47 -03:00
Eduardo Bart
06e2b6eca2 Platform fixes and rework ping 2013-02-24 22:16:45 -03:00
Eduardo Bart
86d06057ca Fixes to compile with libc++ 2013-02-05 18:30:16 -02:00
Eduardo Bart
b7eef97239 Add flexibility in login packets
* It's now possible to add custom data in the login packet
* Add utility funciton to generate RSA keys
* Make the protocol able to use RSA keys with 2048 bits or more
2013-01-28 20:52:03 -02:00
BeniS
b68df8336a Minor fixes to some previous commits.
* Fixed a bug with storing the protocol version.
* Fixed an issue with text windows cancelling.
* Fixed a typo in the source.
2013-01-18 03:23:01 +13:00
Eduardo Bart
0120b7554c Restore support for animated png files
* Rework resource manager
* Add missing files
* Improve some graphics classes
2013-01-08 19:31:41 -02:00
Eduardo Bart
b52c52cd36 Fix possible crashs when using server class 2013-01-08 18:05:24 -02:00
Eduardo Bart
122577a916 Just rename some files
* Fix a server ping issue
2013-01-08 16:32:05 -02:00
BeniS
44e428bccb Progress updating to cv981/pv973:
* Implemented the new client AND protocol version methods.
* Implemented the new speed laws added in cv980 (http://www.tibia.com/news/?subtopic=newsarchive&id=2251).
* Added more missing bytea to login packets (client version/type and some unknown bytes).
* Fixed the InputMessage::getDouble method.
* Cleaned up some of the const values.
* Started on the pending state features.

TODO:
* Pending game state feature.
* Ensure version compatibility hasn't been compromised.
2012-12-29 00:05:45 +13:00
BeniS
619285069c Started updating to 9.8+ features, not yet finished (unsafe version).
Need to finish:
* Pending login state
* New creature speed changes
* Vip state displays

Fixed:
* Creature light
* Missing lua constants

If someone can finish this off that would be good,
I will be busy for a while :)
2012-12-27 02:56:06 +13:00
Henrique Santiago
c517f7b745 Add/get table functions implemented on ext charlist 2012-08-30 02:59:27 -03:00
Henrique Santiago
05fcf740b4 Stats module 2012-08-22 05:51:31 -03:00
Henrique Santiago
7fb2f6deb5 Add getIp function, remove unused sql function 2012-08-12 01:54:45 -03:00
Henrique Santiago
fb7ab21e71 Move RSA class to Crypt 2012-08-04 10:54:35 -03:00
Henrique Santiago
4e0642c814 Removed GMP and added OpenSSL. Rsa class might be moved to Crypto later. 2012-08-03 13:02:01 -03:00
Henrique
3b345cf868 Add setXteaKey function 2012-08-01 21:25:11 -03:00
Henrique
4f0e00fdfa Change to RSA decrypt function 2012-08-01 15:34:42 -03:00
Eduardo Bart
3bac3dcbb4 Rework stdext classes
Implement new classes:
* stdext::any => ligher replacement for boost::any
* stdext::packed_any => like any but optimized to use less memory
* stdext::shared_object => ligher replacement for std::shared_ptr
* stdext::shared_object_ptr => replacement for boost::intrusive_ptr
* stdext::fast_storage => for storing dynamic data
* stdext::packed_storage => same but with less memory
* stdext::packed_vector => std::vector with less memory

Compiling should be a little faster now because global boost including
is not needed anymore
2012-08-01 09:23:35 -03:00
Henrique
3c1a5f24e8 Fix to protocolgame 2012-07-31 14:23:52 -03:00
Eduardo Bart
614d1544c0 Fix market reload and a crash when exiting 2012-07-31 11:42:26 -03:00
Eduardo Bart
a1fb373b1b Revert protocol bug added in lasts commit 2012-07-30 21:08:32 -03:00
Henrique
12e6602925 Bind connection and fix protocol recv without xtea 2012-07-30 17:12:38 -03:00
Henrique
c969f5209f Some changes to server compatibility 2012-07-30 16:40:03 -03:00
Eduardo Bart
03b8241bbc Rename stdext::shared_object_ptr to compile in gcc 4.6 2012-07-30 12:08:21 -03:00
Eduardo Bart
59b6abfa09 Implement message modes for 9.6
Fix possible crash when closing otclient
Fix private messages
Fix messages in 9.6
2012-07-30 09:33:52 -03:00
Eduardo Bart
e0431021b5 Huge engine change, replace all std::shared_ptrs
Create a new shared pointer type stdext::shared_object_ptr and stdext::shared_obj
using boost::intrusive_ptr

Advantages:
 * half memory usage
 * faster and lightweight

Disadvantages:
 * using weak_ptr is not supported anymore
 * compiling seems slower
2012-07-29 00:34:40 -03:00
Eduardo Bart
0a49f58e50 Fix crash when InputMessage is too large 2012-07-26 11:03:57 -03:00
Eduardo Bart
eb24d6776e Multi-protocol
Lots of chagnes to add multi protocol flexibility, not really
completed yet, still have to rework text messages opcodes and other stuff,
so this still a working in progress feature

* Rework dat reader, the dat reader can now
* dinamically detect dat version
* Split game into gamelib and game_interface
* Lots of other minor changes
2012-07-17 20:53:19 -03:00
BeniS
b7ac6ce6d5 Added Market/MarketProtocol module to begin the construction of the Market! Fixed some Minor Issues, and Some Cosmetics
* Added new protocol lib.
* Added missing Game Features to game/const.lua
* Added new Market module that will handle the market/market protocols too.
* Finished Market protocol and begun on the market structure (MarketOffer etc).
* Removed any traces of market protocol in the core (I think).
* Moved minimap images to /images.
* Removed old zoom images for minimap.
* Fixed a bug with randomize outfit.
2012-07-18 02:36:27 +12:00