Commit graph

11544 commits

Author SHA1 Message Date
def 67178b0ea0 Use str_time/str_time_float everywhere 2020-10-18 23:47:09 +02:00
def 8dfcd67fe6 Add str_time/str_time_float
Handles centisecs < 0

Uses int64, otherwise we're limited to ~260 days
2020-10-18 23:44:47 +02:00
def 3d94f9c7af Finish chat msg: Add comment 2020-10-18 17:57:27 +02:00
def 0748ad7a6b Finish time in HUD: Show hours 2020-10-18 17:57:02 +02:00
bors[bot] b3769a069c
Merge #3132
3132: Fix halloween logic r=def- a=ChillerDragon

Logic woopsie in https://github.com/ddnet/ddnet/pull/3116

Co-authored-by: ChillerDragon <chillerdragon@gmail.com>
2020-10-18 08:36:42 +00:00
ChillerDragon c81eb50b50 Fix halloween logic 2020-10-18 10:26:52 +02:00
bors[bot] 91773cd991
Merge #3116
3116: Show halloween skins only on Halloween r=heinrich5991 a=def-

Making use of the skin downloader.

Skin choice is based on your name, only active on October 31 and November 1 with events 1 in settings

Co-authored-by: def <dennis@felsin9.de>
2020-10-18 00:33:47 +00:00
bors[bot] 3fb24f75cb
Merge #3127
3127: Also compile glew.c with GLEW_STATIC r=def- a=Learath2

This should fix the warnings when linking to glew on windows

Co-authored-by: Learath2 <learath2@gmail.com>
2020-10-17 22:11:54 +00:00
bors[bot] 2edec49c2f
Merge #3126
3126: Revert "Make GL 1.5 default" r=Learath2 a=def-

As discussed with Lerath2, we should try to debug

This reverts commit 537f47d11d.

Co-authored-by: def <dennis@felsin9.de>
2020-10-17 21:54:40 +00:00
Learath2 be834b553f Also compile glew.c with GLEW_STATIC 2020-10-17 23:53:08 +02:00
def ad3bc98578 Revert "Make GL 1.5 default"
As discussed with Lerath2, we should try to debug

This reverts commit 537f47d11d.
2020-10-17 23:34:16 +02:00
bors[bot] 54c7a5bba5
Merge #3108
3108: Make GL 1.5 default r=def- a=Jupeyy

If ppl see white textures its related to
#2125
and you need to revert it, bcs thats not fixable, there is no extension for GL_GENERATE_MIPMAP or smth

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-17 21:09:11 +00:00
bors[bot] fa0bdee804
Merge #3123
3123: Add workaround for CMake 2.8. Fix version caching r=def- a=Learath2



Co-authored-by: Learath2 <learath2@gmail.com>
2020-10-17 21:02:07 +00:00
Learath2 ceefe305ec Add workaround for CMake 2.8. Fix version caching 2020-10-17 18:50:26 +02:00
Learath2 ba7b95f7ad Revert #3066
This reverts commits:
	a2b3f45f8b
	26a07c804f
2020-10-17 17:32:52 +02:00
bors[bot] b93896b37c
Merge #3112
3112: Fix and change text cursor r=def- a=Jupeyy

Pls check if u like the new cusor and if it works now
fixes #3110

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-17 15:00:57 +00:00
def 08045f6bd9 Only assign skin when non-Halloween skin has been chosen 2020-10-17 16:58:47 +02:00
Jupeyy 186206d40c Fix and change text cursor 2020-10-17 15:26:33 +02:00
bors[bot] 996270af18
Merge #3120
3120: Embed map sounds by default r=heinrich5991 a=Patiga

Not one ddnet map has a external map sound since there are none which would work that way

Co-authored-by: Patiga <dev@patiga.eu>
2020-10-17 13:16:55 +00:00
Patiga 17e531374c Embed sounds by default 2020-10-17 14:05:06 +02:00
def ae90bdf3f9 Show halloween skins only on Halloween
Making use of the skin downloader.

