Commit graph

95 commits

Author SHA1 Message Date
def 5d8d900643 Revert recvmmsg 2018-07-29 22:49:34 +02:00
heinrich5991 5c4e819e44 Use str_startswith, str_endswith instead of ad-hoc implementations 2018-07-26 14:18:23 +02:00
Dennis Felsing d5dc951747 fix 2018-07-25 16:24:12 +02:00
heinrich5991 ca8fcc823c Use more secure hash function for map downloads
SHA256 was chosen because it is reasonably standard, the file names
don't explode in length (this rules out SHA512) and it is supported by
basically all versions of OpenSSL (this rules out SHA512/256 and SHA3).

The protocol is changed in a backward compatible way: The supporting
server sends the SHA256 corresponding to the map in the `MAP_DETAILS`
message prior to sending the `MAP_CHANGE` message. The client saves the
SHA256 obtained from the `MAP_DETAILS` message until the next
`MAP_CHANGE` message.

For servers not supporting this protocol, the client falls back to
simply opening maps like in the previous scheme.

Remove the `map_version` tool, it is not being used and would have been
a little bit effort to update.

Use the OpenSSL implementation of SHA256 if it is supported, otherwise
fall back to a public domain one.

Fix #1127.
2018-06-24 17:04:50 +02:00
heinrich5991 f8277267a0 Remove mem_alloc and mem_free, use standard C functions instead
Replace `mem_free` by `free`, and `mem_alloc` by `malloc` or `calloc`
(the latter one being used to allocate a zeroed array of elements,
sometimes, this makes a call to `mem_zero` superfluous).

This results in having to remove `mem_stats` which previously recorded
the number of allocations and their size that the Teeworlds code did
directly.

Remove OOM handling in `src/game/client/components/binds.cpp`.

Remove needless copying in the CSV code in
`src/game/client/components/statboard.cpp`.
2018-04-09 11:56:39 +02:00
bors[bot] c0fa444f3a Merge #1034
1034: Try to find external GLEW, pnglite and Wavpack  r=Learath2 a=heinrich5991

Allow for newer versions of Wavpack, fixes #1023.

Fixes #1016.
2018-02-13 02:02:07 +00:00
heinrich5991 94818ec1f0 Try to find external GLEW, pnglite and Wavpack
Allow for newer versions of Wavpack, fixes #1023.

Fixes #1016.
2018-02-12 23:29:45 +01:00
yangfl 1620fc9b0f Fix typo 2018-02-07 16:10:40 +08:00
Dennis Felsing eb2634ab0a Merge pull request #852 from heinrich5991/pr_ddnet_fix_extractname
Add testing; fix, rename and test the `CEditor::ExtractName` function
2017-08-30 22:09:17 +02:00
heinrich5991 22be1be389 Fix and rename the CEditor::ExtractName function
Fixes #846.
2017-08-30 13:59:42 +02:00
heinrich5991 2682480f8a Rename GetUncompressedDataSize to GetDataSize
Also rename the old `GetDataSize` to `GetFileDataSize`. `GetDataSize`
now returns the actual data size, not the data size before
decompression.
2017-08-30 08:36:17 +02:00
root 7cd95f63cf Fixing spaces and globals 2017-08-30 00:34:14 +02:00
root 2c748ebf70 Fixing PR over heinrich revision 2017-08-30 00:21:41 +02:00
sctt 0849fa6024 fixing map_resave and adding map_replace_image
Update datafile.h

Update datafile.cpp

Update datafile.cpp

Update map_resave.cpp

Update datafile.h

Update map_resave.cpp

Update datafile.h

Update datafile.cpp

Update config_store.cpp

Update config_retrieve.cpp

Update io.cpp

Update gamecontext.cpp

Update config_store.cpp

Update CMakeLists.txt

Create map_replace_image.cpp

Update map_replace_image.cpp

fixing bug with height and witdth
2017-08-29 16:21:16 +02:00
heinrich5991 33315452c3 Merge branch 'master' into leak_fix 2017-07-31 20:42:32 +02:00
Learath2 4622ab4cb6 Merge pull request #814 from heinrich5991/pr_ddnet_fix_cmake_mac
Fix the CMake Mac build
2017-07-30 11:38:12 +02:00
heinrich5991 6247aa0c7f Enable -Wextra and -Wformat=2
Also annotate `dbg_msg`, `str_format` and `str_timestamp_ex` so that the
compiler can determine whether the format strings are correct.

