Commit graph

188 commits

Author SHA1 Message Date
yangfl 1620fc9b0f Fix typo 2018-02-07 16:10:40 +08:00
heinrich5991 94acac91a0 Overhauled job system
The engine now takes `std::shared_ptr<IJob>`, this will ensure the
appropriate lifetime of the given parameters, it also allows for proper
destruction. Remove the now obsolete `IFetcher` interface and `CFetcher`
class.

Also adds some locks to `CUpdater`, previously it didn't have any locks
at all.
2017-11-23 15:47:38 +01:00
bors[bot] 5528cde5f6 Merge #869
869: Complete rework of the ghost and race recorder r=Learath2 a=Redix

This PR fixes a lot of issues with the ghost and race recorder, introduces a new ghost file format and implements some pretty useful features.

**A quick overview:**
 - When you cross the start line multiple times, both (ghost and recorder) will only restart if it is a non-solo server
 - If available, both will use the race timer to recognize the start instead of searching for the start line
 - Fastcap support for both
 - The recorder immediately starts when the Tee spawns, so the preparation steps (which are quite important for speedruns) will be included in the demo. If you do not cross the start-line within 20 seconds, it will stop the demo until you really start.
 - Better ghost menu (colors, reloading, deleting and saving ghosts)
 - The ghosts are more resistant against lags (old ones were sometimes completely useless due to small lags)
 - New ghosts files are significantly smaller
 - Cleanup, bugfixes..


**About the new ghost format (version 4/5):**
This format is used by Teerace for over a year now. The code for handling the binary files was moved to the engine. It includes an auto updater which creates a backup of all ghosts and converts them to the new format afterwards. The major differences from the format used by DDNet right now (version 2), are the ability to store multiple types of data, the usage of delta-encoding and a more portable header.

For whatever reason, the ghost stores values for every predicted tick, but without tick information, so lost snapshots can make them unusable. The new code uses the original values from the snapshots including ticks but it can also handle the old ones without. Since hardly any server uses the high bandwidth option this practically reduces the file size.

Like the demo recorder the ghost recorder directly stores the data to a file (every 50 snapshots) instead of writing the whole file at the end of the race. Indeed this can be changed with only a few lines if the old behavior is preferred.

The updater can handle version 2 (DDNet) and 3 (old teerace format, only slightly different from version 2) files. The updating already happens when the files are scanned for generating the list in the menu and not only when you activate them. The change from version 4 to 5 was only needed due to a bug in the implementation, the ghost loader can read both.

Some numbers about the file size: (map: hotrun, both about 30 seconds)

 - Old ghost: 30.4 kB (converted: 10.7 kB)
 - New ghost: 5.4 kB


**One thing about the race recorder:**
The old implementation compared the new file only with the first file it found for the particular map. The new one compares with all related demos and deletes them possibly, so that only the best demo is left. Since DDNet can also store the demos without name, this might also delete demos from other players, that you might have in your directory.
To prevent this I at least check whether the demo contains the player name if `cl_demo_name` is on. 
In my opinion the better solution would be to remove `cl_demo_name` and always use the player name.
2017-10-30 20:27:10 +00:00
Redix de1c0cf24d Fixed several issues with the ghost (thanks to Learath2) 2017-10-28 14:23:24 +02:00
Learath2 9bce7e8630 Use a proper interface for CFetchTask 2017-10-09 18:47:02 +02:00
Redix e9a0271c29 Improved ghost and race recorder file handling 2017-09-28 19:13:20 +02:00
Redix ac234ad3ee Write the correct player name into ghosts that are saved from menu 2017-09-28 16:01:59 +02:00
Redix 5b3e9e4bbf Improved ghost file management 2017-09-28 16:01:58 +02:00
Redix 5cc0d16029 Reworked the race recorder 2017-09-28 16:01:57 +02:00
Redix c189678e44 Cleaned up the ghost component and made it use the ghost recorder and loader 2017-09-28 16:01:56 +02:00
def 89ed22e8d8 Introduce ddnet-info.json
- Single json file containing all information for the client
- Fetched from https://info.ddnet.tw/info?name=deen
- Replaces versionsrv, news, ddnet-maps.json and ddnet-ranks.json
- Servers are sorted by most popular ones for respective player
- Always stays < 100 ms response time, compared to occasional 50 s for
  old ddnet-ranks.json
