public void CreateRank(string name, GuildRankRights rights) { if (RankList.Count() == MaxRanks) { return; } uint newRankId = (uint)RankList.Count(); Rank rank = new Rank() { RankId = newRankId, Name = name, Rights = (uint)rights, BankMoneyPerDay = 0, Order = newRankId }; RankList.Add(rank); PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.GuildInsBankRightDefault); for (var i = 0; i < GetBankTabSize(); ++i) { stmt.AddValue(0, Guid); stmt.AddValue(1, i); stmt.AddValue(2, newRankId); DB.Characters.Execute(stmt); stmt.Clear(); } rank.SaveToDB(Guid); }
private void SetupModes() { supportedChannelModes.Add(modeFactory.AddChannelMode <ModeBan>()); if (Options.IrcMode == IrcMode.Rfc2810 || Options.IrcMode == IrcMode.Modern) { supportedChannelModes.Add(modeFactory.AddChannelMode <ModeBanException>()); } if (Options.IrcMode == IrcMode.Modern) { supportedChannelModes.Add(modeFactory.AddChannelMode <ModeColorless>()); } supportedChannelModes.Add(modeFactory.AddChannelMode <ModeInvite>()); if (Options.IrcMode == IrcMode.Rfc2810 || Options.IrcMode == IrcMode.Modern) { supportedChannelModes.Add(modeFactory.AddChannelMode <ModeInviteException>()); } supportedChannelModes.Add(modeFactory.AddChannelMode <ModeKey>()); supportedChannelModes.Add(modeFactory.AddChannelMode <ModeLimit>()); supportedChannelModes.Add(modeFactory.AddChannelMode <ModeModerated>()); supportedChannelModes.Add(modeFactory.AddChannelMode <ModeNoExternal>()); supportedChannelModes.Add(modeFactory.AddChannelMode <ModeSecret>()); supportedChannelModes.Add(modeFactory.AddChannelMode <ModePrivate>()); supportedChannelModes.Add(modeFactory.AddChannelMode <ModeTopic>()); if (Options.IrcMode == IrcMode.Modern) { supportedChannelModes.Add(modeFactory.AddChannelMode <ModeTranslate>()); } if (Options.IrcMode == IrcMode.Modern) { supportedRanks.Add(modeFactory.AddChannelRank <ModeHalfOp>()); } supportedRanks.Add(modeFactory.AddChannelRank <ModeOp>()); supportedRanks.Add(modeFactory.AddChannelRank <ModeVoice>()); supportedUserModes.Add(modeFactory.AddUserMode <ModeLocalOperator>()); supportedUserModes.Add(modeFactory.AddUserMode <ModeInvisible>()); supportedUserModes.Add(modeFactory.AddUserMode <ModeOperator>()); supportedUserModes.Add(modeFactory.AddUserMode <ModeRestricted>()); supportedUserModes.Add(modeFactory.AddUserMode <ModeWallops>()); }
private void LoadRank() { RankList.Clear(); foreach (var model in SharedPreference.Instance.RankList) { RankList.Add(model); Title = "RANK"; } var list = RankList.OrderBy(p => p.RANK_CODE); RankList = new ObservableCollection <RankModel>(list); }