Fix the compiler warnings generated by these extra warnings -- some of
them were security issues.
2017-07-27 20:38:17 +02:00
heinrich5991 98f229c48b Fix a -Wunused-value warning in map_diff 2017-07-26 11:53:21 +02:00
HMH 1f7d216f28 also delete Kernel in map_version 2017-07-21 20:01:39 +02:00
def f2444b0de7 Add map_diff tool to compare tile layers of map versions 2017-07-12 20:15:00 +02:00
def f3e3d57a90 Always close files, cleaner demo recording, fix some other stuff 2017-07-08 13:39:20 +02:00
def 3aaf38cefb Fix map_extract usage a bit 2017-06-12 21:18:21 +02:00
def c943efbec0 Add tool to extract images and sounds from maps 2017-06-12 21:00:33 +02:00
heinrich5991 5ae37e6c72 Add protocol extension with UUIDs
This system can easily be extended by independent authors without
collisions, something the old system with plain increasing integers did
not allow.

Do this by utilizing the previously unused message code `NETMSG_NULL`
which has a value of 0.

This works for engine and game messages, snapshot items and events.
2017-05-25 00:52:43 +02:00
necropotame b8e4e5beea Fix style in several places 2017-03-22 19:45:14 +01:00
heinrich5991 cd3b0ae855 Implement the confusable algorithm from Unicode more closely
See UTS#39 "Unicode Security Mechanisms":
http://www.unicode.org/reports/tr39/

This means that characters with accents or other things around them are
now considered the confusable with the base character.

Fixes #557. Fixes #575.
2016-10-30 13:45:55 +01:00
heinrich5991 b075f1ff1b Use a dummy map with background 2016-05-25 23:47:34 +02:00
heinrich5991 702ed7e023 Reduce dummy map size from 549 bytes to 191 bytes
Also include a tool to generate said map; the map is generated without
any hacks. It could likely be made smaller using a few tricks.
2016-05-24 01:47:04 +02:00
def 61e47422f6 Clean up debug messages a bit (lower case, no useless errors) 2016-05-02 21:35:32 +02:00
heinrich5991 3a069093d7 Fix settings compare
It was just using a heuristic, comparing the first 24 bytes. Memory unsafety
for configs that were shorter than 24 bytes.
2015-08-27 16:20:56 +02:00
heinrich5991 cc0d0fa728 Fix config_store for old maps that don't contain MAPITEMTYPE_INFO
Just add one in this case.
2015-08-27 15:46:51 +02:00
heinrich5991 a945cca8a5 Fix datafile building before the file is open 2015-08-27 12:55:35 +02:00
heinrich5991 53d7e0dd4c Fix file opening in config_* tools 2015-08-27 12:55:35 +02:00
heinrich5991 d13ebf93a2 Add config_store and config_retrieve tool 2015-08-27 12:55:35 +02:00
def db2256e827 Fix a few whitespace-at-end-of-file issues 2015-08-22 15:27:41 +02:00
def bd62b5da79 Clean up a few compile warnings 2014-12-31 13:04:31 +01:00
oy 4073520214 cleaned up content folder creation. Closes #845 2012-01-09 01:38:45 +01:00
oy b44ee3d975 reworked ban system 2011-12-29 23:36:53 +01:00
heinrich5991 72d5ef329b added tileset_borderrem and renamed tileset_bordercopy -> tileset_borderset 2011-12-29 14:36:00 +01:00
heinrich5991 5722592916 added tileset_borderadd, aesthetical changes 2011-12-29 14:35:51 +01:00
heinrich5991 f76c7a8873 fixed a bug with constants, made the macro more readable 2011-12-29 14:35:45 +01:00
heinrich5991 41daa3b110 added tileset_bordercopy tool 2011-12-29 14:35:33 +01:00
Shereef Marzouk c6fd4a2cc5 General whitespace and tab cleanup 2011-08-11 10:59:14 +02:00
oy fc13cc6c18 cleaned up last commit 2011-07-11 11:26:41 +02:00
Romain Labolle 1058fe27f2 Allow multi-file input for dilate and tilset_borderfix commands 2011-07-11 11:22:04 +02:00
Choupom f1df704d78 fixed pnglite requiring a std header include 2011-05-03 18:44:46 +02:00
oy 06115dd49d added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
oy 3250beb146 removed old master server files as the new one supports 0.5 and older now 2011-04-05 18:42:50 +02:00
Sworddragon 0efa2634f7 Fixed some compiler warnings 2011-04-03 22:35:11 +02:00
oy 62884920d3 fixed compiling of tileset_borderfix 2011-04-01 17:25:02 +02:00