private LobbyHost(NetworkContext context, IMapManager mapManager, string map) : base(context) { _mapHandler = new MapDownloadServerMessageHandler(context, mapManager, map); _context.AddConnectionMonitor(_mapHandler); _context.AddMessageHandler(_mapHandler); _readinessHandler = new LobbyHostPlayerReadinessMessageHandler(context); _context.AddConnectionMonitor(_readinessHandler); _context.AddMessageHandler(_readinessHandler); }
public override void Dispose() { base.Dispose(); if (_mapHandler != null) { _context.RemoveConnectionMonitor(_mapHandler); _context.RemoveMessageHandler(_mapHandler); _mapHandler = null; } if (_readinessHandler != null) { _context.RemoveConnectionMonitor(_readinessHandler); _context.RemoveMessageHandler(_readinessHandler); _readinessHandler = null; } }