Ejemplo n.º 1
0
    void ShowGuildInfo()
    {
        GuildInfo guildInfo = GameCenter.guildMng.MyGuildInfo;

        if (guildInfo != null)
        {
            GuildRef guildRef = GameCenter.guildMng.MyGuildInfo.CurGuildRef;
            if (labGuildName != null)
            {
                labGuildName.text = guildInfo.GuildName;
            }
            if (labGuildLeader != null)
            {
                labGuildLeader.text = guildInfo.PresidentName;
            }
            if (labGuildMemCount != null && guildRef != null)
            {
                labGuildMemCount.text = guildInfo.MemberNum.ToString() + "/" + (guildInfo.MemberMaxCount);
            }
            if (labGuildRanking != null)
            {
                labGuildRanking.text = guildInfo.GuildRank.ToString();
            }
            if (labGuildNotice != null)
            {
                labGuildNotice.value = guildInfo.Notice;
            }
        }
    }
        public async Task <GuildInfo> GenerateConfigurationFromIdAsync(ulong guildId)
        {
            var client = Bot.Instance.Client;
            var guild  = await client.GetGuildAsync(guildId);

            var administrators = await ServerInfo.Instance.GetAdministratorsAsync(guild);

            var moderators = await ServerInfo.Instance.GetModeratorsAsync(guild);

            var bannedMembers = await ServerInfo.Instance.GetBansAsync(guild);

            var config = new GuildInfo
            {
                Administrators = administrators.ToList(),
                BannedMembers  = bannedMembers.ToList(),
                Guild          = guild.Id,
                Moderators     = moderators.ToList()
            };

            LocalConfiguration.TryAdd(guildId, config);
            var json = JsonConvert.SerializeObject(config, Formatting.Indented);

            File.WriteAllText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SilkBot", "ServerConfigs", $"{guildId}.serverconfig"), json);
            return(config);
        }
Ejemplo n.º 3
0
    private void UpdateGuildGrid(UIGridItem item)
    {
        if (item == null || item.mScripts == null || item.oData == null)
        {
            return;
        }
        GuildInfo info        = item.oData as GuildInfo;
        UILabel   rank        = item.mScripts[0] as UILabel;
        UITexture emblem      = item.mScripts[1] as UITexture;
        UILabel   guildname   = item.mScripts[2] as UILabel;
        UILabel   leader      = item.mScripts[3] as UILabel;
        UILabel   reputation  = item.mScripts[4] as UILabel;
        UILabel   fund        = item.mScripts[5] as UILabel;
        UISprite  appealBtn   = item.mScripts[6] as UISprite;
        UISprite  exposureBtn = item.mScripts[7] as UISprite;

        rank.text       = info.ranking.ToString();
        guildname.text  = info.guildName;
        leader.text     = info.leader;
        reputation.text = info.reputation.ToString();
        fund.text       = info.guildFunds.ToString();

        bool isSelf = info.id == PlayerMediator.playerInfo.guildDBID;

        appealBtn.transform.GetComponent <UIButton>().isEnabled       = !isSelf;
        exposureBtn.transform.GetComponent <UIButton>().isEnabled     = !isSelf;
        UIEventListener.Get(appealBtn.transform.gameObject).onClick   = OnClickItem;
        UIEventListener.Get(exposureBtn.transform.gameObject).onClick = OnClickItem;
    }
