示例#1
0
 public MailManager(SelectCharacterApplication application)
 {
     this.application         = application;
     mPutTransactionPool      = new Server2ServerTransactionPool <PUTInventoryItemTransactionStart, PUTInventoryItemTransactionEnd>(this);
     mGetTransactionPool      = new Server2ServerTransactionPool <GETInventoryItemTransactionStart, GETInventoryItemTransactionEnd>(this);
     mGetItemsTransactionPool = new Server2ServerTransactionPool <GETInventoryItemsTransactionStart, GETInventoryItemsTransactionEnd>(this);
 }
示例#2
0
 public PlayerStoreService(SelectCharacterApplication application)
 {
     mApplication        = application;
     mTransactionPool    = new Server2ServerTransactionPool <GETInventoryItemTransactionStart, GETInventoryItemTransactionEnd>(this);
     mPutTransactionPool = new Server2ServerTransactionPool <PUTInventoryItemTransactionStart, PUTInventoryItemTransactionEnd>(this);
     mPlayerStoreCache   = new ConcurrentDictionary <string, PlayerStore>();
 }
示例#3
0
 public GuildService(SelectCharacterApplication application)
 {
     mApplication                = application;
     mCache                      = new GuildCache();
     mSearchCachedGuilds         = new ConcurrentDictionary <int, Hashtable>();
     mCreatinDate                = DateTime.UtcNow;
     mLastUpdateSearchResultTime = time;
 }
示例#4
0
 public Hashtable GetInfo(SelectCharacterApplication app)
 {
     lock (syncRoot) {
         Hashtable result = new Hashtable();
         foreach (var pFriend in friends)
         {
             result.Add(pFriend.Key, pFriend.Value.GetInfo(app));
         }
         return(result);
     }
 }
示例#5
0
 public void Save(SelectCharacterApplication app)
 {
     foreach (var pFriends in mCachedFriends)
     {
         if (pFriends.Value.Changed)
         {
             app.DB.friends.Save(pFriends.Value.Data);
             pFriends.Value.Changed = false;
         }
     }
 }
示例#6
0
        private byte GetLeaderRace(SelectCharacterApplication app, NebulaCommon.Group.Group group)
        {
            var leader = group.leaderMember;

            if (leader != null)
            {
                var character = app.Players.GetCharacter(leader.gameRefID, leader.characterID);
                if (character != null)
                {
                    return((byte)character.Race);
                }
            }
            return((byte)Race.None);
        }
示例#7
0
        public Hashtable GetInfo(SelectCharacterApplication app)
        {
            int currentTime = CommonUtils.SecondsFrom1970();

            if (currentTime - lastCacheTime > 60 * 60)
            {
                lastCacheTime = currentTime;
                var player = app.Players.GetExistingPlayer(gameRefId);
                if (player != null)
                {
                    var character = player.Data.GetCharacter(characterId);
                    if (character != null)
                    {
                        exp           = character.Exp;
                        characterIcon = character.characterIcon;
                        if (string.IsNullOrEmpty(characterName))
                        {
                            characterName = character.Name;
                        }
                    }
                }
            }

            //if empty name force get name
            if (string.IsNullOrEmpty(characterName))
            {
                var player = app.Players.GetExistingPlayer(gameRefId);
                if (player != null)
                {
                    var character = player.Data.GetCharacter(characterId);
                    if (character != null)
                    {
                        characterName = character.Name;
                    }
                }
            }

            return(new Hashtable {
                { (int)SPC.Login, login },
                { (int)SPC.GameRefId, gameRefId },
                { (int)SPC.CharacterId, characterId },
                { (int)SPC.Status, guildStatus },
                { (int)SPC.Exp, exp },
                { (int)SPC.CharacterName, characterName },
                { (int)SPC.Icon, characterIcon },
                { (int)SPC.DepositedCount, depositedCount }
            });
        }
示例#8
0
文件: Guild.cs 项目: OlegGelezcov/neb
        public Hashtable GetInfo(SelectCharacterApplication app)
        {
            if (description == null)
            {
                description = string.Empty;
            }
            if (dayPoster == null)
            {
                dayPoster = string.Empty;
            }
            if (transactions == null)
            {
                transactions = new List <Hashtable>();
            }

            Hashtable hash = new Hashtable {
                { (int)SPC.Id, ownerCharacterId },
                { (int)SPC.GuildRating, rating },
                { (int)SPC.Race, guildRace },
                { (int)SPC.Description, (description != null) ? description : string.Empty },
                { (int)SPC.Name, (name != null) ? name : string.Empty },
                { (int)SPC.Opened, opened },
                { (int)SPC.ModerCount, moderatorCount },
                { (int)SPC.MaxModerCount, MAX_NUMBER_OF_MODERATORS },
                { (int)SPC.Credits, depositedCredits },
                { (int)SPC.PvpPoints, depositedPvpPoints },
                { (int)SPC.DayPoster, dayPoster },
                { (int)SPC.Transactions, transactions.ToArray() }
            };

            Hashtable membersHash = new Hashtable();

            lock (syncRoot) {
                //mPage = Mathf.Clamp(mPage, 0, numPages - 1);
                //var newMembers = members.Skip(mPage * MAX_MEMBERS_ON_PAGE).Take(MAX_MEMBERS_ON_PAGE).ToDictionary(pk => pk.Key, pk => pk.Value);

                foreach (var member in members)
                {
                    membersHash.Add(member.Key, member.Value.GetInfo(app));
                }
            }
            hash.Add((int)SPC.Members, membersHash);
            return(hash);
        }
