[Network Protocol] Reduce the size of OP codes

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

solidDoWant
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Jun 02, 2016 6:26 pm
Contact:

[Network Protocol] Reduce the size of OP codes

Post 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.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

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

Post by Oxyd »

And where would we then put the session magic?
solidDoWant
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Jun 02, 2016 6:26 pm
Contact:

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

Post 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.
Post Reply

Return to “Ideas and Suggestions”