消耗道具修改
parent
3698f10c46
commit
7e87ecd563
|
@ -2,8 +2,12 @@ package com.ljsd.jieling.db.redis;
|
||||||
|
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class RedisKey {
|
public class RedisKey {
|
||||||
|
|
||||||
|
|
||||||
public final static String Delimiter_colon = ":";
|
public final static String Delimiter_colon = ":";
|
||||||
|
|
||||||
private final static String areaId = "0";
|
private final static String areaId = "0";
|
||||||
|
@ -169,13 +173,26 @@ public class RedisKey {
|
||||||
|
|
||||||
public static final String MATCH_UID_KEY = "MATCH_UID_KEY";
|
public static final String MATCH_UID_KEY = "MATCH_UID_KEY";
|
||||||
public static final String BLOODY_TEAM = "BLOODY_TEAM";
|
public static final String BLOODY_TEAM = "BLOODY_TEAM";
|
||||||
public static final String BLOODY_SERVER_INFO = "BLOODY_SERVER_INFO";
|
|
||||||
public static final String BLOODY_PERSON_BATTLE_INFO = "BLOODY_PERSON_BATTLE_INFO";
|
public static final String BLOODY_PERSON_BATTLE_INFO = "BLOODY_PERSON_BATTLE_INFO";
|
||||||
public static final String MATCH_SERVER_INFO = "MATCH_SERVER_INFO";
|
public static final String MATCH_SERVER_INFO = "MATCH_SERVER_INFO";
|
||||||
public static final String LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO";
|
public static final String LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO";
|
||||||
|
|
||||||
public final static String CDKEY = "CDKEY";
|
public final static String CDKEY = "CDKEY";
|
||||||
|
|
||||||
|
public static Set<String> familyKey = new HashSet<>();
|
||||||
|
static {
|
||||||
|
familyKey.add(FAMILY_FIGHT);
|
||||||
|
familyKey.add(FAMILY_FIGHT_RANK);
|
||||||
|
familyKey.add(FAMILY_FIGHT_MATCHING_RANK);
|
||||||
|
familyKey.add(FAMILY_ATTACK_BLOOD);
|
||||||
|
familyKey.add(FAMILY_FIGHT_STAR_RANK);
|
||||||
|
familyKey.add(FAMILY_FIGHT_EXTRA_STAR);
|
||||||
|
familyKey.add(FAMILY_FIGHT_CAL_STAR);
|
||||||
|
familyKey.add(FAMILY_FIGHT_BUFF);
|
||||||
|
familyKey.add(FAMILY_FIGHT_ATTACK_COUNT);
|
||||||
|
familyKey.add(FAMILY_FIGHT_TOTAL_STAR);
|
||||||
|
familyKey.add(FAMILY_FIGHT_TOTAL_EXP);
|
||||||
|
}
|
||||||
public static String getKey(String type, String key, boolean withoutServerId) {
|
public static String getKey(String type, String key, boolean withoutServerId) {
|
||||||
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)){
|
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)){
|
||||||
return type + RedisKey.Delimiter_colon + key;
|
return type + RedisKey.Delimiter_colon + key;
|
||||||
|
|
|
@ -993,7 +993,7 @@ public class RedisUtil {
|
||||||
|
|
||||||
public String getKey(String type,String key){
|
public String getKey(String type,String key){
|
||||||
|
|
||||||
if(RedisKey.BLOODY_RANK.equals(type) || RedisKey.BLOODY_TEAM.equals(type) || RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.BLOODY_PERSON_BATTLE_INFO.equals(type)) {
|
if(RedisKey.BLOODY_RANK.equals(type) || RedisKey.BLOODY_TEAM.equals(type) || RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.BLOODY_PERSON_BATTLE_INFO.equals(type)||RedisKey.familyKey.contains(type)) {
|
||||||
return type + RedisKey.Delimiter_colon + key;
|
return type + RedisKey.Delimiter_colon + key;
|
||||||
}
|
}
|
||||||
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||
|
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||
|
||||||
|
|
|
@ -147,4 +147,6 @@ public interface BIReason {
|
||||||
|
|
||||||
int RANDOM_SOULEQUIP_CONSUME = 1036;//占星
|
int RANDOM_SOULEQUIP_CONSUME = 1036;//占星
|
||||||
|
|
||||||
|
int FAMILY_SET_ICON = 1037;//工会修改图腾
|
||||||
|
|
||||||
}
|
}
|
|
@ -3356,7 +3356,11 @@ public class MapLogic {
|
||||||
Item item = itemManager.getItem(mapItem[i]);
|
Item item = itemManager.getItem(mapItem[i]);
|
||||||
int[] it = new int[2];
|
int[] it = new int[2];
|
||||||
it[0] = mapItem[i];
|
it[0] = mapItem[i];
|
||||||
it[1] = item.getItemNum();
|
if(item!=null){
|
||||||
|
it[1] = item.getItemNum();
|
||||||
|
}else{
|
||||||
|
it[1] = 0;
|
||||||
|
}
|
||||||
costItem[i] = it;
|
costItem[i] = it;
|
||||||
}
|
}
|
||||||
ItemUtil.itemCost(user,costItem, BIReason.ENDLESS_REASON_CHANGE,1);
|
ItemUtil.itemCost(user,costItem, BIReason.ENDLESS_REASON_CHANGE,1);
|
||||||
|
|
|
@ -855,8 +855,16 @@ public class GuildLogic {
|
||||||
* @param messageType
|
* @param messageType
|
||||||
*/
|
*/
|
||||||
public static void changeFamilyIcon(ISession session, int iconId, MessageTypeProto.MessageType messageType) throws Exception {
|
public static void changeFamilyIcon(ISession session, int iconId, MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
PlayerManager playerInfoManager = UserManager.getUser(session.getUid()).getPlayerInfoManager();
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||||
GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).updateIcon(iconId);
|
GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).updateIcon(iconId);
|
||||||
|
int[] cost = SGuildSetting.sGuildSetting.getTotemCost();
|
||||||
|
int[][] cost1 = new int[1][];
|
||||||
|
cost1[0] = cost;
|
||||||
|
boolean b = ItemUtil.itemCost(user, cost1, BIReason.FAMILY_SET_ICON, 1);
|
||||||
|
if (!b){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"消耗物品不足");
|
||||||
|
}
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue