Engine Facade - BeardedManStudios/ForgeNetworkingRemastered GitHub Wiki
Directory | Previous | Next |
---|---|---|
[Directory]] ](/BeardedManStudios/ForgeNetworkingRemastered/wiki/[[Serialization-Strategy) | BMSByte |
The Engine Facade is the way in which Forge Networking can access your game code in order to report back to it. It is the handle to your game code that Forge keeps a reference to, of which, you will find useful in things like Network Message Interpreters.
Default Forge engine facade
By default, Forge comes with a class named ForgeEngineFacade for you to use, modify, or replace. I would recommend that you do not put too much inside of this class, what you should do instead is use it as a facade, by which I mean it should know how to get at other parts of your code rather than doing all the work itself; in many ways it can act like a relay.
Registering the engine facade for Forge
forge will need to know about your engine facade, if you create a new one or modify the existing one. The way that it knows about this is through a registration method that you should call when initializing the network. First get a reference to the INetworkMediator
object and then call the ChangeEngineProxy
function passing your IEngineFacade
. You can see this being done in the Multiplayer Menu code through the connect button or the host button.
Directory | Previous | Next |
---|---|---|
[Directory]] ](/BeardedManStudios/ForgeNetworkingRemastered/wiki/[[Serialization-Strategy) | BMSByte |