Commit Graph

514 Commits (43980639de7bd654a20982830798927b88d195d6)

Author SHA1 Message Date
Jonathan G Rennison 43980639de Merge branch 'master' into jgrpp
# Conflicts:
#	.gitignore
#	CMakeLists.txt
#	src/3rdparty/optional/optional.hpp
#	src/group_cmd.cpp
#	src/industry_cmd.cpp
#	src/misc_gui.cpp
#	src/video/sdl2_v.cpp
3 years ago
Patric Stout d15dc9f40f Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.

Co-authored-by: milek7 <me@milek7.pl>
4 years ago
Jonathan G Rennison bbbda0739b Add third DoCommand parameter p3 4 years ago
Jonathan G Rennison 4763f441f6 On load, use previous local company or first usable company
Instead of always using the first company slot
4 years ago
Jonathan G Rennison ef7e658dee Network: Remove static buffer form of NetworkAddress::GetAddressAsString
This is used in multiple threads concurrently
4 years ago
Jonathan G Rennison 8fb0b638fa Merge branch 'master' into jgrpp
# Conflicts:
#	src/network/network.cpp
4 years ago
Quipyowert2 d1b7eb2de1 Codechange: Limit field width to avoid sscanf crash 4 years ago
Jonathan G Rennison babe98cdb1 Merge branch 'master' into jgrpp
# Conflicts:
#	src/network/network_server.h
#	src/pathfinder/yapf/yapf_road.cpp
#	src/viewport.cpp
4 years ago
Bjarni Thor 5880f1479f Feature #7756: Allow server to supply a reason to kicked/banned clients
This commit adds the missing feature of allowing the server owner to
    provide a reason for kicking/banning a client, which the client sees in
    a pop-up window after being kicked. The implementation extends the
    network protocol by adding a new network action called
    NETWORK_ACTION_KICKED that is capable of having an error string, unlike
    the other network error packages.  Additionally, the kick function
    broadcasts a message to all clients about the kicked client and the
    reason for the kick.
4 years ago
Jonathan G Rennison 7960db35f2 Merge branch 'master' into jgrpp
# Conflicts:
#	config.lib
#	projects/openttd_vs140.vcxproj
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj
#	projects/openttd_vs142.vcxproj.filters
#	src/aircraft_cmd.cpp
#	src/base_station_base.h
#	src/core/pool_type.hpp
#	src/disaster_vehicle.cpp
#	src/economy.cpp
#	src/engine.cpp
#	src/group.h
#	src/group_cmd.cpp
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/network/network_command.cpp
#	src/network/network_server.cpp
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/road_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/cargopacket_sl.cpp
#	src/saveload/linkgraph_sl.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/station_sl.cpp
#	src/saveload/town_sl.cpp
#	src/saveload/vehicle_sl.cpp
#	src/screenshot.cpp
#	src/screenshot.h
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/station.cpp
#	src/station_cmd.cpp
#	src/table/settings.ini
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train.h
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehiclelist.cpp
#	src/window_type.h
4 years ago
glx e3c75a30ba Fix: unused variable warnings 5 years ago
glx 41232f18c1 Codechange: Replace network related FOR_ALL with range-based for loops 5 years ago
Jonathan G Rennison cbdd9f84d8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_gui.cpp
#	src/lang/korean.txt
#	src/video/sdl2_v.cpp
#	src/video/sdl2_v.h
#	src/window.cpp
#	src/window_gui.h
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jonathan G Rennison ec892879f4 Add passworded mechanism to change server game settings from client 5 years ago
Jonathan G Rennison a1d36b02f0 Network: Add state checksum which is check in network sync 5 years ago
Jonathan G Rennison c941d2d2a6 Desync: Change sync event logging to desync debug level 2 5 years ago
Jonathan G Rennison 002f5ca70e Adjust desync log format and add company events to log 5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison f5747bf753 Merge branch 'master' into jgrpp
# Conflicts:
#	src/genworld_gui.cpp
#	src/group_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/toolbar_gui.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 5 years ago
Jonathan G Rennison ba34ec7ade Merge branch 'master' into jgrpp
Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
peter1138 07de9d6c3f Codechange: Use override keyword in networking classes. 5 years ago
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
5 years ago
Niels Martin Hansen 830ed6be61 Fix: Do not mangle tagged revision strings for network revision strings 5 years ago
Niels Martin Hansen 5f8354f358 Change: Make a shortened network revision string for use in server queries 5 years ago
Jonathan G Rennison 940314a3c7 Use std::string for CommandContainer text instead of giant static buffer
Use move semantics for CommandContainer instance where feasible
6 years ago
Jonathan G Rennison 6342099c4d Allow 256 NewGRFs in multiplayer
Add extended network format for server info
Add general UDP packet fragmentation system
Fix map dimensions >= 64k
Increase length of server revision string
Maintain backwards compatibility with trunk for advertisement/server listing
6 years ago
Jonathan G Rennison 54494a0a7c Merge branch 'send_money_company' into jgrpp 7 years ago
Jonathan G Rennison 9c74da46b1 Change send money to company messages to be broadcasts.
Adjust text formatting depending on whether current client is
the source, destination or neither.
7 years ago
Jonathan G Rennison 3001595916 Change chat arbitrary data field from an int64 to a struct. 7 years ago
Jonathan G Rennison 8e6569c11f Include tick skip counter in all desync debug output.
Change message format to make field identification easier.
Update desync message reader to support tick skip counter.
8 years ago
Jonathan G Rennison 66cd454c37 Merge branch 'day_length-sx' into jgrpp 9 years ago
Jonathan G Rennison f03cd98d04 Check/print tick skip counter in desync and random logging. 9 years ago
Jonathan G Rennison 531956bb4d Merge branch 'house_placing' into jgrpp 9 years ago
rubidium e8788019fa (svn r27400) -Fix [FS#6368] (r26449): when a dedicated server was paused with no clients the tick length was increased significantly, making any assumptions about the tick length used further down in the code are not true anymore. One of such assumptions was that one should readvertise every 15 minutes worth of original ticks, but due to the lengthening this timeframe would be more like 45-60 minutes. Now we'll take the operating system's millisecond counter instead 9 years ago
rubidium ff5c05c1b4 (svn r27400) -Fix [FS#6368] (r26449): when a dedicated server was paused with no clients the tick length was increased significantly, making any assumptions about the tick length used further down in the code are not true anymore. One of such assumptions was that one should readvertise every 15 minutes worth of original ticks, but due to the lengthening this timeframe would be more like 45-60 minutes. Now we'll take the operating system's millisecond counter instead 9 years ago
Jonathan G Rennison c6854afcef Pause the game instead of blocking when link graph jobs lag.
Check if the job is still running one date fract tick before it
is due to join and if so pause the game until its done.
This avoids the main thread being blocked on a thread join.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
9 years ago
frosch e00f4cac59 (svn r26788) -Add: Desync replay option to skip/replay failed commands 10 years ago
frosch e2f5081f40 (svn r26788) -Add: Desync replay option to skip/replay failed commands 10 years ago
frosch db45d979db (svn r26786) -Fix: Also replay failed commands. 10 years ago
frosch 937265d6d6 (svn r26786) -Fix: Also replay failed commands. 10 years ago
rubidium 7db8be4a1e (svn r26577) -Fix [FS#6001]: [Network] Client of non-dedicated server was not correctly put into the first company for all state variables 10 years ago
rubidium e64249446d (svn r26577) -Fix [FS#6001]: [Network] Client of non-dedicated server was not correctly put into the first company for all state variables 10 years ago
rubidium 034735a54c (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago