Commit graph

12307 commits

Author SHA1 Message Date
Alexander Akulich acfb541db9 DDrace GameController: Add GetPlayerTeam() 2021-01-16 03:20:58 +03:00
Alexander Akulich a14607f818 Introduce GameController::HandleCharacterTiles() 2021-01-16 03:20:58 +03:00
Alexander Akulich d924d9bf68 CCharacter: Extract ResetPickups() 2021-01-16 03:20:58 +03:00
Alexander Akulich 729262b896 GameController: Move the DDRace-specific code to the subclass
This leads to some small code duplication but let us remove the ugly casts.
2021-01-16 03:20:58 +03:00
Alexander Akulich 39938b6b2f Adjust the CGameControllerDDRace header file
- Reorder the methods as they're in the source file
- Move the member variables to the end (to later apply a special access-control)
- Mark Tick() override (we use C++11 and this is our own code)
2021-01-16 03:20:58 +03:00
Alexander Akulich cba66d96f2 CPlayer: Remove unused GameControllerDDRace include 2021-01-16 03:20:58 +03:00
Alexander Akulich 2191996254 CPlayer: Make the emote-related members private 2021-01-16 03:20:58 +03:00
Alexander Akulich 281186468f CPlayer: Correctly restore the default emote on override emote expired
We used to set EMOTE_NORMAL even on 'special' days ('events' config option).
2021-01-16 03:20:58 +03:00
Alexander Akulich f0e34c9c36 Move DefaultEmote logic into CPlayer 2021-01-16 03:20:58 +03:00
Alexander Akulich 4004fc093c CPlayer: Add missing reset for m_LastEyeEmote 2021-01-16 03:20:58 +03:00
Alexander Akulich 5a9af45f9a CPlayer: Rename EyeEmote to EyeEmoteEnabled (to be clear) 2021-01-16 03:20:58 +03:00
Alexander Akulich 2286771349 ConEyeEmote: Don't count the command if arguments not valid 2021-01-16 03:20:58 +03:00
Alexander Akulich 9197075654 Refactor the SetEmote code to remove custom CCharacter methods 2021-01-16 03:20:58 +03:00
Alexander Akulich b36a4fd8c3 Process CPlayer::m_DefEmoteReset in CPlayer 2021-01-16 03:20:58 +03:00
Alexander Akulich ecce5631ed Move Halloween emoticon to CPlayer and send it once per client
GameServer()->SendEmoticon() sends CNetMsg_Sv_Emoticon packet to everyone.

Calling SendEmoticon() from Character::Snap(ClientID) triggers as many
messages to everyone as there are active players.

Move the SendEmoticon() because it is not the Character (a world entity object)
responsibility to celebrate a day. Actually it is not CPlayer responsibility
either but CPlayer is the class where we deciding to celebrate (checking the
date) so at least let's keep the coupled stuff together.
2021-01-16 03:20:58 +03:00
Alexander Akulich 457f91ca8d CCharacter: Add GetLastAction() 2021-01-16 03:20:58 +03:00
Alexander Akulich 19234987c9 Backport IGameController::OnPlayerDisconnect() from the upstream
Upstream commit 5e4caa9b9c
2021-01-16 03:20:58 +03:00
Alexander Akulich 7512ad285b Backport IGameController::DoTeamChange from the upstream
Upstream commit 5e4caa9b9c
2021-01-16 03:20:58 +03:00
Alexander Akulich c4405c4811 GameController: Backport reorder from upstream
Upstream commit 5e4caa9b9c
2021-01-16 03:20:57 +03:00
Alexander Akulich e34f268bed Make CSaveTee and CPlayer not friends anymore 2021-01-16 03:20:57 +03:00
Alexander Akulich ffe3f110eb GameController: Extract DoActivityCheck()
Apply refactoring from the upstream.
2021-01-16 03:20:57 +03:00
Alexander Akulich 242aa63178 ddracechat.h is used by the client, so move it to src/game
where ddracecommands.h already is.
2021-01-16 03:20:57 +03:00
Alexander Akulich dfd60e6668 CGameContext: Remove ugly CGameControllerDDRace::m_Teams.Reset()
We called CGameControllerDDRace constructor on the previous line.
The CGameControllerDDRace invokes CGameTeams constructor which calls
Reset() on his own.

There is no chance how this can change anything.
2021-01-16 03:20:57 +03:00
Alexander Akulich 5d0bb4cf3c Backport vector functions cleanup from the upstream
Keep closest_point_on_line() as-is.

