Config
Log for #openttd.dev on 6th October 2012:
Times are UTC Toggle Colours
11:35:38  *** Webster has joined #openttd.dev
11:35:38  *** ChanServ sets mode: +v Webster
11:35:46  <frosch123> but i am not sure whether clients execute whatever they get from the server
11:35:57  *** Yexo has quit IRC
11:36:18  *** Terkhen has joined #openttd.dev
11:36:18  *** ChanServ sets mode: +v Terkhen
11:36:26  *** Yexo- is now known as Yexo
11:38:11  <Zuu> So this flag should be allowed to be sent from server to clients but not the other way around.
11:38:13  *** _Terkhen has quit IRC
11:39:02  <Zuu> Or clients need to execute commands they receive when the game is paused if such commands are received.
11:39:11  <frosch123> no idea whether it is needed for clients
11:39:37  <frosch123> ReceiveCommand drops all CMD_FLAGS_MASK
11:40:44  <frosch123> in a first try i would just put a flag into the CMD_FLAGS_MASK thingie for gs commands, and hope that clients do not check pause at all
12:37:51  <Zuu> A very first (untested) attempt: http://devs.openttd.org/~zuu/script-exec-when-paused.patch
12:38:20  <Zuu> I'm sure I've overlooked something important and possible made some bit operations in a non-ideal way.
12:38:43  <Zuu> But first I probably should figure out a good test.
12:40:06  <Zuu> Currently all existing cmd flags are known on complie time, but this one is set by a specific DoCommand caller, so it's not just another flag.
12:40:51  <frosch123> Zuu: be careful with sending it over the network
12:40:57  <frosch123> that will open the doors for cheating
12:41:12  <frosch123> the server should not accept such commands from the network
12:41:15  <Zuu> Yes, currently it doesn't block clients to send the command to servers.
12:41:38  <frosch123> and actually i would expect clients to just execute all commands the server sends
12:41:54  <frosch123> so, sending it might not be needed at all
12:42:21  <frosch123> if CommandFlags don't work
12:42:27  <frosch123> you can also try some DC_ flag
12:46:25  <Zuu> I would assume that clients call CommandQueue::Pop and/or CommandQueue::Peek. Both of these check if the command can be executed while the game is paused.
12:47:26  <frosch123> no idea :)
12:48:25  <Zuu> From what I can see it does.
12:49:19  <Zuu> So either clients must be changed to not check if the command is allowed in pause at all, or this flag has to be sent over the network.
12:55:23  <Zuu> I've updated the patch so that servers should now block out the network flags to protect from cheating. I still suspect that I don't have the whole picture.
12:57:58  <frosch123> CMD_NETWORK_SEND_FLAGS <- maybe define that using the CMD_ constant
12:58:11  <frosch123> i.e. CMD_NETWORK_SEND_FLAGS  = CMD_ALLOW_WHEN_PAUSED
12:58:42  <frosch123> also, put a space in front of "?" :)
12:59:07  <Zuu> I did that at one location, but apparently forgot another.
12:59:43  <Zuu> However CMD_ALLOW_WHEN_PAUSED is defined after CMD_NETWORK_SEND_FLAGS, but nothing blocks swaping the define order.
13:00:31  <Zuu> The network_send_flags constant should probably be renamed to include the server->client direction concept.
19:21:14  *** Alberth has left #openttd.dev
21:05:35  *** FLHerne has joined #openttd.dev
22:00:31  *** Cyberworm has joined #openttd.dev
22:00:46  *** Cyberworm has left #openttd.dev
22:35:17  *** Zuu has quit IRC
22:39:26  *** mib_uhd59b has joined #openttd.dev
22:39:47  *** mib_uhd59b has quit IRC
22:47:40  *** FLHerne has quit IRC
23:56:23  *** frosch123 has quit IRC

Powered by YARRSTE version: svn-trunk