Page 1 of 1

[Network Protocol] Reduce the size of OP codes

Posted: Thu Jun 02, 2016 11:38 pm
by solidDoWant
The OP code that starts each network message it two bytes long. There is no need for this; factorio will never have 256 different OP codes, let alone 65536. One byte is plenty.

Re: [Network Protocol] Reduce the size of OP codes

Posted: Thu Jun 02, 2016 11:44 pm
by Oxyd
And where would we then put the session magic?

Re: [Network Protocol] Reduce the size of OP codes

Posted: Fri Jun 03, 2016 12:14 am
by solidDoWant
As far as I can tell the session magic isn't currently being used. When a packet is received with a bad session magic, the server logs and error, then proceeds to process the packet. Assuming this isn't a bug, there is no need for the session magic. The ConnectionRequestID should be sufficient to uniquely identify the connection.