public GameService(PlayerService playerService, ClientService clientService, ProtoMessageCallbackService protoMessageCallbackService) { this.playerService = playerService; this.clientService = clientService; this.protoMessageCallbackService = protoMessageCallbackService; this.protoMessageCallbackService.Subscribe <GameJoined>(OnGameJoined); this.protoMessageCallbackService.Subscribe <PlayerJoined>(OnPlayerJoined); this.protoMessageCallbackService.Subscribe <PlayerLeft>(OnPlayerLeft); }
protected void Awake() { SwitchScreen(ScreenStates.Connecting); protoMessageCallbackService = GlobalServiceLocator.Instance.Get <ProtoMessageCallbackService>(); protoMessageCallbackService.Subscribe <ServerJoined>(OnServerJoined); protoMessageCallbackService.Subscribe <GameJoined>(OnGameJoined); clientService = GlobalServiceLocator.Instance.Get <ClientService>(); clientService.ConnectedEvent += OnClientConnected; clientService.DisconnectedEvent += OnDisconnectedEvent; }
public ClientService(ServerSettingsLibrary serverSettingsLibrary, MainThreadService mainThreadService, ProtoMessageCallbackService protoMessageCallbackService) { this.serverSettingsLibrary = serverSettingsLibrary; this.mainThreadService = mainThreadService; this.protoMessageCallbackService = protoMessageCallbackService; }
public PlayerService(ProtoMessageCallbackService protoMessages) { protoMessages.Subscribe <ServerJoined>(OnServerJoined); protoMessages.Subscribe <PlayersNickNameChanged>(OnNickNameChanged); }