public Account() { Host = new OOGHost(""); Auth = Host.IncludePlugin <AuthPlugin>(); Relogin = Host.IncludePlugin <ReloginPlugin>(); Meditation = Host.IncludePlugin <MeditationPlugin>(); Emu = Host.IncludePlugin <EmuPlugin>(); Meditation.Enabled = true; Host.PacketHandler <MeditationEnabledS14A>().OnReceive += (object sender, SiviliaFramework.IO.GamePacket e) => RefreshAccount(); Host.PacketHandler <MeditationInfoS149>().OnReceive += (object sender, SiviliaFramework.IO.GamePacket e) => RefreshAccount(); Host.PacketHandler <RoleInfoUpdateS26>().OnReceive += (object sender, SiviliaFramework.IO.GamePacket e) => RefreshAccount(); Host.PacketHandler <RoleStatsInfoS32>().OnReceive += (object sender, SiviliaFramework.IO.GamePacket e) => RefreshAccount(); Relogin.ReloginStatusUpdate += (object sender, EventArgs args) => RefreshAccount(); Host.Connection.Connected += (object sender, EventArgs e) => RefreshAccount(); Host.Connection.Disconnected += (object sender, EventArgs e) => RefreshAccount(); Auth.OnEnteredWorld += (object sender, EventArgs e) => RefreshAccount(); ConnectionStatus = Host.IncludeDataBlock <ConnectionStatus>(); Auth.RolesListLoaded += Auth_RolesLoaded; ServerName = string.Empty; ServerAddress = string.Empty; Login = string.Empty; Password = string.Empty; AutoMessage = string.Empty; }
public override void Loaded(IPluginProvider pluginProvider) { _auth = pluginProvider.Get <AuthPlugin>(); _auth.LoggedIn += OnLoggedIn; database = pluginProvider.Get <CockroachDbPlugin>(); }