Commit graph

432 commits

Author SHA1 Message Date
def baf9b94f2c Factor CScoreWorker out of CScore, add SaveScore test 2021-12-19 19:40:20 +01:00
def 84b1108001 Fix comment in CMakeLists.txt 2021-12-19 12:12:26 +01:00
heinrich5991 49c861372a Add a flag to skip a UTF-8 BOM when opening files for reading
https://en.wikipedia.org/w/index.php?title=Byte_order_mark&oldid=1059783325#UTF-8

This allows to read text files created by Windows users transparently,
even if they contain a UTF-8 BOM.
2021-12-17 22:07:01 +01:00
bors[bot] 93fe42a647
Merge #4417
4417: Hopefully fix execution on Mac by fixing link to SDL r=heinrich5991 a=def-

As reported by zou'
<img width="1319" alt="Bildschirmfoto_2021-12-03_um_22 58 32" src="https://user-images.githubusercontent.com/2335377/144679842-1889585f-0137-4645-b4eb-3ad5eb5aebea.png">
<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)

Co-authored-by: def <dennis@felsin9.de>
2021-12-07 20:36:08 +00:00
def 4f6070cee0 Hopefully fix execution on Mac by fixing link to SDL 2021-12-07 15:13:47 +01:00
def 3f637ae0f7 osx -> macos 2021-12-04 13:27:18 +01:00
Robert Müller 30c65dedad add UNICODE defines on windows, misc. unicode fixes 2021-11-20 12:39:52 +01:00
bors[bot] 121c6d16f6
Merge #3879 #4079
3879: Use SDL_FlashWindow to request user's attention r=heinrich5991 a=Jupeyy

We should soon update to SDL 2.0.16 for our bundled libs, but don't merge before this happened.

This drops the remaining X11 dependency.

We should then also use GLEW with EGL for official builds for easy native wayland support(which i discussed before already)

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4079: Make teehistorian easier to reproduce r=heinrich5991 a=Zwelf

I've tested it ingame, but still have to make sure, that the ordering of the teehistorian messages are right. I would be really happy if we could land this before changing team joining logic (#4006 or /practice logic, but there isn't a pr for this yet), but I would like to make sure that the change is correct.

## Checklist

- [x] Tested the change ingame
- [ ] Tested in combination with possibly related configuration options
- [x] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Zwelf <zwelf@strct.cc>
2021-10-06 14:52:39 +00:00
Jupeyy 3c1e0fe663 Use SDL_FlashWindow to request user's attention 2021-10-04 19:21:36 +02:00
def e143555f26 Build macOS build
Undefined symbols for architecture x86_64:
  "_SCDynamicStoreCopyProxies", referenced from:
      _Curl_resolv in libcurl.a(libcurl_la-hostip.o)
ld: symbol(s) not found for architecture x86_64
2021-10-04 00:56:51 +02:00
def c6cf22b96a Update libs, add libpng 1.6.37
ogg 1.3.4 -> 1.3.5
opus 1.3.1 (no update, but rebuilt)
opusfile 0.11 -> 0.12
SDL2 2.0.8/2.0.12 -> 2.0.16
sqlite3 3.32.3 -> 3.36.0
freetype 2.10.1 -> 2.11.0
curl 7.69.1 -> 7.79.0
ffmpeg 4.3.1 -> 4.4
websockets 4.1.1 -> 4.2
2021-10-03 00:18:51 +02:00
ChillerDragon 5997304080 Add -DHEADLESS_CLIENT option to cmake (nulled gfx)
This allows compiling the client without graphics backend and thus it
can run also in a non graphical enviornment
2021-09-09 13:29:15 +02:00
bors[bot] 73e71951b9
Merge #3960 #4006 #4103
3960: Display colors for strong / weak hook states r=Jupeyy a=BloodWod-513

<!-- What is the motivation for the changes of this pull request -->
Off by default, cl_nameplates_strongweak 1 to enable;
Also shown in debug mode (ctrl-shift-d);
You can change the colors in the HUD.

