alvyxaz / barebones-masterserver

Master Server framework for Unity
476 stars 106 forks source link

QuickSetup Demo - How to add custom lobby factories for custom lobbies (other than the existing 4 "Deathmatch", "1vs1" etc) #214

Open AjaxTheOne opened 6 years ago

AjaxTheOne commented 6 years ago

Hello!

I ran into a problem when I was messing around with the QuickStart example. I was trying to add my own factory (in addition to the other 4 that are already in there), and I kept getting an error "Failed to create lobby: Unavailable lobby factory (Factory: FactoryName)".

So, I searched in the files for a place to register my factories, and I actually found the DemoLobbyFactories.cs with all the forementioned factories. I made a copy for my custom factory, added teams, max & min players etc. But the problem was still there, my factory was unavailable.

I also tried to add the factory via the script DemoFactoriesSetup.cs in RoomsDemo (I don't know if it has any connection with the QuickSetup one), and the again my factory was unavailable. I even tried to comment out all other factories, in DemoLobbyFactories.cs and DemoFactoriesSetup.cs, to see if the QuickSetup is still working, and it was indeed working!

So, my question is, where I can add my factories (like, where is the .cs file that I need to modify, in order to add more factories) and where can I load them in a LobbyModule, when I run the game?

Any help is appreciated!