Skin choice is based on your name, only active on October 31 and November 1 with events 1 in settings
2020-10-17 12:10:56 +02:00
def 28250897d3 Version 15.1.3 2020-10-15 18:59:17 +02:00
Jupeyy 537f47d11d Make GL 1.5 default 2020-10-15 18:47:06 +02:00
bors[bot] 5a8fe3d2b4
Merge #3105
3105: Optimize nameplate rendering. Fix #3103 r=def- a=Learath2

Removes the unnecessary `SnapFindItem` (which is a linear search, ew)

Co-authored-by: Learath <learath2@gmail.com>
2020-10-15 14:29:25 +00:00
Learath 85f385b37b Optimize nameplate rendering. Fix #3103 2020-10-15 15:35:25 +02:00
bors[bot] 9e060d78b0
Merge #3100
3100: Fix offline client that is not in menu r=heinrich5991 a=Jupeyy

E.g. popups like "ddnet-info.json" failed will cause weird NaN glitches, bcs the impl relys on ChangePosition to clean movetime and animation start

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-14 21:54:46 +00:00
bors[bot] 09549ebc85
Merge #3101
3101: Fix hookchains r=heinrich5991 a=Jupeyy

Its already increased by the for loop.
Might have made the hook shorter(for very very long hooks) the past 3 years xd

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-14 21:47:21 +00:00
bors[bot] 66248efa61
Merge #3102
3102: Update ddmax_freeze (by saltyElefant, fixes #3098) r=heinrich5991 a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-10-14 21:35:06 +00:00
bors[bot] 6ed79fff5f
Merge #3099
3099: Add missing UpdateRenderInfo call r=def- a=Jupeyy



Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-14 21:27:28 +00:00
bors[bot] 3fdfe7ea2d
Merge #3054
3054: Remove CRC in all possible places r=def- a=heinrich5991

Some places remain due to net/file format compatibility.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-10-14 21:20:53 +00:00
def 34c4166263 Update ddmax_freeze (by saltyElefant, fixes #3098) 2020-10-14 23:15:41 +02:00
Jupeyy ca645bf53e Fix hookchains 2020-10-14 23:03:14 +02:00
Jupeyy 6eb6fad867 Fix offline client that is not in menu 2020-10-14 22:10:48 +02:00
Jupeyy fd0848291d Add missing UpdateRenderInfo call 2020-10-14 19:00:39 +02:00
heinrich5991 a604d913ce Move ghost code to client
It's not used by the server, so there's no reason to put it into the
shared codebase.
2020-10-14 17:08:58 +02:00
heinrich5991 070504b5c8 Update ghost format to v6: Replace CRC with SHA256
To be friendly to other implementors of the format, the CRC field is now
zeroed out instead of completely gone.

Drop support for v2 and v3 of the ghost format, the ghost files should
have been automatically converted by the client already.
2020-10-14 17:08:58 +02:00
heinrich5991 6ff53358d3 Remove code for CRC in most places, except where needed for net compat
This should path the way to remove it altogether in the future.
2020-10-14 17:08:58 +02:00
bors[bot] 812c5c17b9
Merge #3076
3076: Add clang-tidy to CI and enable clang-analyzer checks (supersedes #3075, fixes #3071) r=heinrich5991 a=def-

> 470 warnings treated as errors

The actual work will be fixing those or at least NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) them so we can enable this.

```
$ cmake -GNinja -DWEBSOCKETS=OFF -DMYSQL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVIDEORECORDER=ON -DAUTOUPDATE=OFF -DANTIBOT=OFF -DUPNP=OFF -DPREFER_BUNDLED_LIBS=OFF -DINFORM_UPDATE=OFF -DCMAKE_CXX_CLANG_TIDY=clang-tidy -DCMAKE_C_CLANG_TIDY=clang-tidy .
$ ninja > out
$ grep clang-analyzer out | sed -e "s/.* \[/\[/" | sort | uniq -c | sort -n -r
    477 [clang-analyzer-optin.cplusplus.VirtualCall]
     37 [clang-analyzer-optin.cplusplus.UninitializedObject]
     25 [clang-analyzer-optin.performance.Padding]
     20 [clang-analyzer-deadcode.DeadStores]
      9 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
      7 [clang-analyzer-optin.portability.UnixAPI]
      6 [clang-analyzer-security.insecureAPI.strcpy]
      4 [clang-analyzer-core.CallAndMessage]
      4 [clang-analyzer-security.FloatLoopCounter]
      3 [clang-analyzer-core.UndefinedBinaryOperatorResult]
      2 [clang-analyzer-core.uninitialized.Assign]
      1 [clang-analyzer-unix.Malloc]
      1 [clang-analyzer-cplusplus.NewDeleteLeaks]
      1 [clang-analyzer-cplusplus.NewDelete]
      1 [clang-analyzer-core.NonNullParamChecker]
```

Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: def <dennis@felsin9.de>
2020-10-14 14:07:28 +00:00
def 7f38bc0941 Fix clang-analyzer-core.uninitialized.Assign
/media/ddnet/src/engine/shared/dilate.cpp:32:22: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
2020-10-14 15:45:47 +02:00
def 87b06d307f Fix clang-analyzer-core.UndefinedBinaryOperatorResult
/media/ddnet/src/game/client/animstate.cpp:54:27: warning: The left operand of '*' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
        pSeq->m_X += pAdded->m_X * Amount;
                                 ^
2020-10-14 15:45:47 +02:00
def 6443e708b5 Fix clang-analyzer-core.CallAndMessage
/media/ddnet/src/game/editor/auto_map.cpp:94:17: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
                                int RunID = pCurrentConf->m_aRuns.add(NewRun);
                                            ^
2020-10-14 15:45:47 +02:00
def 0867424749 Fix clang-analyzer-security.insecureAPI.strcpy
/media/ddnet/src/engine/server/sql_string_helpers.cpp:74:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
2020-10-14 15:45:47 +02:00
def 98d4baabed Fix clang-analyzer-core.NonNullParamChecker
/media/ddnet/src/game/server/entities/projectile.cpp:201:37: warning: Forming reference to null pointer [clang-analyzer-core.NonNullParamChecker]
                                        Found = GetNearestAirPosPlayer(pTargetChr->m_Pos, &PossiblePos);
                                                                       ^
2020-10-14 15:45:47 +02:00
def 5c1b8cd221 Fix clang-analyzer-deadcode.DeadStores
/media/ddnet/src/game/client/components/statboard.cpp:288:3: warning: Value stored to 'tw' is never read [clang-analyzer-deadcode.DeadStores]
2020-10-14 15:45:47 +02:00
def 7c86dd8e5c Fix external directory in .clang-tidy 2020-10-14 15:45:47 +02:00
def a4f13ed4a8 Fix clang-analyzer-optin.portability.UnixAPI
and mark some false positives

/media/ddnet/src/engine/client/backend_sdl.cpp:329:30: warning: Call to 'malloc' has an allocation size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
2020-10-14 15:45:43 +02:00
def 469888e156 array: Don't allocate size 0
/media/ddnet/src/game/editor/auto_map.h:30:9: warning: Use of zero-allocated memory [clang-analyzer-cplusplus.NewDelete]
        struct CIndexRule
               ^
2020-10-14 14:54:33 +02:00
def 911cb5cb9b CAutoMapper: Delete pUpdateLayer
/media/ddnet/src/game/editor/auto_map.cpp:433:1: warning: Potential leak of memory pointed to by 'pUpdateLayer' [clang-analyzer-cplusplus.NewDeleteLeaks]
}
^
2020-10-14 14:54:33 +02:00
def 476ac6951f Fix memory leak in lock_create
/media/ddnet/src/base/system.c:805:3: warning: Potential leak of memory pointed to by 'lock' [clang-analyzer-unix.Malloc]
2020-10-14 14:54:33 +02:00
def 7d476c3858 Fix clang-analyzer-security.FloatLoopCounter
[81/219] Building CXX object CMakeFiles/game-shared.dir/src/game/collision.cpp.o
/media/ddnet/src/game/collision.cpp:1197:2: warning: Variable 'f' with floating point type 'float' should not be used as a loop counter [clang-analyzer-security.FloatLoopCounter]
        for(float f = 0; f < d; f++)
        ^
2020-10-14 14:54:33 +02:00