![hkUp2p8chGA](https://user-images.githubusercontent.com/33897884/126379859-1dc29c09-57fb-4d4b-9810-a4f0b09599a0.jpg)
![WCZx_ZR8fQ0](https://user-images.githubusercontent.com/33897884/126379863-3f25295a-ca36-4184-a0ed-1946b40ed967.jpg)
## Checklist
- [x] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4006: Add /team -1 r=Jupeyy a=gerdoe-jr

<!-- What is the motivation for the changes of this pull request -->

## Checklist
In addition for #4005.

Now /team -1 forces player to first empty team.

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


4103: Fix swap resets switches. r=Jupeyy a=edg-l

Fixes #3806

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: BloodWod <dayn_2013@mail.ru>
Co-authored-by: Ilya <33897884+BloodWod-513@users.noreply.github.com>
Co-authored-by: gerdoe-jr <gerdoexx@gmail.com>
Co-authored-by: Edgar Luque <git@edgarluque.com>
2021-08-24 12:23:12 +00:00
bors[bot] eaad036e28
Merge #4116
4116: Update GLEW r=def- a=Jupeyy

If the glew mantainer merges his pr we can remove the ifdefs
But we can also use it like this for now, then atleast our official build has no x11 calls

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-08-24 12:13:59 +00:00
Jupeyy bde7e854ac Update GLEW 2021-08-24 14:05:35 +02:00
Jupeyy 942e54de0c Fix toolchain 2021-08-24 13:21:29 +02:00
bors[bot] 00ff285784
Merge #3761
3761: Bump GTest version so we don't have to patch it anymore r=def- a=heinrich5991

Fixes #3388.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-08-24 10:33:16 +00:00
heinrich5991 d00c5aa8a3 Revert "Manually patch gtest to allow CMake version 2.8.12...3.19.1"
This reverts commit 037b928dd7.

Fixes #3388.
2021-08-24 12:29:51 +02:00
heinrich5991 2191fdcf07 Bump GTest version to latest master as of 2021-04-07
Apparently they follow the "Abseil Live at Head philosophy".
2021-08-24 12:29:47 +02:00
Jupeyy b216b6744a Add Android build scripts 2021-08-24 12:18:20 +02:00
Robert Müller 8fa7610463 remove obsolete engine/shared/message.h 2021-08-20 16:23:29 +02:00
BloodWod 5aafa27b0f change name file 2021-08-14 18:40:58 +05:00
BloodWod 75289d1272 add strong/weak icon 2021-08-14 03:48:49 +05:00
Jupeyy 8451775821 Make components member of CGameClient 2021-07-12 12:07:31 +02:00
Jupeyy 9dfea5511a Use cpp 2021-06-24 17:19:17 +02:00
Freddie Wang 66caa896b9 Add japanese condensed font 2021-06-04 21:15:29 +08:00
bors[bot] efde7523e4
Merge #3772
3772: Add client-side HTTP server info r=def- a=heinrich5991

Summary
=======

The idea of this is that clients will not have to ping each server for
server infos which takes long, leaks the client's IP address even to
servers the user does not join and is a DoS vector of the game servers
for attackers.

For the Internet, DDNet and KoG tab, the server list is entirely fetched
from the master server, filtering out servers that don't belong into the
list.

The favorites tab is also supposed to work that way, except for servers
that are marked as "also ping this server if it's not in the master
server list".

The LAN tab continues to broadcast the server info packet to find
servers in the LAN.

How does it work?
=================

The client ships with a list of master server list URLs. On first start,
the client checks which of these work and selects the fastest one.
Querying the server list is a HTTP GET request on that URL. The
response is a JSON document that contains server infos, server addresses
as URLs and an approximate location.

It can also contain a legacy server list which is a list of bare IP
addresses similar to the functionality the old master servers provided
via UDP. This allows us to backtrack on the larger update if it won't
work out.

Lost functionality
==================

(also known as user-visible changes)

Since the client doesn't ping each server in the list anymore, it has no
way of knowing its latency to the servers.

This is alleviated a bit by providing an approximate location for each
server (continent) so the client only has to know its own location for
approximating pings.
## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-05-26 21:00:49 +00:00
Jupeyy b7adc5a690 Add UI Ex class to share common ui implementations
between menus and editor for example
2021-05-26 15:02:33 +02:00
heinrich5991 bce7a4f84e Add serverbrowser ping cache 2021-05-14 01:00:41 +02:00
heinrich5991 355c6fccd3 Add sqlite3 to the client 2021-05-14 01:00:41 +02:00
heinrich5991 436e202cbd Add client-side HTTP server info
Summary
=======

The idea of this is that clients will not have to ping each server for
server infos which takes long, leaks the client's IP address even to
servers the user does not join and is a DoS vector of the game servers
for attackers.

For the Internet, DDNet and KoG tab, the server list is entirely fetched
from the master server, filtering out servers that don't belong into the
list.

The favorites tab is also supposed to work that way, except for servers
that are marked as "also ping this server if it's not in the master
server list".

The LAN tab continues to broadcast the server info packet to find
servers in the LAN.

How does it work?
=================

The client ships with a list of master server list URLs. On first start,
the client checks which of these work and selects the fastest one.
Querying the server list is a HTTP GET request on that URL. The
response is a JSON document that contains server infos, server addresses
as URLs and an approximate location.

It can also contain a legacy server list which is a list of bare IP
addresses similar to the functionality the old master servers provided
via UDP. This allows us to backtrack on the larger update if it won't
work out.

Lost functionality
==================

(also known as user-visible changes)

Since the client doesn't ping each server in the list anymore, it has no
way of knowing its latency to the servers.

This is alleviated a bit by providing an approximate location for each
server (continent) so the client only has to know its own location for
approximating pings.
2021-05-14 01:00:39 +02:00
heinrich5991 782c826381 Add secure_rand_below function
It works by masking the numbers and the using rejection sampling to
ensure a uniform generation.
2021-05-12 17:02:02 +02:00
def 6465e482a1 Add unit test for empty range 2021-05-06 15:39:34 +02:00
Jupeyy b8f96ce500 Allow GLES3 coexists with OpenGL on Linux 2021-05-02 04:39:02 +02:00
Jupeyy e05abbaa91 Remove GL includes from headers 2021-05-01 23:56:30 +02:00
Jupeyy c0d6ce6d25 Add GLES support 2021-05-01 01:39:37 +02:00
Panagiotis Vasilopoulos 6058019141
Fixed library dependencies for the Haiku operating system 2021-04-18 07:57:24 +03:00
bors[bot] 6572f9e4fe
Merge #3779
3779: Copied Teeworld patches for the Haiku operating system r=def- a=panos

I initiated a port of ddnet and received a lot of help from the IRC in order to do so as seen in #2986. Unfortunately, my efforts went stale after one point. Fortunately, however, @threedeyes released a [set of patches for Teeworlds](2ea72967cd/games-action/teeworlds/patches/teeworlds-0.7.5.patchset). I decided to take down my repository with my own work and attempt to port Gerasim's work, which includes code for setting the directories that ddnet should use the same way one would do so in a Mac OS X-system in `src/base/system.c`, which was precisely the part where I got stuck in on my first attempt.

The changes have not been tested thoroughly yet and were the result of methodic copying and pasting.

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
2021-04-17 18:15:34 +00:00
Panagiotis Vasilopoulos 6c02076c05 Copied Teeworld patches for the Haiku operating system
Co-authored-by: Gerasim Troeglazov <3dEyes@gmail.com>
2021-04-17 20:10:56 +02:00
heinrich5991 8d6b62d8f8 Fix parsing an IPv6 address without port
The port in the NETADDR struct was left uninitialized.

Add some tests to ensure behavior.

CC #3774 #3775
2021-04-17 16:05:39 +02:00
def ce2bf096bd Move autoexec_server.cfg to data (fixes #3612) 2021-03-21 17:48:33 +01:00
Jupeyy 06dd469195 Tell MSVC that main is still entry 2021-03-05 17:36:47 +01:00
Jupeyy c20b9801d4 Don't allocate the windows console default 2021-03-01 15:25:45 +01:00
bors[bot] 2fb1c723c9
Merge #3568
3568: Get rid of the MySQL C++ connector as a dependency and disable C++ exceptions r=Learath2 a=heinrich5991

We now use the C API directly. This has the advantage of using one
obscure dependency less, as the C++ connector also used the C API.

Also remove exceptions from database code.

The equivalent code with return codes is a human-assisted mechanical
translation of the old code, no attempts to improve correctness were
made.

This allows us to enable the -fno-exceptions flag.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-02-24 16:43:16 +00:00
heinrich5991 9568d1055a Remove exceptions from database code
The equivalent code with return codes is a human-assisted mechanical
translation of the old code, no attempts to improve correctness were
made.

This allows us to enable the -fno-exceptions flag.
2021-02-24 17:39:48 +01:00
heinrich5991 d7019a244e Get rid of the MySQL C++ connector as a dependency
We now use the C API directly. This has the advantage of using one
obscure dependency less, as the C++ connector also used the C API.
2021-02-24 17:34:08 +01:00
Alexander Akulich b0c0fb316c Get rid of gamemode.h with confusing definitions
We also have GAME_NAME macro in game/version.h and the macros
from gamemode are not used anywhere else.
2021-02-23 18:26:16 +03:00
bors[bot] e6846827cf
Merge #3614
3614: Mac OS X -> macOS r=heinrich5991 a=def-

Changing the filenames of the releases will be a bit more annoying, so
not sure we want to do that

> Apple shortened the name to "OS X" in 2012 and then changed it to "macOS" in 2016

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-02-12 13:49:29 +00:00
def e985632fae OSX -> macOS
Changing the filenames of the releases will be a bit more annoying, so
not sure we want to do that
2021-02-12 13:41:41 +01:00
def 351705b6fb Add discord dylib on Mac 2021-02-12 12:32:45 +01:00