Forge Developers | Slack Search | Trello Board Changelog
|
Forge Networking Remastered has been released!!! This is now listed in your Profile!
Go Back

Write Custom - Unique Identifier

The write custom command as seen in the Sending Classes tutorial is very powerful for sending across custom groups of data. In fact you will see this method being used for the master server as well. It is a great way to communicate data between the connected instances with a key/callback combination.

The Unique Identifier of the AddCustomDataReadEvent method (the first argument which is a string) is a arbitrary value that really can be anything. You will notice that for Bearded Man specific function they will be labeled "BMS_INTERNAL_...". Basically this field is to be a completely unique value for you to easily know what it is connected to. This string value is NOT sent over the network but is mapped to a number instead.

Since this value is mapped to a number it is important to note that BOTH the server and the client must register the same unique identifier to the AddCustomDataReadEvent in the same order. This mapping is one to one and requires this setup. If a custom read is not needed on either the server or the client, you still need to register the unique string identifier on both the client and the server, however you can pass "null" for the callback method on the instance that does not require it. A good example of this would be seen in the master server.

As seen in the example above, the client does not need the first 3 methods however it does need the last method. So on each of the methods that the client does not implement, "null" will be supplied.

Title

Body

Title

Body


Input:

Title

Body


Input: