-
Notifications
You must be signed in to change notification settings - Fork 3
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
Standarize player ship indexes #11
Comments
We could actually define an 'in-place' type so that we aren't cluttering the types file with ones that are only going to be used once. For example: ... new struct({
playerShipIndex: {
pack: function(buffer, value) {
type.int32.pack(buffer, value - 1);
},
unpack: function(buffer) {
return type.int32.unpack(buffer) + 1;
}
}
}) This could be used for other properties where we want to compute something dynamically. |
Yeah, that sounds exactly like middleware (like the stuff in
There should be a way to create the Right now I'm not sure which is the best way to implement this. |
Yeah, that would be useful for more complex packets, however I think we should ensure that most packets are able to be written without middleware (e.g. enums/bools as a type). |
The player ship indexes have been bugging me for some time. In some packets (e.g. console status, setPlayerShipIndex) the field is 0-indexed; while in some other packets (player ship updates) is 1-indexed. So sometimes the player ship index goes 0-7 and sometimes 1-8.
Maybe it would be a good idea to standarize these into the same, by creating an offset integer datatype. _Maybe_.
The text was updated successfully, but these errors were encountered: