Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug: Game does not compile when RANDOM_DEBUG or ENABLE_NETWORK_SYNC_EVERY_FRAME are defined #9624

Closed
JGRennison opened this issue Oct 18, 2021 · 0 comments

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

master

Expected result

Game compiles when RANDOM_DEBUG or ENABLE_NETWORK_SYNC_EVERY_FRAME are defined.
RANDOM_DEBUG is mentioned in COMPILING.md so could be considered non-internal.

Actual result

struct Packet has had many things done to it but the use guarded by ENABLE_NETWORK_SYNC_EVERY_FRAME has not been updated.

/home/jgr/openttd/trunk/src/network/network_client.cpp: In member function ‘virtual NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_FRAME(Packet*)’:
/home/jgr/openttd/trunk/src/network/network_client.cpp:861:9: error: ‘PacketSize Packet::pos’ is private within this context
  861 |  if (p->pos + 1 < p->size) {
      |         ^~~
In file included from /home/jgr/openttd/trunk/src/network/core/tcp.h:16,
                 from /home/jgr/openttd/trunk/src/network/core/tcp_coordinator.h:16,
                 from /home/jgr/openttd/trunk/src/network/network_internal.h:14,
                 from /home/jgr/openttd/trunk/src/network/network_client.h:13,
                 from /home/jgr/openttd/trunk/src/network/network_client.cpp:28:
/home/jgr/openttd/trunk/src/network/core/packet.h:49:13: note: declared private here
   49 |  PacketSize pos;
      |             ^~~
/home/jgr/openttd/trunk/src/network/network_client.cpp:861:22: error: ‘struct Packet’ has no member named ‘size’; did you mean ‘Size’?
  861 |  if (p->pos + 1 < p->size) {
      |                      ^~~~
      |                      Size

Steps to reproduce

Compile with CXXFLAGS="-DRANDOM_DEBUG" cmake ..

JGRennison added a commit to JGRennison/OpenTTD-patches that referenced this issue Oct 18, 2021
glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 19, 2021
glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 19, 2021
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant