Commit Graph

34 Commits

Author SHA1 Message Date
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
mrmbernardi 35ef6c1723
Feature: [GS] Goal destination can be updated (#10817) 2023-06-08 18:00:31 +01:00
Rubidium 3342967ad9 Codechange: use std::string instead of stredup/free for goals 2023-05-01 16:23:24 +02:00
Rubidium 31869501ee Fix: make script goals work with the whole range of ClientIDs 2023-01-31 20:09:48 +01:00
Michael Lutz 57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 2021-12-16 22:28:32 +01:00
Michael Lutz e6e69d5289 Codechange: Un-bitstuff goal and story page commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
Patric Stout 2d9062bfc1 Fix: [Network] don't desync if client leaves before you finish downloading map
When you are downloading a map, all the commands are queued up
for you. Clients joining/leaving is done by the network protocol,
and as such are processed immediately. This means that by the
time you are processing the commands, a client that triggered
it, might already have left.

So, all commands that do something with ClientID, shouldn't
error on an invalid ClientID when DC_EXEC is set, but
gracefully handle the command anyway, to make sure the
game-state is kept in sync with all the clients that did
execute the DoCommand while the now-gone client was still
there.

Additionally, in the small chance a client disconnects between
the server validating a DoCommand and the command being
executed, also just process the command as if the client was
still there. Otherwise, lag or latency can cause clients that
did not receive the disconnect yet to desync.
2021-02-28 12:27:04 +01:00
dP 91cc414588 Feature: [GS] Allow non-question type windows to have no buttons 2021-02-14 23:21:43 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Pavel Stupnikov f14a69e52f
Fix a5681d3e: Make goal question ID use 16 bits again (#8072) 2020-04-10 10:05:52 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
dP 36e4bd4023 Fix: Make GSGoal.QuestionClient work correctly at least for clients with ID < 2**16 2019-07-14 13:32:08 +01:00
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
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.
2019-03-20 19:24:55 +01:00
Pavel Stupnikov 913119487f Feature: Add GS method to question a single client (#6748) 2018-04-28 17:37:59 +02:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch 20970da24a (svn r26382) -Fix [FS#5932] (r25372): All goal commands invalidated the goal list of company 0. 2014-02-27 21:53:14 +00:00
zuu 6fc653d2d7 (svn r26012) -Add: new goal type that show a story page when clicked 2013-11-16 17:41:57 +00:00
zuu 4e74a4c5cc (svn r25761) -Change: Disable story/goal buttons when there is no content to show instead of when there is zero companies 2013-09-13 12:45:25 +00:00
zuu a4cddc3e08 (svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed. 2013-05-26 19:54:43 +00:00
truebrain b601b057d4 (svn r23950) -Fix (r23731) [FS#5063]: never show GSGoal::Question() to spectators. Accidently INVALID_COMPANY == COMPANY_SPECTATOR 2012-02-15 15:18:38 +00:00
rubidium 9f162e7115 (svn r23827) -Feature [FS#4992]: [NoGo] Allow to chose the goal question window's title from a (small) set of options 2012-01-21 12:03:55 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain 34d90da509 (svn r23731) -Add: add GSGoal::Question(), to ask a question to a(ll) company(ies). It can contain random text, and at most 3 buttons from a collection of 17 2012-01-03 16:36:24 +00:00
truebrain 7702151a62 (svn r23665) -Fix (r23664): revert, and apply other fix, which allows switching companies safely in SinglePlayer 2011-12-23 23:34:19 +00:00
truebrain d6e88a7cab (svn r23664) -Fix: adding goals with a company were still added for all companies. Tnx to Zuu for reporting (although cryptic :D) 2011-12-23 23:29:59 +00:00
truebrain 3ada3b9cc5 (svn r23630) -Add: a Goal GUI to show your current goals 2011-12-19 21:03:17 +00:00