ashn-dot-dev / natac

Networked implementation of the hexagonal settler game in Sunder
BSD Zero Clause License
4 stars 0 forks source link

Server should reject malformed messages #15

Open ashn-dot-dev opened 7 months ago

ashn-dot-dev commented 7 months ago

As of commit de8d58c72f8c0e915f162589cf56f512e034ced7, message deserialization does zero error checking, and the server will safely crash if a malformed message come across the wire. Although this is not a huge issue in a just-for-fun game intended to be played between friends, it is worth cleaning up the code around message deserialization. Change instances of T::init_from_bubby into T::parse_from_bubby which will return std::result[[T, std::error]] instead of T.