private ByteString DeleteHero(D3.OnlineService.EntityId hero) { var deleteToon = ToonManager.GetToonByLowID(hero.IdLow); ToonManager.DeleteToon(deleteToon); Logger.Trace("DeleteHero() {0}", deleteToon); return(ByteString.Empty); }
private ByteString SelectHero(D3.OnlineService.EntityId hero) { this.Client.Account.CurrentGameAccount.CurrentToon = ToonManager.GetToonByLowID(hero.IdLow); Logger.Trace("SelectToon() {0}", this.Client.Account.CurrentGameAccount.CurrentToon); this.Client.Account.LastSelectedHeroField.Value = this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID; this.Client.Account.CurrentGameAccount.NotifyUpdate(); this.Client.Account.SaveToDB(); return(this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID.ToByteString()); }
public ToonHandleHelper(D3.OnlineService.EntityId entityID) { var stream = CodedInputStream.CreateInstance(entityID.ToByteArray()); ulong tmp = 0; // I believe this actually calls ReadRawVarint64(), but just to be sure.. stream.ReadUInt64(ref tmp); this.ID = tmp; //this.Program = stream.ReadRawVarint32(); //this.Region = stream.ReadRawVarint32(); //this.Realm = stream.ReadRawVarint32(); }
private ByteString SelectHero(D3.OnlineService.EntityId hero) { this.Client.Account.CurrentGameAccount.CurrentToon = ToonManager.GetToonByLowID(hero.IdLow); Logger.Trace("SelectToon() {0}", this.Client.Account.CurrentGameAccount.CurrentToon); if (this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID != this.Client.Account.CurrentGameAccount.lastPlayedHeroId) { this.Client.Account.CurrentGameAccount.NotifyUpdate(); this.Client.Account.CurrentGameAccount.lastPlayedHeroId = this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID; } return(this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID.ToByteString()); }
public static Channel GetChannelByEntityId(D3.OnlineService.EntityId entityId) { if (entityId.IdHigh == (ulong)EntityIdHelper.HighIdType.ChannelId) { if (Channels.ContainsKey(entityId.IdLow)) { return(Channels[entityId.IdLow]); } } else { Logger.Warn("Given entity ID doesn't look like a channel ID!"); } return(null); }
private ByteString SelectHero(D3.OnlineService.EntityId hero) { var oldToon = this.Client.Account.CurrentGameAccount.CurrentToon; var newtoon = ToonManager.GetToonByLowID(hero.IdLow); Logger.Trace("SelectToon() {0}", this.Client.Account.CurrentGameAccount.CurrentToon); if (oldToon != newtoon) { this.Client.Account.CurrentGameAccount.CurrentToon = newtoon; this.Client.Account.CurrentGameAccount.NotifyUpdate(); AccountManager.SaveToDB(this.Client.Account); } return(this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID.ToByteString()); }
private void DeleteHero(D3.OnlineService.EntityId hero) { //Permanantly delete previously deleted hero var deleteHero = ToonManager.GetDeletedToon(this.Client.Account.CurrentGameAccount); if (deleteHero != null) { Logger.Trace("Permanantly deleting hero: {0}", deleteHero); ToonManager.DeleteToon(deleteHero); } //Mark hero as deleted var markHero = ToonManager.GetToonByLowID(hero.IdLow); markHero.Deleted = true; ToonManager.SaveToDB(markHero); Logger.Trace("DeleteHero(): Marked {0} as deleted.", markHero); }