mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-25 03:35:26 +01:00
Updated SubData (markdown)
parent
a817aa1f0b
commit
cf1d7cbfcd
16
SubData.md
16
SubData.md
@ -4,13 +4,25 @@ SubData, in a similar fashion to the [Plugin Messaging Channel (PMC)](https://ww
|
||||
This is the latest edition of SubData. SubServers.Bungee will open port 4391 (by default) so that all the SubServers apps can communicate with each other.
|
||||
|
||||
## Usage
|
||||
SubData has grown beyond SubServers into [its very own project](https://github.com/ME1312/SubData-2). This means that some things, like the API and Protocol Formatting, have been moved to more appropriate locations on [its new wiki](https://github.com/ME1312/SubData-2/wiki). Here are some topics you may be interested in:
|
||||
SubData has grown beyond SubServers into [its very own project](https://github.com/ME1312/SubData-2). This means that some things, like the API and Protocol Formatting, have been moved to more appropriate locations on [its new wiki](https://github.com/ME1312/SubData-2/wiki). Here are some additional topics you may be interested in:
|
||||
> [Sending and Receiving Custom Messages](https://github.com/ME1312/SubData-2/wiki/Usage#working-with-packets-and-messages)<br>
|
||||
> Working with Multiple Data Channels<br>
|
||||
> Creating Custom Ciphers<br>
|
||||
> [Network States](https://github.com/ME1312/SubData-2/wiki/Protocol-States)<br>
|
||||
> [Protocol Formatting](https://github.com/ME1312/SubData-2/wiki/Protocol-Format)<br>
|
||||
<br>
|
||||
|
||||
## Channel Tracking
|
||||
SubServers allows multiple SubData channels to be opened from the same source at one time. As a result, the way SubData channels are tracked within SubServers has gotten a little complex. If you're a developer, you may have noticed that when you get the linked client for a server (for example), it now returns an array.
|
||||
|
||||
**The Master Channel**<br>
|
||||
The first item in the array `client[0]` is always guaranteed be the master channel; it's id of `0` will never change. The master channel is the initial channel opened by SubServers itself. Additionally, it is always present in the array, even if unavailable. If it does happen to be unavailable it will just simply return a null value, but it shouldn't be that way for long, since SubServers will reconnect this channel automatically.
|
||||
|
||||
**SubChannels**<br>
|
||||
Everything else in the array is a subchannel. Each subchannel is dynamically registered with a positive id number. However, this can come with it's own set of problems.
|
||||
|
||||
Let's say we have 2 subchannels connected. If `client[1]` disconnects, this means the next connection to identify itself as a subchannel will get id `1` because that id is no longer in use. However, if you tried to access `client[2]` during the time subchannel `1` was disconnected, you would have been met with an `ArrayIndexOutOfBoundsException` because the position was not the same as the id number.
|
||||
|
||||
Since this method of tracking is clearly unreliable for use cases other than simple listing and iteration, we recommend for the opener of the channel to keep track of it's own subchannel(s).<br>
|
||||
|
||||
## Encryption
|
||||
SubServers allows SubData packets to be encrypted with the cipher you choose via the configuration. To disable encryption, go to your SubData settings and set `Encryption` to `None`.
|
||||
|
Loading…
Reference in New Issue
Block a user