-
Notifications
You must be signed in to change notification settings - Fork 2
From Scratch. Creating a basic Master Server
- Create an empty game object
- Name it Networking
- Create an empty game object as a child of Networking
- Name it Master Server
- Add Master Component
- Select "Auto Start In Editor" in inspector
Auto Start In Editor option will make sure that when you hit "Play" in the editor, master server will start automatically
Alternative: Create a new script that will find Master in the scene, and call the
master.StartServer()whenever you want (click of a button and so on)
- Create a canvas in the scene:
GameObject > UI > Canvas. - Drag a prefab from
Barebones/MasterFramework/Prefabs/Ui/Hudto the Canvas
Drag a prefab from Barebones/MasterFramework/Prefabs/LogController to the scene
What the hell is LogController?. For logging, framework uses a small wrapper. It allows developers to implement custom log listeners (appenders). Great use case for it would be to have a custom appender which sends logs to another server (like a central log listener), so that you can see what's happening in your "cloud". At the moment of writing, logging is still a work in progress
Hierarchy view after all of these steps (Note: EventSystem appears automatically after creating canvas (I think)):
Hit a play button in the editor, and if you've selected the "Auto Start In Inspector" option, it should start automatically, and Hud should indicate that the Master Server is running:
Simply make a build, and run it with -bmMaster argument. You should see Hud with the same indication