Ejemplo n.º 4
0
        /// <summary>
        /// 进入下一个周目
        /// </summary>
        /// <param name="guildInfo">公会信息</param>
        /// <returns>
        /// <para><see langword="true"/> 写入成功</para>
        /// <para><see langword="false"/> 数据库错误</para>
        /// </returns>
        public bool GotoNextRound(GuildInfo guildInfo)
        {
            try
            {
                using var dbClient = SugarUtils.CreateSqlSugarClient(DBPath);

                int nextPhase = GetRoundPhase(guildInfo.ServerId, guildInfo.Round + 1);
                //获取下一个周目boss的信息
                GuildBattleBoss nextBossData = dbClient.Queryable <GuildBattleBoss>()
                                               .Where(i => i.ServerId == guildInfo.ServerId &&
                                                      i.Phase == nextPhase &&
                                                      i.Order == 1)
                                               .First();
                return(dbClient.Updateable <GuildInfo>()
                       .SetColumns(i => new GuildInfo()
                {
                    BossPhase = nextBossData.Phase,
                    Order = 1,
                    Round = guildInfo.Round + 1,
                    HP = nextBossData.HP,
                    TotalHP = nextBossData.HP
                })
                       .Where(i => i.Gid == GuildEventArgs.SourceGroup.Id)
                       .ExecuteCommandHasChange());
            }
            catch (Exception e)
            {
                Log.Error("Database error", Log.ErrorLogBuilder(e));
                return(false);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 修改当前boss血量
 /// </summary>
 /// <param name="guildInfo">公会信息</param>
 /// <param name="curBossHP">更新的HP值</param>
 /// <returns>
 /// <para><see langword="true"/> 写入成功</para>
 /// <para><see langword="false"/> 数据库错误</para>
 /// </returns>
 public bool ModifyBossHP(GuildInfo guildInfo, long curBossHP)
 {
     if (guildInfo == null)
     {
         throw new ArgumentNullException(nameof(guildInfo));
     }
     try
     {
         if (curBossHP > guildInfo.TotalHP)
         {
             throw new ArgumentOutOfRangeException(nameof(curBossHP));
         }
         using var dbClient = SugarUtils.CreateSqlSugarClient(DBPath);
         return(dbClient.Updateable <GuildInfo>()
                .SetColumns(i => new GuildInfo {
             HP = curBossHP
         })
                .Where(guild => guild.Gid == guildInfo.Gid)
                .ExecuteCommandHasChange());
     }
     catch (Exception e)
     {
         Log.Error("Database error", Log.ErrorLogBuilder(e));
         return(false);
     }
 }
Ejemplo n.º 6
0
        private async Task GuildJoin(SocketGuild guild)
        {
            //Creating the variables we need for the setup command
            List <Reaction>    reactions          = new List <Reaction>();
            List <Mute>        mutes              = new List <Mute>();
            List <UserWarning> warnings           = new List <UserWarning>();
            CustomAnnouncement customAnnouncement = new CustomAnnouncement();
            GuildInfo          guildInfo          = new GuildInfo
            {
                ServerName   = guild.Name,
                CreationDate = guild.CreatedAt.ToString(),
                Creator      = $"{guild.Owner.Username}#{guild.Owner.Discriminator}",
                CreatorId    = guild.OwnerId,
                BannerURL    = guild.BannerUrl
            };

            GuildModel newGuild = new GuildModel
            {
                GuildID            = guild.Id.ToString(),
                GuildInfo          = guildInfo,
                Mutes              = mutes,
                Reactions          = reactions,
                UserWarnings       = warnings,
                CustomAnnouncement = customAnnouncement
            };

            //Run the init server method which inputs the server into the database
            MongoCRUD.Instance.InitServer(newGuild);

            await Task.CompletedTask;
        }
Ejemplo n.º 7
0
        public IActionResult GetChannelboardData(string token)
        {
            if (string.IsNullOrEmpty(token))
            {
                return(BadRequest(new { Error = "Missing token", Code = ChannelboardErrors.MissingWebToken }));
            }

            if (!ChannelStats.ExistsWebToken(token))
            {
                return(BadRequest(new { Error = "Invalid token", Code = ChannelboardErrors.InvalidWebToken }));
            }

            var channelboardData = ChannelStats.GetChannelboardData(token, DiscordClient, out ChannelboardWebToken webToken);
            var guild            = DiscordClient.Guilds.First();
            var guildUser        = guild.GetUser(webToken.UserID);

            var data = new Channelboard()
            {
                Items = channelboardData,
                Guild = GuildInfo.Create(guild),
                User  = GuildUser.Create(guildUser)
            };

            return(Ok(data));
        }
Ejemplo n.º 8
0
            public IEnumerator GetCharacterGuildRoutine(string characterId, Action <GuildInfo> action)
            {
                string uri  = NetworkSettings.instance.BaseUri() + "/api/guild/character_guild";
                var    form = new WWWForm();

                form.AddField("playerId", NetworkSettings.instance.username);
                form.AddField("authtoken", NetworkSettings.instance.authtoken);
                form.AddField("characterId", characterId);


                WWW www = new WWW(uri, form.data, form.headers);

                yield return(www);

                if (www.error != null)
                {
                    Debug.Log(www.error);
                    action(null);
                }
                else
                {
                    MemoryStream stream    = new MemoryStream(www.bytes);
                    GuildInfo    guildInfo = Serializer.Deserialize <GuildInfo>(stream);
                    action(guildInfo);
                }
            }
Ejemplo n.º 9
0
    /// <summary>
    /// 获取公共信息
    /// </summary>
    /// <param name="pt"></param>
    protected void S2C_GuildInfo(Pt pt)
    {
        //Debug.Log("S2C_GuildInfo");
        pt_guild_info_d380 info = pt as pt_guild_info_d380;

        if (info.lev == 0)
        {
            return;
        }
        if (info != null)
        {
            GuildData data = new GuildData(info);
            if (myGuildInfo == null)
            {
                GuildInfo guildInfo = new GuildInfo(data);
                myGuildInfo = guildInfo;
            }
            else
            {
                myGuildInfo.UpdateServerData(data);
            }
            if (OnGetPublicEvent != null)
            {
                OnGetPublicEvent();
            }
        }
    }
Ejemplo n.º 10
0
 /// <summary>
 /// 进入下一个boss
 /// </summary>
 /// <param name="guildInfo">公会信息</param>
 /// <returns>
 /// <para><see langword="true"/> 写入成功</para>
 /// <para><see langword="false"/> 数据库错误</para>
 /// </returns>
 public bool GotoNextBoss(GuildInfo guildInfo)
 {
     try
     {
         using var dbClient = SugarUtils.CreateSqlSugarClient(DBPath);
         //获取下一个boss的信息
         var nextBossData = dbClient.Queryable <GuildBattleBoss>()
                            .Where(i => i.ServerId == guildInfo.ServerId &&
                                   i.Phase == guildInfo.BossPhase &&
                                   i.Order == guildInfo.Order + 1)
                            .First();
         return(dbClient.Updateable <GuildInfo>()
                .SetColumns(i => new GuildInfo()
         {
             Order = guildInfo.Order + 1,
             HP = nextBossData.HP,
             TotalHP = nextBossData.HP
         })
                .Where(i => i.Gid == guildInfo.Gid)
                .ExecuteCommandHasChange());
     }
     catch (Exception e)
     {
         Log.Error("Database error", Log.ErrorLogBuilder(e));
         return(false);
     }
 }
Ejemplo n.º 11
0
        private async Task ParsePlaylist(GuildInfo guild, IMessageChannel channel, IUser user, string path, YoutubeClient youtube, string id)
        {
            var playlist = await youtube.GetPlaylistAsync(id);

            int added      = 0;
            int couldntAdd = 0;
            var maxSongs   = int.Parse(guild.Config["MaxSongsPerUser"].ToString());

            foreach (Video video in playlist.Videos)
            {
                var songs = guild.Songs;
                if (video.Duration.TotalMinutes > _maxMinutesForVideo || (int)video.Duration.TotalMinutes == 0 ||
                    (!((IGuildUser)user).GuildPermissions.BanMembers && songs.ToArray().Count(x => x.AuthorId == user.Id) == maxSongs))
                {
                    couldntAdd++;
                    continue;
                }

                AddVideo(guild, channel, user, video, false);
                added++;
            }

            string message = "";

            message += $"Added {added} video(s) to the Queue.";
            if (couldntAdd > 0)
            {
                message += $"\nCould not add {couldntAdd} video(s) to the Queue.";
            }

            await channel.SendMessageAsync(message);
        }
Ejemplo n.º 12
0
    private void UpdateGuildGrid(UIGridItem item)
    {
        GuildInfo info = item.oData as GuildInfo;

        item.onClick = OnClickItem;
        UILabel   rank_label        = item.mScripts[0] as UILabel;
        UITexture guildhead_texture = item.mScripts[1] as UITexture;
        UILabel   guildname_label   = item.mScripts[2] as UILabel;
        UILabel   camp_Label        = item.mScripts[3] as UILabel;
        UILabel   level_label       = item.mScripts[4] as UILabel;
        UILabel   num_label         = item.mScripts[5] as UILabel;
        UITexture leader_texture    = item.mScripts[6] as UITexture;
        UILabel   leadername_label  = item.mScripts[7] as UILabel;
        UISprite  join_btn          = item.mScripts[8] as UISprite;
        UISprite  cancel_btn        = item.mScripts[9] as UISprite;

        guildname_label.text  = info.guildName;
        camp_Label.text       = info.camp.ToString();
        level_label.text      = info.level.ToString();
        num_label.text        = string.Format("{0}/{1}", info.count, mGuildBaseInfo.maxMemberNum);
        leadername_label.text = info.leader;
        rank_label.text       = info.rank.ToString();
        bool isjoin = GuildBaseConfig.mApplyGuildIdList.Contains(info.id);

        join_btn.transform.gameObject.SetActive(!isjoin);
        cancel_btn.transform.gameObject.SetActive(isjoin);

        UIEventListener.Get(join_btn.transform.gameObject).onClick   = OnClickJoin;
        UIEventListener.Get(cancel_btn.transform.gameObject).onClick = OnClickJoin;
    }
Ejemplo n.º 13
0
 /// <summary>
 /// 进入下一个boss
 /// </summary>
 /// <param name="guildInfo">公会信息</param>
 /// <returns>
 /// <para><see langword="true"/> 写入成功</para>
 /// <para><see langword="false"/> 数据库错误</para>
 /// </returns>
 public bool GotoNextBoss(GuildInfo guildInfo)
 {
     try
     {
         using SqlSugarClient dbClient = SugarUtils.CreateSqlSugarClient(DBPath);
         //获取下一个boss的信息
         GuildBattleBoss nextBossData = dbClient.Queryable <GuildBattleBoss>()
                                        .Where(i => i.ServerId == guildInfo.ServerId &&
                                               i.Phase == guildInfo.BossPhase &&
                                               i.Order == guildInfo.Order + 1)
                                        .First();
         GuildInfo updateBossData =
             new GuildInfo()
         {
             Order   = guildInfo.Order + 1,
             HP      = nextBossData.HP,
             TotalHP = nextBossData.HP
         };
         return(dbClient.Updateable(updateBossData)
                .UpdateColumns(i => new { i.Order, i.HP, i.TotalHP })
                .Where(i => i.Gid == GuildEventArgs.SourceGroup.Id)
                .ExecuteCommandHasChange());
     }
     catch (Exception e)
     {
         ConsoleLog.Error("Database error", ConsoleLog.ErrorLogBuilder(e));
         return(false);
     }
 }
Ejemplo n.º 14
0
        public async Task AddServerInfoAsync()
        {
            var response = await DynamoSystem.QueryItemAsync <GuildInfo>("GuildName", QueryOperator.Equal, this.Context.Guild.Name)
                           .ConfigureAwait(false);

            if (response.Count < 1)
            {
                var existsResponse = EmbedHandler.GenerateEmbedResponse(
                    "This server already exists in the DB",
                    Color.Teal);
                await this.ReplyAsync("", false, existsResponse).ConfigureAwait(false);

                return;
            }

            var item = new GuildInfo
            {
                GuildGuid = this.Context.Guild.Id.ToString(),
                GuildName = this.Context.Guild.Name
            };
            await DynamoSystem.PutItemAsync(item).ConfigureAwait(false);

            var addedResponse = EmbedHandler.GenerateEmbedResponse(
                "This server has been added to the DB",
                Color.Green);

            await this.ReplyAsync("", false, addedResponse).ConfigureAwait(false);
        }
 public override void Serialize(IDataWriter writer)
 {
     base.Serialize(writer);
     writer.WriteByte(Level);
     GuildInfo.Serialize(writer);
     writer.WriteInt(ExperienceForGuild);
 }
Ejemplo n.º 16
0
    public void onGetGuildValue(List <object> list, object obj)
    {
        RankMediator.guildRankList.Clear();
        GuildInfo guildInfo;

        for (int i = 0; i < list.Count; ++i)
        {
            Dictionary <string, object> info = list[i] as Dictionary <string, object>;
            guildInfo            = new GuildInfo();
            guildInfo.ranking    = i + 1;
            guildInfo.id         = UtilTools.IntParse(info["dbid"].ToString());
            guildInfo.guildName  = info["guildName"].ToString();
            guildInfo.camp       = UtilTools.IntParse(info["camp"].ToString());
            guildInfo.level      = UtilTools.IntParse(info["level"].ToString());
            guildInfo.leader     = info["leader"].ToString();
            guildInfo.reputation = UtilTools.IntParse(info["reputation"].ToString());
            guildInfo.guildFunds = UtilTools.IntParse(info["guildFunds"].ToString());
            RankMediator.guildRankList.Add(guildInfo.id, guildInfo);
        }
        if (RankMediator.rankMediator != null)
        {
            RankMediator.allPage = Mathf.CeilToInt(UtilTools.IntParse(obj.ToString()) * 1.0f / 7);
            RankMediator.rankMediator.UpdateRankList();
        }
        if (GuildTacticMediator.guildtacticMediator != null)
        {
            GuildTacticMediator.guildtacticMediator.SetGuildListGrid();
        }
    }
Ejemplo n.º 17
0
        public async Task SetupAsync()
        {
            //VARIABLES
            var                guild              = Context.Guild;
            List <Reaction>    reactions          = new List <Reaction>();
            List <Mute>        mutes              = new List <Mute>();
            List <UserWarning> warnings           = new List <UserWarning>();
            CustomAnnouncement customAnnouncement = new CustomAnnouncement();
            GuildInfo          guildInfo          = new GuildInfo
            {
                ServerName   = guild.Name,
                CreationDate = guild.CreatedAt.ToString(),
                Creator      = $"{guild.Owner.Username}#{guild.Owner.Discriminator}",
                CreatorId    = guild.OwnerId,
                BannerURL    = guild.BannerUrl
            };

            GuildModel newGuild = new GuildModel
            {
                GuildID            = guild.Id.ToString(),
                GuildInfo          = guildInfo,
                Mutes              = mutes,
                Reactions          = reactions,
                UserWarnings       = warnings,
                CustomAnnouncement = customAnnouncement
            };

            //Run the InitServer method which inputs the server into the database
            MongoCRUD.Instance.InitServer(newGuild);

            //Reply with setup is complete if it doesnt break
            await ReplyAsync("Setup complete");
        }
Ejemplo n.º 18
0
 /// <summary>
 /// 向数据库插入一刀数据
 /// </summary>
 /// <param name="uid">出刀者UID</param>
 /// <param name="guildInfo">公会信息</param>
 /// <param name="dmg">伤害</param>
 /// <param name="attackType">出刀类型</param>
 /// <returns>
 /// <para>本次出刀刀号</para>
 /// <para><see langword="-1"/> 数据库错误</para>
 /// </returns>
 public int NewAttack(long uid, GuildInfo guildInfo, long dmg, AttackType attackType)
 {
     try
     {
         using var dbClient = SugarUtils.CreateSqlSugarClient(DBPath);
         //插入一刀数据
         var insertData = new GuildBattle()
         {
             Uid    = uid,
             Time   = TimeStamp.GetNowTimeStamp(),
             Order  = guildInfo.Order,
             Round  = guildInfo.Round,
             Damage = dmg,
             Attack = attackType
         };
         return(dbClient.Insertable(insertData)
                .AS(BattleTableName)
                .ExecuteReturnIdentity());
     }
     catch (Exception e)
     {
         Log.Error("Database error", Log.ErrorLogBuilder(e));
         return(-1);
     }
 }
Ejemplo n.º 19
0
        public async Task AssignAsync(string ign)
        {
            try
            {
                User user = new User();
                Realm.GetUserSummary(ign, user);
                Realm.GetUserDescription(user);
                GuildInfo guild = GuildConfig.gConfig.Find(x => x.DiscordID.Contains(Context.Guild.Id.ToString()));
                if (guild.DiscordID == null)
                {
                    Error("This discord has not yet assigned itself a guild with !Setup.", "Please tell an admin.");
                }
                else if (user.Desc1.Contains(Context.User.Id.GetHashCode().ToString()) ||
                         user.Desc2.Contains(Context.User.Id.GetHashCode().ToString()) ||
                         user.Desc3.Contains(Context.User.Id.GetHashCode().ToString()))
                {
                    var _User = Context.User as IGuildUser;
                    await _User.ModifyAsync(p => p.Nickname = user.Name);

                    if (user.Guild == guild.GuildName)
                    {
                        var role = Context.Guild.Roles.FirstOrDefault(x => x.Name.ToString() == user.GuildRank);
                        if (role != null)
                        {
                            await(Context.User as IGuildUser).AddRoleAsync(role);
                            Generic(Color.Green, $"you are a {user.GuildRank} of {guild.GuildName}!", $"I have assigned you the role: {user.GuildRank}, " +
                                    $"and all of the permissions that come with it!");
                        }
                        else
                        {
                            Error("This discord has not generated or made compatible roles for auto-assigning.",
                                  $"Please contact an admin to do **{Config.bot.cmdPrefix}setup true <Guild Name>** to resolve this.");
                        }
                    }
                    else
                    {
                        var role = Context.Guild.Roles.FirstOrDefault(x => x.Name.ToString() == "Guest");
                        if (role != null)
                        {
                            await(Context.User as IGuildUser).AddRoleAsync(role);
                            Generic(Color.Green, "you are not in this discords' guild.", "I have assigned you the role: Guest");
                        }
                        else
                        {
                            Error("This discord has not generated or made compatible roles for auto-assigning.",
                                  $"Please contact an admin to do **{Config.bot.cmdPrefix}setup true <GuildName>** to resolve this.");
                        }
                    }
                }
                else
                {
                    Error($"Your realmeye description does not contain your unique code: **{Context.User.Id.GetHashCode().ToString()}**", "Please enter your unique code anywhere in your realmeye discription and try again later. Realmeye may take a minute or two to update so please be patient.");
                }
            }
            catch (Exception e)
            {
                Error(e.ToString());
            }
        }
Ejemplo n.º 20
0
 private void SetGuildRank()
 {
     for (int i = 0; i < mCurlist.Count; i++)
     {
         GuildInfo info = mCurlist[i];
         info.rank = (i + 1);
     }
 }
Ejemplo n.º 21
0
 public static string GetGuildTitle(GuildInfo guildInfo)
 {
     if (guildInfo == null || guildInfo.titles.get_Count() == 0)
     {
         return(string.Empty);
     }
     return(HeadInfoManager.GetGuildTitle(guildInfo.guildName, guildInfo.titles.get_Item(0)));
 }
Ejemplo n.º 22
0
 public override void Serialize(IDataWriter writer)
 {
     writer.WriteVarUhInt(HouseId);
     writer.WriteInt(InstanceId);
     writer.WriteBoolean(SecondHand);
     GuildInfo.Serialize(writer);
     writer.WriteVarUhInt(Rights);
 }
Ejemplo n.º 23
0
 public void Serialize(IDataWriter writer)
 {
     writer.WriteVarInt((Int32)HouseId);
     writer.WriteInt((Int32)InstanceId);
     writer.WriteBoolean(SecondHand);
     GuildInfo.Serialize(writer);
     writer.WriteVarInt((Int32)Rights);
 }
Ejemplo n.º 24
0
    public void UpdateRankList()
    {
        List <object> list = new List <object>();

        switch (rankType)
        {
        case RankType.Fight:
            foreach (PlayerInfo item in fightRankList.Values)
            {
                list.Add(item);
            }
            break;

        case RankType.Level:
            foreach (PlayerInfo item in levelRankList.Values)
            {
                list.Add(item);
            }
            break;

        case RankType.Money:
            foreach (PlayerInfo item in moneyRankList.Values)
            {
                list.Add(item);
            }
            break;

        case RankType.Official:
            foreach (PlayerInfo item in officialRankList.Values)
            {
                list.Add(item);
            }
            break;

        case RankType.Baller:
            foreach (PlayerInfo item in ballerRankList.Values)
            {
                list.Add(item);
            }
            break;

        case RankType.Guild:
            foreach (GuildInfo item in guildRankList.Values)
            {
                list.Add(item);
            }
            break;
        }
        guildInfo        = null;
        choosePlayerInfo = null;
        panel.rankGrid.ClearCustomGrid();
        panel.rankGrid.AddCustomDataList(list);
        string text = string.Format("[00FF00]{0}[-]", currentPage);

        panel.pageLabel.text = text + "/" + allPage.ToString();
    }
Ejemplo n.º 25
0
        private async Task OnLeavingGuild([NotNull] SocketGuild arg)
        {
            var guild = new GuildInfo
            {
                GuildGuid = arg.Id.ToString(),
                GuildName = arg.Name
            };

            await DynamoSystem.DeleteItemAsync(guild);
        }
Ejemplo n.º 26
0
        public RosterViewmodel(GuildInfo guild, PlayerList members, IEnumerable <UnitDetails> unitDetails)
        {
            Guild   = guild ?? throw new ArgumentNullException("guild");
            Members = members ?? throw new ArgumentNullException("members");

            GuildName = Guild.name;
            units     = unitDetails;

            Export         = new SimpleCommand(ExportTable);
            GenerateReport = new SimpleCommand(() => DoReport(Owner));
        }
Ejemplo n.º 27
0
 public void Serialize(IDataWriter writer)
 {
     writer.WriteInt((Int32)SpouseAccountId);
     writer.WriteVarLong(SpouseId);
     writer.WriteUTF(SpouseName);
     writer.WriteByte(SpouseLevel);
     writer.WriteByte((Byte)Breed);
     writer.WriteByte((Byte)Sex);
     SpouseEntityLook.Serialize(writer);
     GuildInfo.Serialize(writer);
     writer.WriteByte((Byte)AlignmentSide);
 }
Ejemplo n.º 28
0
 public override void Serialize(IDataWriter writer)
 {
     writer.WriteInt(SpouseAccountId);
     writer.WriteVarUhLong(SpouseId);
     writer.WriteUTF(SpouseName);
     writer.WriteByte(SpouseLevel);
     writer.WriteSByte(Breed);
     writer.WriteSByte(Sex);
     SpouseEntityLook.Serialize(writer);
     GuildInfo.Serialize(writer);
     writer.WriteSByte(AlignmentSide);
 }
Ejemplo n.º 29
0
    //公会数据转换
    private GuildInfo ChangeGuildInfo(Dictionary <string, object> data)
    {
        GuildInfo info = new GuildInfo();

        info.id        = GameConvert.IntConvert(data["dbid"]);
        info.guildName = GameConvert.StringConvert(data["guildName"]);
        info.camp      = GameConvert.IntConvert(data["camp"]);
        info.level     = GameConvert.IntConvert(data["level"]);
        info.count     = GameConvert.IntConvert(data["count"]);
        info.leader    = GameConvert.StringConvert(data["leader"]);
        return(info);
    }
Ejemplo n.º 30
0
        /// <summary>
        /// Returns a guild from the info structure based on the
        /// realm and guild as a key. If one doesn't exist,
        /// creates a new one and returns that.
        /// </summary>
        /// <param name="realm">The realm of the guild to return.</param>
        /// <param name="guild">The name of the guild on 'realm' to return.</param>
        /// <returns></returns>
        private GuildInfo GetGuild(string realm, string guild, int target_level)
        {
            string key = GuildInfo.MakeKey(realm, guild);

            if (info.ContainsKey(key))
            {
                return(info[key]);
            }

            info[key] = new GuildInfo(realm, guild, target_level);
            return(info[key]);
        }
        public GuildMemberListViewer()
        {
            this.data = new GuildInfo();
            CreateGrid();
            CreateInfo();

            splitMain.Orientation = Orientation.Horizontal;
            splitMain.Dock = DockStyle.Fill;
            splitMain.SplitterDistance = 10;
            splitMain.FixedPanel = FixedPanel.None;
            splitMain.IsSplitterFixed = false;

            this.Controls.Add(splitMain);
            this.Dock = DockStyle.Fill;
        }
Ejemplo n.º 32
0
        public override int ReadFrom(byte[] Buffer, int StartIndex=0)
        {
            int cursor = StartIndex;

            if ((UserCommandType)Buffer[cursor] != CommandType)
                throw new Exception(ERRORWRONGTYPEBYTE);
            else
            {
                cursor++;                                       // Type     (1 byte)

                GuildInfo = new GuildInfo(Buffer, cursor);      // GuildInfo (n bytes)
                cursor += GuildInfo.ByteLength;              
            }

            return cursor - StartIndex;
        }      
Ejemplo n.º 33
0
 public GUIGuildSchoolItemData(int sId, GuildInfo guildInfo)
 {
     this.mSchoolId = sId;
     this.mGuildInfo = guildInfo;
 }
Ejemplo n.º 34
0
        /// <summary>
        /// Constructor
        /// </summary>
        public DataController()
        {          
            // create lists
            roomObjects = new RoomObjectList(300);
            roomObjectsFiltered = new RoomObjectListFiltered(roomObjects);
            projectiles = new ProjectileList(50);
            onlinePlayers = new OnlinePlayerList(200);
            inventoryObjects = new InventoryObjectList(100);
            avatarCondition = new StatNumericList(5);
            avatarAttributes = new StatNumericList(10);
            avatarSkills = new SkillList(100);
            avatarSpells = new SkillList(100);
            avatarQuests = new SkillList(100);
            roomBuffs = new ObjectBaseList<ObjectBase>(30);
            avatarBuffs = new ObjectBaseList<ObjectBase>(30);
            spellObjects = new SpellObjectList(100);
            backgroundOverlays = new BackgroundOverlayList(5);
            playerOverlays = new ObjectBaseList<PlayerOverlay>(10);            
            chatMessages = new BaseList<ServerString>(101);
            gameMessageLog = new BaseList<GameMessage>(100);
            visitedTargets = new List<RoomObject>(50);
            clickedTargets = new List<uint>(50);
            actionButtons = new ActionButtonList();
            ignoreList = new List<string>(20);
            chatCommandHistory = new List<string>(20);

            // attach some listeners
            RoomObjects.ListChanged += OnRoomObjectsListChanged;
            Projectiles.ListChanged += OnProjectilesListChanged;
            ChatMessages.ListChanged += OnChatMessagesListChanged;

            // make some lists sorted
            OnlinePlayers.SortByName();
            AvatarSkills.SortByResourceName();
            AvatarSpells.SortByResourceName();
            SpellObjects.SortByName();
            
            // create single data objects
            roomInformation = new RoomInfo();
            lightShading = new LightShading(0, new SpherePosition(0, 0));
            backgroundMusic = new PlayMusic();
            guildInfo = new GuildInfo();
            guildShieldInfo = new GuildShieldInfo();
            guildAskData = new GuildAskData();
            diplomacyInfo = new DiplomacyInfo();
            adminInfo = new AdminInfo();
            tradeInfo = new TradeInfo();
            buyInfo = new BuyInfo();
            welcomeInfo = new WelcomeInfo();
            charCreationInfo = new CharCreationInfo();
            statChangeInfo = new StatChangeInfo();
            newsGroup = new NewsGroup();
            objectContents = new ObjectContents();
            effects = new Effects();
            lookPlayer = new PlayerInfo();
            lookObject = new ObjectInfo();
            clientPreferences = new PreferencesFlags();

            // some values
            ChatMessagesMaximum = 100;
            ChatCommandHistoryMaximum = 20;
            ChatCommandHistoryIndex = -1;
            AvatarObject = null;
            IsResting = false;
            SelfTarget = false;
            IsNextAttackApplyCastOnHighlightedObject = false;
            AvatarID = UInt32.MaxValue;
            TargetID = UInt32.MaxValue;
            ViewerPosition = V3.ZERO;
            UIMode = UIMode.None;
        }
Ejemplo n.º 35
0
 public UserCommandGuildInfo(GuildInfo GuildInfo)
 {
     this.GuildInfo = GuildInfo;                      
 }
Ejemplo n.º 36
0
 public GUIGSTargetItemData(int sId, GuildInfo guildInfo, bool isSel)
 {
     this.mSchoolId = sId;
     this.mGuildInfo = guildInfo;
     this.mIsSelected = isSel;
 }