(commit 6b69f94dc8)
2021-01-16 03:20:57 +03:00
BeaR 9f0b0af862 Add angle<->direction conversion functions to vector math (Cleanup)
Keep angle() (ex. GetAngle()) as-is.

(cherry picked from commit 7735557aa5)
2021-01-16 03:20:57 +03:00
Alexander Akulich 59deb42252 CConfig: Use str_escape in EscapeParam() 2021-01-16 03:20:57 +03:00
bors[bot] 88fb027cb2
Merge #3510
3510: Work around Pylint import problem (fixes #3507) r=heinrich5991 a=def-

<!-- 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-01-16 00:06:06 +00:00
Dennis Felsing b20014efd3
Merge pull request #3515 from heinrich5991/pr_ddnet_fixstyle
Fix clang-style
2021-01-16 01:00:44 +01:00
heinrich5991 c2ed416f43 Fix clang-style 2021-01-15 23:59:48 +01:00
heinrich5991 b66e090425 Also display DDNet version for 0.7 clients 2021-01-15 22:39:18 +01:00
nobody-mb 46387373d1
show sixup in status (#3512)
* show sixup in status

* format sixup in status

* str_copy
2021-01-15 19:26:40 +01:00
Dennis Felsing c0cbef731b
Merge pull request #3506 from heinrich5991/pr_ddnet_moreprotocolex
Send the NETMSG_ITIS/NETMSG_IDONTKNOW from the correct connection
2021-01-15 15:03:43 +01:00
Dennis Felsing cc7ed06b8a
Merge pull request #3511 from edg-l/pr-ddnet-info-tmp
remove ddnet info tmp file always when quitting
2021-01-15 15:03:16 +01:00
Edgar 4344f46d1c
only delete it if exists 2021-01-15 12:27:01 +01:00
Edgar 98554be75d
move tmp file deletion before the break 2021-01-15 12:14:14 +01:00
Edgar 066b3a3f78
remove ddnet info tmp file always when quitting 2021-01-15 12:07:16 +01:00
def 1728c88949 Work around Pylint import problem (fixes #3507) 2021-01-15 09:27:41 +01:00
Dennis Felsing b943ca1e0c
Merge pull request #3509 from Zwelf/pr-fix-memory-leak-sqlite3
Fix memory leak in SQLite3 print statement
2021-01-15 09:09:54 +01:00
Zwelf 0aed8cf8eb Fix memory leak in SQLite3 print statement
https://www.sqlite.org/c3ref/expanded_sql.html
2021-01-14 19:47:01 +01:00
Dennis Felsing 8c392ee51c
Merge pull request #3503 from def-/pr-hook-symbol
Differentiate hook number by showing symbol
2021-01-13 18:05:04 +01:00
heinrich5991 802a5439c2 Send the NETMSG_ITIS/NETMSG_IDONTKNOW from the correct connection
Noticed after #3505, thanks @fokkonaut.
2021-01-13 17:15:24 +01:00
bors[bot] bf1707274f
Merge #3505
3505: Fix dummy not sending DDNet version r=def- a=fokkonaut

<!-- 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
- [ ] 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: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
2021-01-12 16:13:08 +00:00
fokkonaut 7e169d92e5 Fix dummy not sending DDNet version 2021-01-12 16:57:53 +01:00
def 39d06c5e85 Display median time instead of average (fixes #3399) 2021-01-12 14:24:38 +01:00
def dccbf26ca0 Differentiate hook symbol 2021-01-12 10:22:39 +01:00
heinrich5991 9784726683 Replace remaining non-extended extension messages
Add backward compatibility stuff, but this allows newer clients to only
care for new messages.
2021-01-12 01:48:10 +01:00
heinrich5991 0d916e2ef6 Remove F-Client-specific messages
The PLAYERFLAG_AIM can now be set directly on DDNet servers via the 0.7
bridge and will be sent to clients identifying themselves as DDNet
clients.

Add a new extended message that mirror the old `Sv_TeamsState`.
2021-01-12 01:38:23 +01:00
fokkonaut 9940a806fa Support for F-Client 2021-01-12 01:38:23 +01:00
bors[bot] 5d45f061fa
Merge #3498
3498: Make netclipping of entities and events respect shown distance (fixes #3420) r=heinrich5991 a=def-

<!-- 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
- [ ] 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-01-11 22:21:01 +00:00
def cbda5b720a Make netclipping of entities and events respect shown distance (fixes #3420) 2021-01-11 23:11:28 +01:00