Esempio n. 1
0
 public static GameFactory FindGameByEntityId(bnet.protocol.EntityId entityId)
 {
     foreach (GameFactory game in GameCreators.Values)
     {
         if (game.BnetEntityId == entityId)
         {
             return(game);
         }
     }
     return(null);
 }
Esempio n. 2
0
 public static Channel GetChannelByEntityId(bnet.protocol.EntityId entityId)
 {
     if (entityId.GetHighIdType() == EntityIdHelper.HighIdType.ChannelId)
     {
         if (Channels.ContainsKey(entityId.Low))
         {
             return(Channels[entityId.Low]);
         }
     }
     else
     {
         Logger.Warn("Given entity ID doesn't look like a channel ID!");
     }
     return(null);
 }
Esempio n. 3
0
        /// <summary>
        /// Returns high-id type for given bnet.protocol.EntityId
        /// </summary>
        /// <param name="id">The bnet.protocol.EntityId</param>
        /// <returns><see cref="HighIdType"/></returns>
        public static HighIdType GetHighIdType(this bnet.protocol.EntityId id)
        {
            switch (id.High >> 48)
            {
            case 0x0100:
                return(HighIdType.AccountId);

            case 0x0200:
                return(HighIdType.GameAccountId);

            case 0x0000:
                return(HighIdType.ToonId);

            case 0x0600:
                return(HighIdType.ChannelId);
            }
            return(HighIdType.Unknown);
        }
Esempio n. 4
0
        public override void SelectGameAccount(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.EntityId request, Action <bnet.protocol.NoData> done)
        {
            this.Client.Account.CurrentGameAccount = GameAccountManager.GetAccountByPersistentID(request.Low);
            this.Client.Account.CurrentGameAccount.LoggedInClient = this.Client;

            Logger.Trace("SelectGameAccount(): {0}", this.Client.Account.CurrentGameAccount);

            done(bnet.protocol.NoData.CreateBuilder().Build());
        }
Esempio n. 5
0
        public void RemoveMemberByID(bnet.protocol.EntityId memberId, RemoveReason reason)
        {
            var client = this.Members.FirstOrDefault(pair => pair.Value.Identity.ToonId == memberId).Key;

            RemoveMember(client, reason, false);
        }
Esempio n. 6
0
 public override void LoadBlockList(IRpcController controller, bnet.protocol.EntityId request, Action <bnet.protocol.NoData> done)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 public static Account GetAccountByEntityID(bnet.protocol.EntityId entityId)
 {
     return(Accounts.Where(account => account.Value.BnetAccountID == entityId).Select(account => account.Value).FirstOrDefault());
 }