2017-09-03 17:42:04 +02:00
def 16f3ddc5a7 Show if user has rank on map in browser (+filter)
UI implementation by timakro
2017-08-30 21:34:04 +02:00
def fba3815ddc Only send password on connection when explicitly asked to (fixes #788) 2017-07-15 17:29:20 +02:00
def f3e3d57a90 Always close files, cleaner demo recording, fix some other stuff 2017-07-08 13:39:20 +02:00
SheikhZayx ea0e4948b4 CSV file instead of statboard screenshot
En-/Disable statboard being saved as csv
2017-04-26 05:10:31 +02:00
heinrich5991 1d81d56850 Introduce new, vanilla-compatible server info protocol
This means that we have a reliable and fast way to query for extended info,
while also not wasting network bandwidth.

The protocol is designed to be extensible, there's four bytes space for
encoding more request types (currently zeroed), and there's one string in each
response packet and one string for each player available (currently the empty
string).

The protocol itself has no problems with more than 64 players, although the
current client implementation will drop the player info after the 64th player,
because it uses a static array for storage.

Also fixes #130, the player list is just sorted each time new player info
arrives.
2017-03-29 12:56:13 +02:00
Learath2 4101acd747 Add rcon_login 2017-03-06 10:31:05 +01:00
heinrich5991 e3f2316106 Revert "Revert "Refactor dummy input and demo filtering""
This reverts commit 187560c8c0.
2017-02-28 10:08:14 +01:00
Dennis Felsing 187560c8c0 Revert "Refactor dummy input and demo filtering"
This reverts commit 8375f4888e.
2017-02-28 08:15:35 +01:00
heinrich5991 8375f4888e Refactor dummy input and demo filtering
Remove references to src/game/ from src/engine/
2017-02-23 14:13:14 +01:00
heinrich5991 7ca2697135 Generate server-specific timeout codes
This way, servers can no longer hijack the timeout codes of clients.
Timeout codes are generated from md5(seed + dummy + server address).

If `cl_timeout_seed` is set to the empty string, the old config options
are used instead.
2016-10-02 11:36:42 +02:00
BannZay 66c44cea79 MAX_PATH_LENGTH instead of pure magick 2016-09-05 18:54:35 +03:00
BannZay c658411f15 Load Current Map button added 2016-08-23 14:29:53 +03:00
Ryozuki 82d2a994ed Fixed cl_showping (now cl_showpred) 2016-05-05 18:07:00 +02:00
def 21ac41bfae Clean up fifo console 2016-05-02 23:36:21 +02:00
def 981533e177 More mouse fixes with SDL2 2016-05-01 15:20:52 +02:00
def 7a5b79e48a More SDL2 graphics goodness, partially from TW master 2016-04-30 00:43:11 +02:00
def ccbdf1d073 Add demo_speed command (fixes #354) 2016-04-27 17:21:40 +02:00
def 0f5611c2f0 Add function to filter chat out of demo when slicing (fixes #382) 2016-04-27 17:05:30 +02:00
def 52224875b4 Style cleanup 2016-01-23 21:44:45 +01:00
Adam Jaworski 41620b1a36 Con_DemoPlay instead of Con_PlayDemo and demo_play instead of playdemo 2015-08-12 14:26:48 +02:00
Adam Jaworski 8d4aea8a00 Added: playdemo command to start demo via console, bindable 2015-08-12 11:59:34 +02:00
def e97c8ac08f Add foes (permanently ignored players) 2015-07-22 22:16:49 +02:00
def 76e4ca1bf6 Sort players in scoreboard by name too 2015-07-10 22:26:55 +02:00
def 6e8ada1ac8 Fix whitespaces a bit 2015-07-09 02:12:35 +02:00
Nikita Zyuzin 245ebccd7b Add initial detailed stats board code 2015-05-20 02:51:02 +04:00
def 8f02de318b Make dummy connecting a bit nicer: Show that dummy is being connected, disable unusable buttons 2015-04-19 14:40:05 +02:00
def a77cd039a6 Get rid of all Clang warnings 2015-04-18 22:29:28 +02:00
def 710a786f88 Rename AutoUpdater to Updater because you have to press a button now 2015-04-18 21:17:27 +02:00
def 8ae27f81b6 Improve autoupdater a bit
- Only ask for restart when we're ingame or unsaved changes in editor
- Otherwise restart directly
2015-03-14 16:10:46 +01:00
def ba4f961594 Some more autoupdater changes and a button to check for autoupdates 2015-03-14 10:45:11 +01:00
Learath Lea 0f279a33cb Add restart functionality. 2015-02-23 20:25:03 +02:00
Learath Lea 233ce262ac Add Autoupdate. 2015-02-23 20:23:56 +02:00
Learath 09ce649238 First get rid of the old autoupdate
Conflicts:
	src/engine/client/client.cpp
	src/engine/client/client.h

Conflicts:
	src/engine/shared/config_variables.h
2015-02-23 20:23:35 +02:00
Tobii b309fd41eb Added copy moves function for dummy 2015-02-16 11:19:42 +01:00
Learath 340e79904d Added fetcher interface.
Make fetcher client only and move Task class from interface.

Fix queue logic, add destructor.
LEAN_AND_MEAN moved up to prevent curl including the whole winapi

Remove JobNo, Fix callback, Cleanup debug messages.

Fix include guard

Copy the Url and Destination. Delete pTask.

Fix typo

Add Completion callback

Let the user pass context

Add virtual to inherited funcs

Use 0 instead of NULL

Give fetcher the ability to create folders. Fix couple of small bugs.

Added .lib files for MSVC.

Leave user the allocation of CFetchTask. Get rid of unnecessary cb
arguments.

Get the HTTP return code from libcurl.

Incorperate the storage system.

Fail on HTTP error >= 400.

Add more info to the task.

Add blocking way of getting HTTP resp code.
Remove resp code from normal tasks as we fail >= 400 anyways.

Sleep instead of killing the thread

Forgot one instance of respcode.

Provide HTTP download for maps.

Dont check 404 first.
2015-01-19 22:14:52 +01:00
nuborn 03bc769c09 prediction of hammer (hits) and grenade (explosions) 2014-12-01 01:31:58 +01:00
def d3797289c1 Revert "improve antiping for weapons (particularly in vanilla) by taking into account more of the info already available to the client"
This reverts commit 56036dcd7b.
2014-11-02 10:58:21 +01:00
nuborn 56036dcd7b improve antiping for weapons (particularly in vanilla) by taking into account more of the info already available to the client 2014-10-28 21:13:55 +01:00
def 1144ba77c6 Split up demo recording into 3 separate recorders 2014-10-16 17:42:13 +02:00
def 607a27718e Revert "Removed InputData Array"
This reverts commit 83f6fc70fa.
2014-10-12 17:52:53 +02:00
Tomew 83f6fc70fa Removed InputData Array 2014-10-12 17:19:09 +02:00
east 603727232a ddnet server list zlib compression added 2014-09-20 11:36:46 +02:00
east cda02a3d9a versionsrv serverlist download added 2014-09-20 00:36:22 +02:00
east 070ebe2895 merge fixed 2014-08-23 17:57:32 +02:00
east 8624d0a747 DemoPlayer: Save dialog added 2014-08-23 17:48:04 +02:00
def 2cff296c25 Protect from IP spoofing of rcon commands 2014-08-22 13:54:13 +02:00
def 0916d8aba5 Fix timeout code stuff 2014-08-17 19:19:40 +02:00
def 1c4fac8afd Display map name while downloading 2014-08-16 01:06:17 +02:00
east 65b2426349 CDemoEditor: added new buttons to demo player 2014-08-13 16:35:15 +02:00
def 5436e45e2f Use another connection (with a truly random port) to request connection infos 2014-08-13 12:03:53 +02:00
east 64810cf11c worked on CDemoEditor 2014-08-12 16:21:06 +02:00
def 7875c2ec36 Android support (by Pelya) 2014-06-16 13:29:18 +02:00
def 5b1c866b35 Feature: Separate inputs for dummy and player 2014-05-10 14:31:00 +02:00
def 0d5790b8cd No more Connection Problems on dummy connect 2014-05-09 16:46:04 +02:00
def 9ae6ce7097 Fix: You still receive whispers and team messages for dummy 2014-05-07 03:34:21 +02:00
def c316c3f5a3 Fix: Better dummy behaviour on switches 2014-05-03 23:28:48 +02:00
def 820926d836 Store dummy snapshots for better dummy switching 2014-05-03 20:24:45 +02:00
HMH addfe47d4c fix correct dummy-tunings now 2014-05-03 02:44:28 +02:00
def 873d17ceed Fix: Dummy stop hammering immediately when cl_dummy_hammer is toggled off 2014-04-30 17:51:34 +02:00
def 7a5f32f155 Add hammerfly for dummies 2014-04-28 22:12:50 +02:00
def 82abac307a More dummy fixes 2014-04-28 20:43:08 +02:00
def a7862a200f Fix: Map changing with dummy 2014-04-28 19:36:08 +02:00
def 8687fd1317 Less lags on dummy switch 2014-04-28 17:26:31 +02:00
def 9f509eeedb Fix: Dummy setting updates 2014-04-28 15:19:57 +02:00
def 085fea62b6 More Mac fixes 2014-04-28 01:00:02 +02:00
def 3bbc2c4ef7 Fix dummy issues 2014-04-27 13:44:04 +02:00
def 7bcc51d488 Basic updating (thanks to unsigned char* 2014-04-27 05:01:03 +02:00
def 5345bb6273 Fix dummy bugs 2014-04-26 21:10:39 +02:00
def 3dce4c9489 Add dummy (Thanks to //toast and Monsta) 2014-04-26 20:29:42 +02:00
def 3ca4514d21 Fix: Editor, Debug mode always open immediately 2014-01-31 01:41:57 +01:00
def 3eaad43b6b Merge remote-tracking branch 'upstream-teeworlds/0.6' into DDRace
Conflicts:
	bam.lua
	data/languages/index.txt
	src/engine/server/server.cpp
	src/engine/shared/network_server.cpp
	src/game/client/components/chat.cpp
	src/game/client/components/menus_settings.cpp
	src/game/server/entities/character.cpp
	src/game/server/gamecontext.cpp
	src/game/version.h
2013-12-26 18:02:22 +01:00
def 6d26e07e1f Single config variable for background color without quads 2013-07-11 17:13:45 +02:00
oy b7e5bb54ad fixed semaphore on macosx 2013-02-24 17:35:51 +01:00
GreYFoX cd4ba53bae Merge branch 'master' of git://github.com/teeworlds/teeworlds into DDRace
Conflicts:
	bam.lua
	scripts/build.py
	scripts/make_release.py
	src/engine/server.h
	src/game/client/gameclient.cpp
	src/game/server/gamecontext.cpp
	src/game/server/gamecontext.h
	src/game/server/gamecontroller.cpp
	src/game/server/gamecontroller.h
	src/game/server/player.cpp
	src/game/version.h
2012-04-12 02:09:31 +02:00
oy fa81141110 added demo markers by Choupom. Closes #837 2012-01-10 23:13:19 +01:00
GreYFoX c46f3e06e7 Merge branch 'master' of git://github.com/oy/teeworlds into DDRace 2012-01-04 20:10:07 +02:00
Magnus Auvinen c1942ca6cb fixed the render frame time and cleaned up some more code 2012-01-01 13:38:46 +01:00
Magnus Auvinen 8ffe582615 ugly incomplete hack to put the rendering into another thread so we don't have to wait for the flip 2011-12-30 16:02:22 +01:00
GreYFoX 5b27758650 Removed level stuff
Removed client ID stuff
Removed console stuff
Resolved merge conflicts
Upgraded Banmaster
Cleaned up
2011-08-13 02:11:06 +02:00
GreYFoX 35d16bd58c Merge branch 'master' of git://github.com/oy/teeworlds into DDRace0611
Conflicts:
	src/engine/console.h
	src/engine/server.h
	src/engine/server/server.cpp
	src/engine/shared/config_variables.h
	src/engine/shared/console.cpp
	src/engine/shared/console.h
	src/engine/shared/network_server.cpp
	src/game/client/components/console.cpp
	src/game/client/components/console.h
	src/game/client/components/menus_browser.cpp
	src/game/client/gameclient.cpp
	src/game/editor/editor.cpp
	src/game/editor/editor.h
	src/game/editor/io.cpp
	src/game/editor/layer_tiles.cpp
	src/game/editor/popups.cpp
	src/game/gamecore.cpp
	src/game/mapitems.h
	src/game/server/entities/character.cpp
	src/game/server/entities/laser.cpp
	src/game/server/gamecontext.cpp
	src/game/server/gamecontroller.cpp
	src/game/server/gamecontroller.h
	src/game/server/gamemodes/ctf.cpp
	src/game/server/player.cpp
	src/game/variables.h
2011-08-13 02:01:40 +02:00
Johannes Loher e2664c1b00 Added server sided automatic demo recording 2011-07-30 18:23:59 +02:00
oy 571dff6216 made rcon auto completion serverside. Closes #97 2011-07-14 22:07:21 +02:00
oy e37d536fdf fixed some NETTYPE usage based on the socket state 2011-07-07 01:48:00 +02:00
GreYFoX f7f6058a92 Merged Oy, Cleaned up, removed some useless features and code parts
Added Icon by landil
alot more...
2011-04-09 22:32:17 +02:00
oy 4ad6d2f01e fixed problem with sv_bindaddr on the server 2011-04-04 18:20:05 +02:00
oy 04a3b7be00 fixed problem with recorded demo files. Closes #570 2011-04-02 11:55:37 +02:00
oy 2a72c0b38b added a mechanism to check for a valid standard map. Closes #132 2011-03-31 15:13:49 +02:00
oy 7bd79f9f43 added remove_favorite command by Choupom 2011-03-27 18:05:11 +02:00
oy ae325c873f added friends feature. Closes #24 2011-03-23 13:06:35 +01:00