社稷大典提交

back_recharge
DESKTOP-98AVA47\Administrator 2020-10-01 00:23:25 +08:00
parent a44c3aa81f
commit 5b660609f4
3 changed files with 29 additions and 9 deletions

View File

@ -1308,4 +1308,16 @@ public class RedisUtil {
}
public void remove(String key){
for (int i = 0; i < MAX_TRY_TIMES; i++) {
try {
redisTemplate.delete(key);
return;
} catch (Exception e) {
}
}
}
}

View File

@ -176,6 +176,8 @@ public class ActivityLogic implements IEventHandler{
if (null == abstractActivity) {
continue;
}
if(openActivityIds.contains(sGlobalActivity.getId()))
continue;
abstractActivity.onActivityStart();
openActivityIds.add(sGlobalActivity.getId());
}

View File

@ -71,21 +71,27 @@ class SheJiActivity extends AbstractActivity {
}
}
//删除本榜单
String key = RedisUtil.getInstence().getKey(RedisKey.EXPERT_RANK, Integer.toString(id));
String key2 = RedisUtil.getInstence().getKey(RedisKey.GUILD_SHEJI_SCORE_RANK, Integer.toString(id));
RedisUtil.getInstence().remove(key);
RedisUtil.getInstence().remove(key2);
}
@Override
public void initActivity(User user) throws Exception {
super.initActivity(user);
//初始化移除道具
SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1);
if (null != sGodSacrificeSetting) {
if (sGodSacrificeSetting.getItemDelete() == 1) {
int[] activityItems = sGodSacrificeSetting.getActivityItems();
for (int item : activityItems) {
user.getItemManager().removeItem(item);
}
}
}
// SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1);
// if (null != sGodSacrificeSetting) {
// if (sGodSacrificeSetting.getItemDelete() == 1) {
// int[] activityItems = sGodSacrificeSetting.getActivityItems();
// for (int item : activityItems) {
// user.getItemManager().removeItem(item);
// }
// }
// }
}