Difference between revisions of "Registry of Message Ids"
(Created page with "When calling [https://github.com/KeenSoftwareHouse/SpaceEngineers/blob/master/Sources/Sandbox.Game/ModAPI/MyModAPIHelper_ModAPI.cs#L150 RegisterMessageHandler] or SendMessage...") |
|||
Line 18: | Line 18: | ||
|Id || Mod Name || Packet Name | |Id || Mod Name || Packet Name | ||
|- | |- | ||
− | | | + | |59619 || HoverRail || Setting Update |
|} | |} |
Revision as of 18:06, 11 November 2016
When calling RegisterMessageHandler or SendMessage in the mod API, a "message id" must be provided. This number is of type "ushort", meaning there are 65536 possible values. However, if everybody picks a value at random, then you will get a 50% chance of a collision after only 300 random picks. That is not a lot!
This is a case of the birthday paradox, where random selection leads to collisions much more often than people think.
To avoid this issue, when creating a mod that uses network messages, please add your message ids to this page. Avoid reusing already selected ids.
Also if you are writing a mod, be aware that you may be receiving messages that do not match your format!
Humans are bad at random numbers. To create a random id, you can use random.org.
Please keep entries sorted numerically.
Id | Mod Name | Packet Name |
59619 | HoverRail | Setting Update |