예제 #1
0
        private async Task AttachFamily(IPlayerEntity player, FamilyDto family, FamilyAuthority authority)
        {
            if (family == null)
            {
                return;
            }

            player.Family          = family;
            player.FamilyCharacter = await _characterFamilyService.SaveAsync(new CharacterFamilyDto
            {
                Authority   = authority,
                CharacterId = player.Character.Id,
                FamilyId    = family.Id,
                Rank        = 0
            });
        }
예제 #2
0
        public void InsertFamilyLog(FamilyLogType logtype, string characterName = "", string characterName2 = "", string rainBowFamily = "", string message = "", byte level = 0, int experience = 0, int itemVNum = 0, byte upgrade = 0, int raidType = 0, FamilyAuthority authority = FamilyAuthority.Head, int righttype = 0, int rightvalue = 0)
        {
            string value = string.Empty;

            switch (logtype)
            {
            case FamilyLogType.DailyMessage:
                value = $"{characterName}|{message}";
                break;

            case FamilyLogType.FamilyXP:
                value = $"{characterName}|{experience}";
                break;

            case FamilyLogType.LevelUp:
                value = $"{characterName}|{level}";
                break;

            case FamilyLogType.RaidWon:
                value = raidType.ToString();
                break;

            case FamilyLogType.ItemUpgraded:
                value = $"{characterName}|{itemVNum}|{upgrade}";
                break;

            case FamilyLogType.UserManaged:
                value = $"{characterName}|{characterName2}";
                break;

            case FamilyLogType.FamilyLevelUp:
                value = level.ToString();
                break;

            case FamilyLogType.AuthorityChanged:
                value = $"{characterName}|{(byte)authority}|{characterName2}";
                break;

            case FamilyLogType.FamilyManaged:
                value = characterName;
                break;

            case FamilyLogType.RainbowBattle:
                value = rainBowFamily;
                break;

            case FamilyLogType.RightChanged:
                value = $"{characterName}|{(byte)authority}|{righttype}|{rightvalue}";
                break;

            case FamilyLogType.WareHouseAdded:
            case FamilyLogType.WareHouseRemoved:
                value = $"{characterName}|{message}";
                break;
            }
            FamilyLogDTO log = new FamilyLogDTO
            {
                FamilyId      = FamilyId,
                FamilyLogData = value,
                FamilyLogType = logtype,
                Timestamp     = DateTime.Now
            };

            DAOFactory.FamilyLogDAO.InsertOrUpdate(ref log);
            ServerManager.Instance.FamilyRefresh(FamilyId);
            CommunicationServiceClient.Instance.SendMessageToCharacter(new SCSCharacterMessage()
            {
                DestinationCharacterId = FamilyId,
                SourceCharacterId      = 0,
                SourceWorldId          = ServerManager.Instance.WorldId,
                Message = "fhis_stc",
                Type    = MessageType.Family
            });
        }