示例#9
0
        public Hashtable GetInfo(SelectCharacterApplication app)
        {
            var currentTime = CommonUtils.SecondsFrom1970();

            if ((currentTime - lastCacheTime) > FRIEND_INFO_UPDATE_INTERVAL)
            {
                lastCacheTime = currentTime;
                var player = app.Players.GetExistingPlayer(gameRefID);
                if (player != null)
                {
                    var character = player.Data.GetCharacter(player.Data.SelectedCharacterId);
                    if (character != null)
                    {
                        exp           = character.Exp;
                        characterName = character.Name;
                        worldID       = character.WorldId;
                        characterID   = character.CharacterId;
                        characterIcon = character.characterIcon;
                        if (characterName == null)
                        {
                            characterName = string.Empty;
                        }
                        if (worldID == null)
                        {
                            worldID = string.Empty;
                        }
                    }
                }
            }

            return(new Hashtable {
                { (int)SPC.Login, login },
                { (int)SPC.GameRefId, gameRefID },
                { (int)SPC.Exp, exp },
                { (int)SPC.CharacterName, characterName },
                { (int)SPC.WorldId, worldID },
                { (int)SPC.CharacterId, characterID },
                { (int)SPC.Icon, characterIcon }
            });
        }
示例#10
0
        public Hashtable SearchGroups(SelectCharacterApplication app, byte race)
        {
            var currentTime = CommonUtils.SecondsFrom1970();

            if (currentTime - mLastGroupSerachUpdateTime > GROUP_SEARCH_UPDATE_INTERVAL)
            {
                mLastGroupSerachUpdateTime = currentTime;
                Hashtable raceGroups = null;
                if (mCacheFoundedGroups.TryGetValue(race, out raceGroups))
                {
                    raceGroups.Clear();
                    foreach (var pGroup in groups)
                    {
                        var group = pGroup.Value;
                        if (group.allowNewMembers && group.opened)
                        {
                            if (GetLeaderRace(app, group) == race)
                            {
                                raceGroups.Add(group.groupID, group.GetSearchInfo());
                            }
                        }
                    }
                    return(raceGroups);
                }
                else
                {
                    return(new Hashtable());
                }
            }

            Hashtable result = null;

            if (mCacheFoundedGroups.TryGetValue(race, out result))
            {
                return(result);
            }
            return(new Hashtable());
        }
示例#11
0
 public DeleteAuctionItemOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
 public SendPushToPlayersOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#13
0
 public PvpStoreManager(SelectCharacterApplication app)
 {
     application         = app;
     mPutTransactionPool = new Server2ServerTransactionPool <PUTInventoryItemTransactionStart, PUTInventoryItemTransactionEnd>(this);
 }
示例#14
0
 public PlayerService(SelectCharacterApplication application)
 {
     mApplication = application;
 }
 public MoveItemFromStationToBankOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
 public HandleNotificationOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#17
0
 public BuyPvpItemOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#18
0
 public ChatService(SelectCharacterApplication application)
 {
     mApplication = application;
     mCache       = new ChatCache();
 }
 public CreateCharacterOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#20
0
 public SetNewPriceOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#21
0
 public FriendService(SelectCharacterApplication app)
 {
     application = app;
 }
示例#22
0
 public AuctionService(SelectCharacterApplication application)
 {
     mApplication = application;
 }
示例#23
0
 public GetPlayerStoreOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#24
0
 public ChangeGuildMemberStatusOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#25
0
 public GroupService(SelectCharacterApplication app)
 {
     mApplication = app;
 }
示例#26
0
 public NotificationService(SelectCharacterApplication application)
 {
     mApplication = application;
     mCache       = new NotificationCache();
 }
 public InviteToGuildOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#28
0
 public BaseOperationHandler(SelectCharacterApplication application, SelectCharacterClientPeer peer)
 {
     this.application = application;
     this.peer        = peer;
 }
 public WriteMessageOperationHandler(SelectCharacterApplication app, SelectCharacterClientPeer peer)
     : base(app, peer)
 {
 }
示例#30
0
 public AchievmentCache(SelectCharacterApplication app)
 {
     m_App         = app;
     m_Achievments = new ConcurrentDictionary <string, AchievmentCacheObject>();
 }