#Making a custom transport
18 messages · Page 1 of 1 (latest)
inherit from our base Transport class, and look at other transports for how they wired things up. What transport do you have in mind?
I'm trying to do a transport to integrate Dsicord Game SDK (https://discord.com/developers/docs/game-sdk/lobbies and https://discord.com/developers/docs/game-sdk/networking), in a way which allows me to externally control things like the discord instance and the lobby creation.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
You might want to take a look at this
https://github.com/Derek-R-S/Discord-Mirror
I already did. I'll surely base my transport on that one, but it is outdated on the API, and hides the discord instance.
If you fork that and fix it / extend it and get it working well, and keep it MIT, let us know and I'll make a channel for it in this Discord (assuming you want to make it available to the community).
I sure will!
Is there anything in the docs where I can find what each function in a Transport is supposed to be?
I've found https://storage.googleapis.com/mirror-api-docs/html/df/d40/class_mirror_1_1_transport.html, but some parts of it are unclear to me. More concretely:
- Should my implementation invoke the callbacks declared, or is it done by the underlying Transport class?
- Why is there a ClientConnect both receiving an address and an URI? What can I expect the address/URI to be?
- What is GetBatchThreshold?
- Should I implement any of the ...Update functions?
- Should I implement OnApplicationQuit? If so, what should it do?
Honestly the best guide is the Telepathy or Kcp transport...see what they've done for all that.
I've gotten (remarkably quickly) to a point where my code seems to be working well, so I've put it on GitHub (https://github.com/levimcgomes/DiscordTransport/). I'm yet to write a proper README, and I'm sure many bugs will still come up, but at least it's a start.
Talking about bugs, NetworkManager's OnlineScene says the following in its tooltip: "Clients will recieve a Scene Message to load the server's current scene when they connect.". Is this something I must handle myself or is it implemented by Mirror? I'd assume the later, but when a connection is established, the client remains in the Offline scene...
Mirror handles that. Network Manager needs both offline and online scenes assigned, and it lives in the offline scene. Server and clients same setup. Mirror's Room example does this.
(If I understood correctly) if the client is still in the offline scene after connecting to the server, then I'd guess the Scene Message isn't getting where it should... Probably a problem with the transport.
all scenes are in build settings scene list, Offline first?
yes