public PalBot(IPacketSerializer packetSerializer, IPacketDeserializer packetDeserializer, IPacketMapper packetMapper, IPacketWatcher packetWatcher, IPacketTemplates packetTemplates, IZLibCompression compression, IAuthenticationUtility authentication, IPacketHandlerHub handlerHub, ISubProfiling subProfiling, IPluginManager pluginManager, IRoleManager roleManager, IBroadcastUtility broadcast) { this.packetSerializer = packetSerializer; this.packetDeserializer = packetDeserializer; this.packetMapper = packetMapper; this.packetWatcher = packetWatcher; this.packetTemplates = packetTemplates; this.compression = compression; this.authentication = authentication; this.handlerHub = handlerHub; this.SubProfiling = subProfiling; this.pluginManager = pluginManager; this.RoleManager = roleManager; this.On = broadcast; this.broadcast = (BroadcastUtility)broadcast; _client = new NetworkClient(DefaultHost, DefaultPort); _client.OnDisconnected += (c) => _disconnected?.Invoke(); _client.OnDisconnected += (c) => ((BroadcastUtility)On).BroadcastDisconnected(); _client.OnException += (e, n) => _error?.Invoke(e, n); _client.OnException += (e, n) => ((BroadcastUtility)On).BroadcastException(e, n); _client.OnDataReceived += (c, b) => this.packetDeserializer.ReadPacket(c, b); On.Exception += (e, n) => _error?.Invoke(e, n); On.Message += (b, m) => _message?.Invoke(b, m); this.broadcast.PacketParsed += (c, p) => PacketReceived(p); }