Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw

lvxinran 2020-09-20 20:55:38 +08:00
commit 9e32a22e06
65 changed files with 269 additions and 309 deletions

View File

@ -21,14 +21,14 @@ public class ConcurrentDataMessage {
myMongoTemplate.updateMongoData(take);
}
public static void main(String[] args) throws InterruptedException {
BlockingQueue<Map<String, String>> dataQueueTest = new BlockingUniqueQueue<>();
Map<String,String> test = new HashMap<>();
test.put("1","2");
dataQueueTest.add(new HashMap<>(test));
test.clear();
Map<String, String> take = dataQueueTest.take();
}
// public static void main(String[] args) throws InterruptedException {
// BlockingQueue<Map<String, String>> dataQueueTest = new BlockingUniqueQueue<>();
// Map<String,String> test = new HashMap<>();
// test.put("1","2");
// dataQueueTest.add(new HashMap<>(test));
// test.clear();
// Map<String, String> take = dataQueueTest.take();
//
//
// }
}

View File

@ -107,7 +107,7 @@ public class TimeUtils {
/**
* , : 20110111011059
*/
private static final DateFormat ymdhmsFormat_new = new SimpleDateFormat("yyyyMMddHHmmss");
private static final String ymdhmsFormat_new = "yyyyMMddHHmmss";
/**
* , : 2011-01-11 01:10
*/
@ -120,7 +120,7 @@ public class TimeUtils {
/**
* 19700710
*/
private static final DateFormat ymdFormat = new SimpleDateFormat("yyyyMMdd");
private static final String ymdFormat = "yyyyMMdd";
/**
* 19700710
*/
@ -280,16 +280,14 @@ public class TimeUtils {
* yyyyMMDDHHmmss
*/
public static String getTimeStamp(Long time) {
Date data = new Date(time);
return ymdhmsFormat_new.format(data);
return new SimpleDateFormat(ymdhmsFormat_new).format(new Date(time));
}
/**
* yyyyMMdd
*/
public static String getTimeStampYMD(Long time) {
Date data = new Date(time);
return ymdFormat.format(data);
return new SimpleDateFormat(ymdFormat).format(new Date(time));
}
@ -1302,7 +1300,7 @@ public class TimeUtils {
return now();
}
public static long DifferMintFromLast(Object object){
public static long differMintFromLast(Object object){
try {
String time;
if(null!=object){

View File

@ -9,7 +9,7 @@ import java.util.Random;
* 864
*/
public class Tea {
public static int[] KEY = new int[]{//加密解密所用的KEY
public static final int[] KEY = new int[]{//加密解密所用的KEY
0x789f5645, 0xf68bd5a4,
0x81963ffa, 0x458fac58
};

View File

@ -1,26 +1,21 @@
package com.ljsd;
import com.google.gson.Gson;
import com.ljsd.common.mogodb.util.MongoKeys;
import com.ljsd.jieling.config.json.CoreSettings;
import com.ljsd.jieling.config.json.ServerConfiguration;
import com.ljsd.jieling.config.json.ServerProperties;
import com.ljsd.jieling.core.CoreLogic;
import com.ljsd.jieling.db.mongo.AreaManager;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.network.NetManager;
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
import util.TimeUtils;
import com.ljsd.jieling.logic.dao.ServerConfig;
import com.ljsd.jieling.network.NetManager;
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import util.TimeUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
@ -49,7 +44,7 @@ public class GameApplication {
serverProperties = serverConfiguration.getServerProperties();
serverId = serverProperties.getId();
CoreSettings coreSettings = ConfigurableApplicationContextManager.getBean(CoreSettings.class);
// CoreSettings coreSettings = ConfigurableApplicationContextManager.getBean(CoreSettings.class);
// GameApplication.areaId = coreSettings.getArea();
LOGGER.info("ServerProperties ->{},coreIp=>{}", serverProperties.toString());
MongoUtil.getInstence().init();
@ -84,7 +79,7 @@ public class GameApplication {
serverConfigTmp = new ServerConfig();
if (GameApplication.serverProperties.isAutoOpen()) {
int startbefore = 60; //开服白名单时间
long needtime = TimeUtils.DifferMintFromLast(RedisUtil.getInstence().getObject(GameApplication.serverId + RedisKey.Delimiter_colon + RedisKey.AUTOOPENTIME ,"",String.class,-1));
long needtime = TimeUtils.differMintFromLast(RedisUtil.getInstence().getObject(GameApplication.serverId + RedisKey.Delimiter_colon + RedisKey.AUTOOPENTIME ,"",String.class,-1));
while (needtime - startbefore > 0) {
long sleepTime = needtime - startbefore;
try {
@ -93,7 +88,7 @@ public class GameApplication {
} catch (Exception e) {
LOGGER.error("休眠异常", e.getMessage(), e);
}
needtime = TimeUtils.DifferMintFromLast(RedisUtil.getInstence().getObject(GameApplication.serverId + RedisKey.Delimiter_colon + RedisKey.AUTOOPENTIME ,"",String.class,-1));
needtime = TimeUtils.differMintFromLast(RedisUtil.getInstence().getObject(GameApplication.serverId + RedisKey.Delimiter_colon + RedisKey.AUTOOPENTIME ,"",String.class,-1));
}
}

View File

@ -11,7 +11,6 @@ import java.util.HashMap;
import java.util.Map;
public class UserBloodySnpInfo {
private int serverId;
private int uid;
@ -37,7 +36,6 @@ public class UserBloodySnpInfo {
public UserBloodySnpInfo(int uid, String name) {
this.uid = uid;
this.name = name;
this.serverId = GameApplication.serverId;
}
public void updateHeroSkill(String heroId, String skills){

View File

@ -5,10 +5,7 @@ import com.google.gson.Gson;
import com.ljsd.GameApplication;
import com.ljsd.jieling.chat.ChatRedisEntity;
import com.ljsd.jieling.chat.messge.MessageCache;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
import com.ljsd.jieling.dataReport.reportBeans_37.Report37Response;
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
@ -29,6 +26,8 @@ import com.ljsd.jieling.util.CBean2Proto;
import com.ljsd.jieling.util.MessageUtil;
import com.ljsd.jieling.util.SensitivewordFilter;
import com.ljsd.jieling.util.ShieldedWordUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.TimeUtils;
import java.util.ArrayList;
@ -37,6 +36,8 @@ import java.util.Map;
public class ChatLogic {
private static final Logger LOGGER = LoggerFactory.getLogger(ChatLogic.class);
public static class Instance {
public final static ChatLogic instance = new ChatLogic();
}
@ -84,6 +85,9 @@ public class ChatLogic {
RedisUtil.getInstence().del(GameApplication.serverId + RedisKey.CUser_Chat + uid);
}
break;
default:{
LOGGER.info("getAllChatMessageInfo wrong chatType=>{} uid=>{}", chatType, uid);
}
}
ChatProto.GetChatMessageInfoResponse getChatMessageInfoResponse = ChatProto.GetChatMessageInfoResponse
.newBuilder().addAllChatInfo(chatInfoList)
@ -200,6 +204,9 @@ public class ChatLogic {
}
break;
default:{
break;
}
}
onSendChatSuccess(user,chatType,message);
ReportUtil.onReportEvent(user, ReportEventEnum.SEND_MESSAGE.getType(),String.valueOf(chatType),message);

View File

@ -1,5 +1,5 @@
package com.ljsd.jieling.config.json;
public class GlobalPlatConfigure {
public static PlatConfigure platConfigure = new PlatConfigure();
protected static PlatConfigure platConfigure = new PlatConfigure();
}

View File

@ -1,12 +1,12 @@
package com.ljsd.jieling.config.json;
public class KTSDKConstans {
public static String appidTest = "jl_test";
public static String appidOnlie = "lj_jl_7qdsc";
public static String appidTestOnline = "lj_jl_8qdcs";
public static final String appidTest = "jl_test";
public static final String appidOnlie = "lj_jl_7qdsc";
public static final String appidTestOnline = "lj_jl_8qdcs";
public static String appid = appidTest;
public static String appkey = "c0fb59eb68559b6c9c1463e4d5d0c806";
public static String md5Key = "0A008C48E74E8A399F1F80DBED71161C";
public static String appsecret = "d53b3e8ef74bf72d8aafce3a1c8671a0";
public static final String appkey = "c0fb59eb68559b6c9c1463e4d5d0c806";
public static final String md5Key = "0A008C48E74E8A399F1F80DBED71161C";
public static final String appsecret = "d53b3e8ef74bf72d8aafce3a1c8671a0";
}

View File

@ -1,9 +1,9 @@
package com.ljsd.jieling.config.json;
public class SDK37Constans {
public static String gid = "1006856";
public static String pid = "1";
public static String appkey = "$5wl2BKfodm4nqxVIC0XeHPb9ZRLQFz?";
public static String payKey = "cxSeo5IBl6;kdPOJRgjEYHp9LsQMf+1V";
public static String chatKey = "37opkldcs341";
public static final String gid = "1006856";
public static final String pid = "1";
public static final String appkey = "$5wl2BKfodm4nqxVIC0XeHPb9ZRLQFz?";
public static final String payKey = "cxSeo5IBl6;kdPOJRgjEYHp9LsQMf+1V";
public static final String chatKey = "37opkldcs341";
}

View File

@ -1,26 +1,25 @@
package com.ljsd.jieling.config.reportData;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ljsd.GameApplication;
import com.ljsd.GameLogicService;
import com.ljsd.common.mogodb.util.BlockingUniqueQueue;
import com.ljsd.jieling.config.json.SDK37Constans;
import com.ljsd.jieling.dataReport.reportBeans_37.*;
import com.ljsd.jieling.dataReport.reportBeans_37.Report37Param;
import com.ljsd.jieling.dataReport.reportBeans_37.Report37RoleLeveBean;
import com.ljsd.jieling.dataReport.reportBeans_37.Report37TaskBean;
import com.ljsd.jieling.ktbeans.KTParam;
import com.ljsd.jieling.ktbeans.KTSendBody;
import com.ljsd.jieling.util.MD5Util;
import com.ljsd.jieling.util.http.HttpPool;
import org.apache.http.HttpResponse;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import util.StringUtil;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -143,15 +142,15 @@ public class DataMessageUtils {
return null;
}
final String reserved_char = ";/?:@=&";
String ret = "";
StringBuilder ret = new StringBuilder();
for(int i=0; i < url.length(); i++) {
String cs = String.valueOf( url.charAt(i) );
if(reserved_char.contains(cs)){
ret += cs;
ret.append(cs);
}else{
ret += URLEncoder.encode(cs, "utf-8");
ret.append(URLEncoder.encode(cs, "utf-8"));
}
}
return ret.replace("+", "%20");
return ret.toString().replace("+", "%20");
}
}

View File

@ -19,6 +19,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -54,7 +55,7 @@ public class EndlessFunction implements FunctionManager {
Query query = new Query();
query.with(new Sort(Sort.Direction.DESC,"playerManager.level"));
query.fields().include("playerManager.level");
List<User> users = null;
List<User> users = new ArrayList<>();
try {
users = MongoUtil.getLjsdMongoTemplate().findAllByCondition(query, User.class);
} catch (Exception e) {

View File

@ -1,17 +1,12 @@
package com.ljsd.jieling.dataReport.reportBeans_37;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.json.SDK37Constans;
import com.ljsd.jieling.config.json.ServerProperties;
import com.ljsd.jieling.config.reportData.DataMessageUtils;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.util.MD5Util;
import util.TimeUtils;
import java.util.concurrent.*;
public class Repot37EventUtil {
private static Gson gson = new Gson();
@ -53,6 +48,9 @@ public class Repot37EventUtil {
report37RoleLeveBean.setSign(MD5Util.encrypByMd5(signSt));
DataMessageUtils.addLogQueue(report37RoleLeveBean);
break;
default:{
}
}
}
// public static <T> T hadResReport(Class<T> clazz,User user, Report37EventType eventType, Object... parm){

View File

@ -171,7 +171,7 @@ public class AreaManager {
if (System.currentTimeMillis() > execDate) {
serverArenaInfoManagerCache = serverArenaInfoManager;
int tmpAreaId = areaId;
// int tmpAreaId = areaId;
boolean isSuccess = RedisUtil.getInstence().tryGetDistributedLock(RedisKey.ServerArenaJob, "", Integer.toString(newAreaId), 15000);
int i=0;
while (i<1000&&!isSuccess){

View File

@ -103,7 +103,7 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
}
public <T> T findById(String collectionName, String id, Class<T> clazz) throws Exception {
int serverIdByUid = AreaManager.getInstance().getServerIdByUid(Integer.valueOf(id), GameApplication.serverId);
int serverIdByUid = AreaManager.getInstance().getServerIdByUid(Integer.parseInt(id), GameApplication.serverId);
MongoTemplate otherMonogTemplate = getMongoTemplate(serverIdByUid);
return otherMonogTemplate.findById(id,clazz,collectionName);
}
@ -179,10 +179,10 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
MongoTemplate otherMonogTemplate=null;
if(collection.equals("guildInfo")){
Integer guilderverId = MongoUtil.getInstence().findGuilderverId(Integer.valueOf(id));
Integer guilderverId = MongoUtil.getInstence().findGuilderverId(Integer.parseInt(id));
otherMonogTemplate = MongoUtil.getInstence().getMonogTemplate(guilderverId);
}else {
int serverIdByUid = AreaManager.getInstance().getServerIdByUid(Integer.valueOf(id), GameApplication.serverId);
int serverIdByUid = AreaManager.getInstance().getServerIdByUid(Integer.parseInt(id), GameApplication.serverId);
otherMonogTemplate = MongoUtil.getInstence().getMonogTemplate(serverIdByUid);
}

View File

@ -116,30 +116,30 @@ public class MongoUtil {
return MongoUtil.getInstence().coreMongoTemplate;
}
public static void main(String[] args) {
try {
LjsdMongoTemplate ljsdMongoTemplate = getLjsdMongoTemplate();
Criteria criatira = new Criteria();
Random random = new Random();
int minLevel = random.nextInt(10) - 5;
minLevel = minLevel <= 5 ? 5 : minLevel;
int maxLevel = random.nextInt(10) + 20;
long befor3Day = 1558332518379l - 3;
// criatira.andOperator(Criteria.where("id").nin(10003770),
// Criteria.where("level").gte(minLevel), Criteria.where("level").lte(maxLevel),
// Criteria.where("lastLoginTime").gte(befor3Day));//不包含自己
// Criteria.where("level").is(1);
Query query = new Query(criatira).limit(100);
query.fields().include("playerManager");
long startTime = System.currentTimeMillis();
List<User> allByCondition = ljsdMongoTemplate.findAllByCondition(query, User.class);
System.out.println((System.currentTimeMillis() - startTime));
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
// public static void main(String[] args) {
// try {
// LjsdMongoTemplate ljsdMongoTemplate = getLjsdMongoTemplate();
// Criteria criatira = new Criteria();
// Random random = new Random();
// int minLevel = random.nextInt(10) - 5;
// minLevel = minLevel <= 5 ? 5 : minLevel;
// int maxLevel = random.nextInt(10) + 20;
// long befor3Day = 1558332518379l - 3;
//// criatira.andOperator(Criteria.where("id").nin(10003770),
//// Criteria.where("level").gte(minLevel), Criteria.where("level").lte(maxLevel),
//// Criteria.where("lastLoginTime").gte(befor3Day));//不包含自己
//// Criteria.where("level").is(1);
// Query query = new Query(criatira).limit(100);
// query.fields().include("playerManager");
// long startTime = System.currentTimeMillis();
// List<User> allByCondition = ljsdMongoTemplate.findAllByCondition(query, User.class);
// System.out.println((System.currentTimeMillis() - startTime));
// } catch (UnknownHostException e) {
// e.printStackTrace();
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
public static void checkDb() {

View File

@ -69,7 +69,7 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
if(!b){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
Set<String> ids = new HashSet<>();
// Set<String> ids = new HashSet<>();
// 更新队伍血量
//List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(1001);
// Iterator<TeamPosHeroInfo> iterator = teamPosHeroInfos.iterator();
@ -125,14 +125,14 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RELIVE_HERO_RESONSE_VALUE, build, true);
}
private void relive(User user,String heroId)throws Exception{
private void relive(User user, String heroId) throws Exception {
int reCoverHp = STableManager.getConfig(SExpeditionSetting.class).get(1).getRevive()[1];
double reCoverPer = reCoverHp/10000d;
double reCoverPer = reCoverHp / 10000d;
if(null != heroId||!heroId.isEmpty()){
if (null != heroId && !heroId.isEmpty()) {
// if (expeditionManager.getHeroHP().getOrDefault(heroId, 0d) == 0) {
user.getExpeditionManager().getHeroHPWithChange().put(heroId, reCoverPer);
// if (expeditionManager.getHeroHP().getOrDefault(heroId, 0d) == 0) {
user.getExpeditionManager().getHeroHPWithChange().put(heroId, reCoverPer);
// } else {
// throw new ErrorCodeException(ErrorCode.newDefineCode("英雄复活失败 英雄还存活"));
// }

View File

@ -76,6 +76,8 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
if(!b){
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
}
} else {
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
}
int hurt = 0;

View File

@ -45,8 +45,7 @@ public class GetArenaRecordHandler extends BaseHandler {
Collections.sort(arenaRecordList, new Comparator<ArenaRecord>() {
@Override
public int compare(ArenaRecord o1, ArenaRecord o2) {
Integer createTime = o1.getCreateTime();
return createTime.compareTo(o2.getCreateTime());
return Integer.compare(o1.getCreateTime(), o2.getCreateTime());
}
});
int size = arenaRecordList.size();

View File

@ -33,6 +33,10 @@ public class GetFriendInfoHandler extends BaseHandler {
case 4: //黑名单列表
FriendLogic.getInstance().getBlackFriendInfos(iSession);
break;
default: {
break;
}
}
}
}

View File

@ -110,7 +110,7 @@ public class SaveHeroChangeRequestHandler extends BaseHandler<HeroInfoProto.Save
LOGGER.error("随机失败"+j);
throw new ErrorCodeException(ErrorCode.CFG_NULL);
}
hero.getTemplateId();
// hero.getTemplateId();
hero.setChangeId(result);
return HeroInfoProto.SaveHeroChangeResponse.newBuilder().setHeroTempId(result).build();

View File

@ -1111,7 +1111,7 @@ public class MapLogic {
AbstractRank towerRank = RankContext.getRankEnum(RankEnum.TOWER_RANK.getType());
// TowerRankUtil.getRankNumber(mapManager.getTrialInfo().getFloor(),(int)(mapManager.getCurrTowerTime()/1000))
if(towerRank.getScore(mapManager.getTrialInfo().getFloor(),(int)(mapManager.getCurrTowerTime()/1000))>towerRank.getScoreById(user.getId(),"")){
towerRank.addRank(user.getId(),"",mapManager.getTrialInfo().getFloor(),(int)mapManager.getCurrTowerTime()/1000);
towerRank.addRank(user.getId(),"",mapManager.getTrialInfo().getFloor(),(int)(mapManager.getCurrTowerTime()/1000));
// RedisUtil.getInstence().zsetAddOne(RedisKey.getKey(RedisKey.TOWER_RANK,"",false),String.valueOf(user.getId()),TowerRankUtil.getRankNumber(mapManager.getTrialInfo().getFloor(),(int)(mapManager.getCurrTowerTime()/1000)));
}
}
@ -2612,8 +2612,8 @@ public class MapLogic {
if(endlessHeroInfo.get(heroEntry.getKey())==null){
mapManager.addEndlessHero(heroEntry.getKey(),10000);
}
LOGGER.info("英雄ID{},血量{}",heroEntry.getKey(),endlessHeroInfo.get(heroEntry.getKey()).intValue());
CommonProto.endlessHero endlessHero = CommonProto.endlessHero.newBuilder().setHeroId(heroEntry.getKey()).setHp(endlessHeroInfo.get(heroEntry.getKey()).intValue()).build();
LOGGER.info("英雄ID{},血量{}",heroEntry.getKey(),endlessHeroInfo.get(heroEntry.getKey()));
CommonProto.endlessHero endlessHero = CommonProto.endlessHero.newBuilder().setHeroId(heroEntry.getKey()).setHp(endlessHeroInfo.get(heroEntry.getKey())).build();
response.addHeroInfo(endlessHero);
}
endlessMapInfo.setEndlessHeroInfo(endlessHeroInfo);
@ -3065,6 +3065,10 @@ public class MapLogic {
case 3:
open = playerInfoManager.getMaxForce()>=rule[1];
break;
default:{
LOGGER.info("dailyChallenge wrong type=>{} uid=>{}", rule[0], session.getUid());
break;
}
}
if(!open){
throw new ErrorCodeException(ErrorCode.DAILY_NO_OPEN);
@ -3239,7 +3243,7 @@ public class MapLogic {
}
}
}
response.setBoxDrop(drop);
response.setBoxDrop(drop == null ? CommonProto.Drop.newBuilder() : drop);
return response;
}

View File

@ -21,8 +21,8 @@ public class Cmd_addfete extends GmRoleAbstract {
if(args.length!=2){
return true;
}
int guildId = Integer.valueOf(args[0]);
int addexp = Integer.valueOf(args[1]);
int guildId = Integer.parseInt(args[0]);
int addexp = Integer.parseInt(args[1]);
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);

View File

@ -27,7 +27,7 @@ public class Cmd_addholy extends GmRoleAbstract{
if(args.length!=1){
return true;
}
int itemId = Integer.valueOf(args[0]);
int itemId = Integer.parseInt(args[0]);
ISession iSession = OnlineUserManager.getSessionByUid(getUser().getId());
SExpeditionHolyConfig sExpeditionHolyConfig = STableManager.getConfig(SExpeditionHolyConfig.class).get(itemId);

View File

@ -19,17 +19,17 @@ public class Cmd_restart extends GmRoleAbstract{
if(args.length!=1){
return true;
}
String name = ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].getName();
String name = ProtocolsManager.handlerThreads[Integer.parseInt(args[0])].getName();
LOGGER.error("Exception to change thread name"+ name);
System.out.println("name = " + name);
try {
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].interrupt();
ProtocolsManager.handlerThreads[Integer.parseInt(args[0])].interrupt();
}catch (Exception e){LOGGER.error(e.toString());}
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])]= new HandlerLogicThread();
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].setPriority(9);//优先级最高
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].setName("h-n" + Integer.valueOf(args[0]));
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].start();
ProtocolsManager.handlerThreads[Integer.parseInt(args[0])]= new HandlerLogicThread();
ProtocolsManager.handlerThreads[Integer.parseInt(args[0])].setPriority(9);//优先级最高
ProtocolsManager.handlerThreads[Integer.parseInt(args[0])].setName("h-n" + Integer.valueOf(args[0]));
ProtocolsManager.handlerThreads[Integer.parseInt(args[0])].start();
LOGGER.error("Exception new change thread ok");
return true;
}

View File

@ -37,7 +37,7 @@ public class Cmd_role_gm extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
if(args.length==1){
thisleve = Integer.valueOf(args[0]);
thisleve = Integer.parseInt(args[0]);
}
int NODESTATE_PASS = 3;//已完成

View File

@ -20,8 +20,8 @@ public class Cmd_sendmsg extends GmAbstract {
return false;
}
int speed = Integer.valueOf(args[0]);
int multime = Integer.valueOf(args[1]);
int speed = Integer.parseInt(args[0]);
int multime = Integer.parseInt(args[1]);
double sendTime = args.length <= 3 ? 0 : Float.valueOf(args[2]);
StringBuilder stringBuilder = new StringBuilder();
for (int i = 3; i < args.length; i++) {

View File

@ -428,6 +428,10 @@ public class GlobalDataManaager implements IManager {
case 5:
number = MessageTypeProto.MessageType.SERVER_FIVE_REQEUST_VALUE;
break;
default:{
LOGGER.info("everTask wrong case=>{}", hour);
break;
}
}
for(ISession session : sessionMap.values()){
int uid = session.getUid();

View File

@ -55,7 +55,7 @@ public class LeveGiftEventHander implements IEventHandler {
if(rechargeInfo.getLevelAndMoneyBagMap().containsKey(entry.getKey())){
long lasttime = rechargeInfo.getLevelAndMoneyBagMap().get(entry.getKey());
long i = orDefault.getDiscountType()[3] * 3600*1000;
long i = orDefault.getDiscountType()[3] * 3600*1000L;
if(System.currentTimeMillis()-lasttime<i){
rechargeInfo.addDyGoodsCanBuyTimes(orDefault.getId());
}else {

View File

@ -36,6 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.DefaultTypedTuple;
import org.springframework.data.redis.core.ZSetOperations;
import util.MathUtils;
import util.StringUtil;
import util.TimeUtils;
@ -303,8 +304,8 @@ public class ChampionshipLogic {
TreeMap<Integer, SArenaRobotConfig> sArenaRobotConfigMap = new TreeMap<Integer, SArenaRobotConfig>(new Comparator<Integer>() {
public int compare(Integer a, Integer b) {
int randomOne = (int) (Math.random() * 10);
int randomTwo = (int) (Math.random() * 10);
int randomOne = MathUtils.randomInt();
int randomTwo = MathUtils.randomInt();
if (randomOne == randomTwo) {
randomOne += 1;
}

View File

@ -1,13 +0,0 @@
package com.ljsd.jieling.logic.dao;
import java.util.Map;
import java.util.Set;
public class CardRandomManager {
private Set<Integer> heroIids;
private Map<Integer,Integer> totalConuntByType;
}

View File

@ -241,7 +241,7 @@ public class Equip extends PropertyItem implements Cloneable{
return result;
}
private int getRandomSkill(int[] skills){
if(skills.length<0){
if(skills.length<=0){
return 0;
}
int poolId = MathUtils.randomFromArray(skills);

View File

@ -1,8 +0,0 @@
package com.ljsd.jieling.logic.dao;
public class GoodsInfo {
private int goodsId;
private int type;
private int startTime;
private int endTime;
}

View File

@ -1,6 +1,5 @@
package com.ljsd.jieling.logic.dao;
import com.ljsd.GameApplication;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;

View File

@ -17,6 +17,8 @@ import java.util.concurrent.CopyOnWriteArraySet;
public class PlayerManager extends MongoBase {
private static final long serialVersionUID = 145421254563L;
private transient String openId;
private int pid;
@ -335,20 +337,21 @@ public class PlayerManager extends MongoBase {
}
public void vipFlush( Set<Integer> removePrivileges) {
if (vipInfo.isEmpty()){
if (vipInfo.isEmpty()) {
return;
}
for(Integer id : vipInfo.keySet()){
for (Map.Entry<Integer, VipInfo> entry : vipInfo.entrySet()) {
Integer id = entry.getKey();
SPrivilegeTypeConfig sPrivilegeTypeConfig = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(id);
if(null == sPrivilegeTypeConfig){
if (null == sPrivilegeTypeConfig) {
continue;
}
int refreshType = sPrivilegeTypeConfig.getRefreshType()[0];
if(refreshType == 1&&vipInfo.get(id).getCount()>0){
vipInfo.put(id,new VipInfo());
if (refreshType == 1 && entry.getValue().getCount() > 0) {
vipInfo.put(id, new VipInfo());
}
}
for(Integer remove : removePrivileges){
for (Integer remove : removePrivileges) {
vipInfo.remove(remove);
}
updateString("vipInfo", vipInfo);

View File

@ -1,14 +0,0 @@
package com.ljsd.jieling.logic.dao;
public class QuestionOption {
private String content = "";
private int type;
private String[] options ;
public QuestionOption(String content, int type, String[] options) {
this.content = content;
this.type = type;
this.options = options;
}
}

View File

@ -1,5 +0,0 @@
package com.ljsd.jieling.logic.dao;
public class RingFire {
private int level;
}

View File

@ -32,6 +32,6 @@ public class TeamPosForPokenInfo implements Comparable<TeamPosForPokenInfo>{
@Override
public int compareTo(TeamPosForPokenInfo o) {
return this.getPosition() - o.getPosition();
return Integer.compare(this.getPosition(), o.getPosition());
}
}

View File

@ -33,6 +33,6 @@ public class TeamPosHeroInfo implements Comparable<TeamPosHeroInfo> {
@Override
public int compareTo(TeamPosHeroInfo o) {
return this.getPosition()-o.getPosition();
return Integer.compare(this.getPosition(), o.getPosition());
}
}

View File

@ -1,22 +0,0 @@
package com.ljsd.jieling.logic.dao;
public class TempDropInfo {
private int[] dropGroupIds;
private float dropRatio;
public TempDropInfo(int[] dropGroupIds, float dropRatio) {
this.dropGroupIds = dropGroupIds;
this.dropRatio = dropRatio;
}
public TempDropInfo() {
}
public int[] getDropGroupIds() {
return dropGroupIds;
}
public float getDropRatio() {
return dropRatio;
}
}

View File

@ -80,8 +80,8 @@ public class UserMissionManager extends MongoBase {
vipMissionIdsType.openMission(user,missionId,missionTypeEnumListMap.get(GameMisionType.VIPMISSION));
}
updateString("vipMissionIdsType",vipMissionIdsType);
break;
}
break;
case DAILY_REFRESH:
Set<Integer> missionIds = SDailyTasksConfig.config.keySet();
int type = (int)parm[0];
@ -162,7 +162,7 @@ public class UserMissionManager extends MongoBase {
break;
case SERVENHAPPY_REFRESH:
List<STreasureTaskConfig> sTreasureTaskConfigs = null;
sTreasureTaskConfigs = STableManager.getFigureConfig(TaskStaticConfig.class).getsTreasureTaskConfigListByActivityMap().get((int) parm[0]);
sTreasureTaskConfigs = STableManager.getFigureConfig(TaskStaticConfig.class).getsTreasureTaskConfigListByActivityMap().get(parm[0]);
sevenHappyMissionType.getDoingMissionIds().clear();
sevenHappyMissionType.getFinishMissionIds().clear();
sevenHappyMissionType.getRewardedMissionIds().clear();
@ -277,8 +277,8 @@ public class UserMissionManager extends MongoBase {
for(int quality:qualityArray){
qualityNum.put(quality,qualityNum.getOrDefault(quality,0)+1);
}
for(int quality:qualityNum.keySet()){
List<SMazeTreasure> sMazeTreasures = SMazeTreasure.mazeMapByTaskType.get(quality);
for(Map.Entry<Integer,Integer> entry:qualityNum.entrySet()){
List<SMazeTreasure> sMazeTreasures = SMazeTreasure.mazeMapByTaskType.get(entry.getKey());
int[][] treasures = new int[sMazeTreasures.size()][];
for(int i = 0 ; i<sMazeTreasures.size();i++){
@ -286,7 +286,7 @@ public class UserMissionManager extends MongoBase {
treasures[i][0] = sMazeTreasures.get(i).getId();
treasures[i][1] = 1;
}
int[] ids = MathUtils.randomFromWeightWithTaking(treasures, qualityNum.get(quality));
int[] ids = MathUtils.randomFromWeightWithTaking(treasures, entry.getValue());
// int missionId = sMazeTreasures.get(MathUtils.randomInt(sMazeTreasures.size())).getId();
for(int id:ids){
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+id);
@ -297,6 +297,9 @@ public class UserMissionManager extends MongoBase {
}
updateString("missingRoomMissionType",missingRoomMissionType);
break;
default:{
break;
}
}
}

View File

@ -30,6 +30,6 @@ public class GuildApply implements Comparable<GuildApply>{
@Override
public int compareTo(GuildApply o) {
return this.createTime - o.getCreateTime();
return Integer.compare(this.createTime, o.getCreateTime());
}
}

View File

@ -279,7 +279,7 @@ public class DeathPathLogic {
continue;
}
ZSetOperations.TypedTuple<String> next = iterator.next();
int guildId = Integer.valueOf(next.getValue());
int guildId = Integer.parseInt(next.getValue());
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
Family.DeathPathInfo info = Family.DeathPathInfo.newBuilder().setGuildName(guildInfo.getName()).setPathId(i).setGid(guildId).build();
response.addInfos(info);
@ -332,8 +332,7 @@ public class DeathPathLogic {
class DeathPathExecutor extends Thread{
public static class DeathPathExecutor extends Thread{
public DeathPathExecutor(BlockingQueue<DeathPathTask> blockingQueue) {
this.blockingQueue = blockingQueue;
@ -389,12 +388,12 @@ public class DeathPathLogic {
}else{
ZSetOperations.TypedTuple<String> next = iterator.next();
firstGuildId = Integer.valueOf(next.getValue());
firstGuildId = Integer.parseInt(next.getValue());
doRankAdd(personRank,guildRank,task);
Set<ZSetOperations.TypedTuple<String>> currScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(guildRank.getRedisKey(), String.valueOf(task.getPathId()), 0, 0);
Iterator<ZSetOperations.TypedTuple<String>> currIterator = currScores.iterator();
ZSetOperations.TypedTuple<String> currNext = currIterator.next();
int currFirstGuildId = Integer.valueOf(currNext.getValue());
int currFirstGuildId = Integer.parseInt(currNext.getValue());
if(currFirstGuildId==firstGuildId){
guildTotalRank.addRank(task.getGuildId(),"",task.getDamage());
}else{

View File

@ -1,11 +1,8 @@
package com.ljsd.jieling.logic.family;
import com.googlecode.protobuf.format.JsonFormat;
import com.ljsd.GameApplication;
import com.ljsd.fight.FightType;
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
@ -33,13 +30,16 @@ import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.rank.rankImpl.GuildBossRank;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.*;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.Family;
import com.ljsd.jieling.protocols.FightInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.thread.ThreadManager;
import com.ljsd.jieling.thread.task.GuildFightMatchingTask;
import com.ljsd.jieling.util.*;
import config.SGuildLevelConfig;
import com.ljsd.jieling.util.CBean2Proto;
import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.*;
import manager.STableManager;
import org.slf4j.Logger;
@ -266,19 +266,20 @@ public class GuildFightLogic {
public static void familyFightMatching() throws Exception {
RedisUtil redisUtil = RedisUtil.getInstence();
// Thread.sleep(10000);
Set<Integer> guildIds = GuilidManager.guildInfoMap.keySet();
if (guildIds.size() < 1) {
int guildIds = GuilidManager.guildInfoMap.size();
if (guildIds < 1) {
return;
}
String key = RedisKey.getKey(RedisKey.FAMILY_FIGHT_RANK, "", false);
SGuildSetting guildSetting = sGuildSetting;
for (Integer gid : guildIds) {
for (Map.Entry<Integer,GuildInfo> guildInfoMapEntry : GuilidManager.guildInfoMap.entrySet()) {
Integer gid = guildInfoMapEntry.getKey();
if(redisUtil.getZSetScore("guild-release","",String.valueOf(gid))>0){
continue;
}
Map<Integer, SGuildLevelConfig> configMap = STableManager.getConfig(SGuildLevelConfig.class);
//todo 人数限制
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(gid);
GuildInfo guildInfo = guildInfoMapEntry.getValue();
if(guildInfo.getDefendInfo().size()<configMap.get(guildInfo.getLevel()).getDefendNum()){
continue;
}
@ -376,13 +377,13 @@ public class GuildFightLogic {
private static void sendMatchingInfo(){
RedisUtil redisUtil = RedisUtil.getInstence();
Set<Integer> guildIds = GuilidManager.guildInfoMap.keySet();
for (Integer gid : guildIds) {
for (Map.Entry<Integer,GuildInfo> entry : GuilidManager.guildInfoMap.entrySet()) {
Integer gid = entry.getKey();
int enemyFamily = getEnemyFamily(gid);
if (enemyFamily == -1) {
continue;
}
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(gid);
GuildInfo guildInfo = entry.getValue();
GuildCache enemyInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_INFO, "", String.valueOf(enemyFamily), GuildCache.class);
// GuildInfo enemyInfo = GuilidManager.guildInfoMap.get(enemyFamily);
Family.EnemyFamily familyInfo = Family.EnemyFamily.newBuilder().setId(enemyFamily)

View File

@ -564,6 +564,10 @@ public class GuildLogic {
MessageUtil.sendIndicationMessage(targetSession,1, MessageTypeProto.MessageType.FAMILY_REFUSE_JOIN_INDICATION_VALUE,refuseName,true);
}
break;
default: {
LOGGER.info("operationApplyList wrong type=>{} uid=>{}", type, uid);
break;
}
}
}finally {
RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY,Integer.toString(guildId), Integer.toString(uid));

View File

@ -634,11 +634,12 @@ public class CombatLogic {
}
int nowTime = (int)(TimeUtils.now()/1000);
User findUser = UserManager.getUser(findUserId);
String findRewardMail = ItemUtil.getMailReward(findUser,findRewardgroup, 1.0f);
String title = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_find_reward_title");
String content = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_find_reward__txt");
MailLogic.getInstance().sendMail(findUserId,title,content,findRewardMail,nowTime, Global.MAIL_EFFECTIVE_TIME);
if (findRewardgroup != null) {
String findRewardMail = ItemUtil.getMailReward(findUser,findRewardgroup, 1.0f);
MailLogic.getInstance().sendMail(findUserId,title,content,findRewardMail,nowTime, Global.MAIL_EFFECTIVE_TIME);
}
User killUser = UserManager.getUser(killUid);
String killRewardMail = ItemUtil.getMailReward(killUser,killReward, 1.0f);
title = SErrorCodeEerverConfig.getI18NMessage("adventuren_boss_kill_reward_title");
@ -1046,10 +1047,11 @@ public class CombatLogic {
int count = 0;
do {
isOver = true;
Iterator<Integer> it = tempMap.keySet().iterator();
Iterator<Map.Entry<Integer, Integer>> it = tempMap.entrySet().iterator();
while(it.hasNext()){
int key = it.next();
int value = tempMap.get(key);
Map.Entry<Integer, Integer> entry = it.next();
int key = entry.getKey();
int value = entry.getValue();
SEquipConfig sEquipConfig = config.get(key);
if(sEquipConfig==null)
continue;

View File

@ -4,7 +4,6 @@ import java.util.List;
import java.util.Map;
public class FightEvent {
private String id;
private int attackUid;
private int teamId;
private int mostTime;
@ -50,10 +49,6 @@ public class FightEvent {
return frames;
}
public String getId() {
return id;
}
public List<Integer> getMonsterRemainHp() {
return monsterRemainHp;
}

View File

@ -1,7 +1,5 @@
package com.ljsd.jieling.logic.fight.result;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.protocols.CommonProto;
import java.util.ArrayList;

View File

@ -375,6 +375,10 @@ public class FriendLogic {
case 4://全部拒绝
friendManager.setApplyFriends(new CopyOnWriteArrayList<>());
break;
default: {
LOGGER.info("sendAgree wrong type=>{} uid=>{}", type, uid);
break;
}
}
MessageUtil.sendMessage(iSession, 1, msgId, null, true);
}

View File

@ -274,10 +274,10 @@ public class HeroLogic{
}
private void reportRandom(User user,SLotterySetting sLotterySetting,int[][] resultRandom,int[] costItem){
private void reportRandom(User user,SLotterySetting sLotterySetting,int[][] resultRandom,int[] costItem) {
int lotteryType = sLotterySetting.getLotteryType();
ReportEventEnum eventEnum = null;
switch (lotteryType){
switch (lotteryType) {
case 5:
eventEnum = ReportEventEnum.NORMAL_SUMMON;
break;
@ -289,36 +289,36 @@ public class HeroLogic{
break;
case 2:
eventEnum = ReportEventEnum.SUMMON_HERO;
default:
break;
default:
break;
}
if(eventEnum==null){
if (eventEnum == null) {
return;
}
try {
if(eventEnum == ReportEventEnum.SUMMON_HERO){
ReportUtil.onReportEvent(user,eventEnum.getType(),String.valueOf(resultRandom[0][0]),sLotterySetting.getPropertyType(),resultRandom[0][1]);
if (eventEnum == ReportEventEnum.SUMMON_HERO) {
ReportUtil.onReportEvent(user, eventEnum.getType(), String.valueOf(resultRandom[0][0]), sLotterySetting.getPropertyType(), resultRandom[0][1]);
return;
}
List<String> result = new ArrayList<>(resultRandom.length);
for(int[] random:resultRandom){
if(random==null){
for (int[] random : resultRandom) {
if (random == null) {
continue;
}
SCHero scHero = SCHero.getsCHero().get(random[0]);
if(scHero==null){
if (scHero == null) {
result.add(String.valueOf(random[0]));
}else{
result.add(random[0]+"-"+scHero.getStar());
} else {
result.add(random[0] + "-" + scHero.getStar());
}
}
if(costItem.length==1){
ReportUtil.onReportEvent(user,eventEnum.getType(),"",String.valueOf(sLotterySetting.getPerCount()),String.valueOf(costItem[0]),0,result);
}else if(costItem.length>=2){
ReportUtil.onReportEvent(user,eventEnum.getType(),"",String.valueOf(sLotterySetting.getPerCount()),String.valueOf(costItem[0]),costItem[1],result);
}else {
ReportUtil.onReportEvent(user,eventEnum.getType(),"",String.valueOf(sLotterySetting.getPerCount()),"","",result);
if (costItem.length == 1) {
ReportUtil.onReportEvent(user, eventEnum.getType(), "", String.valueOf(sLotterySetting.getPerCount()), String.valueOf(costItem[0]), 0, result);
} else if (costItem.length >= 2) {
ReportUtil.onReportEvent(user, eventEnum.getType(), "", String.valueOf(sLotterySetting.getPerCount()), String.valueOf(costItem[0]), costItem[1], result);
} else {
ReportUtil.onReportEvent(user, eventEnum.getType(), "", String.valueOf(sLotterySetting.getPerCount()), "", "", result);
}
} catch (Exception e) {
@ -503,16 +503,19 @@ public class HeroLogic{
for(SLotteryRewardConfig sLotteryRewardConfig : sLotteryRewardConfigListByPoolId ){
int[] openRules = sLotteryRewardConfig.getOpenRules();
boolean canAdd = true;
if(openRules!=null&&openRules.length>0){
if (openRules != null && openRules.length > 0) {
int openType = openRules[0];
int openValue = openRules[1];
switch (openType){
switch (openType) {
case 1:
canAdd = randomCount>openValue;
canAdd = randomCount > openValue;
break;
case 2:
canAdd = userLevel > openValue;
break;
default: {
break;
}
}
}
if(canAdd){
@ -2048,6 +2051,10 @@ public class HeroLogic{
case 6:
quality = "UR+";
break;
default: {
quality = "UR+";
break;
}
}
return quality;
}

View File

@ -610,37 +610,37 @@ public class ItemLogic {
public void especialEquipUpStar(ISession session, String heroId) throws Exception {
User user = UserManager.getUser(session.getUid());
Hero hero = user.getHeroManager().getHero(heroId);
if(hero==null){
if (hero == null) {
throw new ErrorCodeException(ErrorCode.newDefineCode("当前法宝不存在"));
}
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
if(scHero.getEquipTalismana()==null && hero.getStar()<scHero.getEquipTalismana()[0]){
if (scHero.getEquipTalismana() == null && hero.getStar() < scHero.getEquipTalismana()[0]) {
throw new ErrorCodeException(ErrorCode.newDefineCode("当前英雄无法升级法宝"));
}
int especialEquipId = scHero.getEquipTalismana()[1];
SEquipTalismana sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquipId).get(hero.getEspecialEquipLevel());
if(sEquipTalismana!=null&&sEquipTalismana.getRankupBasicMaterial()==null){
if (sEquipTalismana == null || sEquipTalismana.getRankupBasicMaterial() == null) {
throw new ErrorCodeException(ErrorCode.newDefineCode("法宝已最大等级"));
}
boolean b = ItemUtil.itemCost(user, sEquipTalismana.getRankupBasicMaterial(), BIReason.ESPECIAL_EQUIP_UP_LEVEL_CONSUME, 1);
if(b){
hero.updateEspecial(hero.getEspecialEquipLevel()+1);
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(),especialEquipId, hero.getEspecialEquipLevel()));
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP,hero.getEspecialEquipLevel(),heroId);
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
if(hero.getEspecialEquipLevel()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_equiptalisman_content_parm)){
if (b) {
hero.updateEspecial(hero.getEspecialEquipLevel() + 1);
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(), especialEquipId, hero.getEspecialEquipLevel()));
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, hero.getEspecialEquipLevel(), heroId);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE, null, true);
if (hero.getEspecialEquipLevel() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_equiptalisman_content_parm)) {
SItem sItem = SItem.getsItemMap().get(especialEquipId);
if(sItem.getQuantity()<5){
if (sItem.getQuantity() < 5) {
return;
}
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_equiptalisman_content", new Object[]{user.getPlayerInfoManager().getNickName(), sItem.getName(),hero.getEspecialEquipLevel()});
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sItem.getId(),0,0,0,0,0);
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_equiptalisman_content", new Object[]{user.getPlayerInfoManager().getNickName(), sItem.getName(), hero.getEspecialEquipLevel()});
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT, sItem.getId(), 0, 0, 0, 0, 0);
}
if(HeroLogic.getInstance().isInTeam(user,heroId,1)){
if (HeroLogic.getInstance().isInTeam(user, heroId, 1)) {
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
}
}else{
} else {
throw new ErrorCodeException(ErrorCode.ITEM_ESPECIAL_EQUIP_UP_ITEM_NOT);
}
}

View File

@ -499,7 +499,10 @@ public class PlayerLogic {
case 2:
rewards[i][1] = rewardTemplate[2] * user.getPlayerInfoManager().getVipLevel();
break;
default:{
rewards[i][1] = rewardTemplate[2];
break;
}
}
}
mailReward = ItemUtil.getMailReward(rewards);
@ -902,6 +905,9 @@ public class PlayerLogic {
case GlobalsDef.VIP_UNLOCK_PRIVILEGE:
cond = user.getPlayerInfoManager().getVipLevel();
break;
default:{
break;
}
}
TreeMap<Integer, Integer> condition = (TreeMap)conditionMap.get(privilegeId);
if(sPrivilegeTypeConfig.getUnlockType()!=GlobalsDef.RECHARGE_UNLOCK_PRIVILEGE){

View File

@ -33,9 +33,6 @@ public class CQuestionOptionBean {
return options;
}
public void setOptions(String[] options) {
this.options = options;
}
public int getAnswerType() {
return answerType;

View File

@ -79,8 +79,8 @@ public class QuestionLogic {
long time = System.currentTimeMillis() / 1000;
for (Map.Entry<Integer, CQuestionBean> entry : questionBeanMap.entrySet()) {
long start = Long.valueOf(entry.getValue().getStart());
long end = Long.valueOf(entry.getValue().getEnd());
long start = Long.parseLong(entry.getValue().getStart());
long end = Long.parseLong(entry.getValue().getEnd());
if (start > time) {
continue;
}
@ -115,9 +115,9 @@ public class QuestionLogic {
if (last.size() != 0) {
//开启
CQuestionBean cQuestionBean = last.first();
int qid = Integer.valueOf(cQuestionBean.getId());
int qid = Integer.parseInt(cQuestionBean.getId());
if (qid != globalSystemControl.getQuestId()) {
globalSystemControl.setQuestId(Integer.valueOf(cQuestionBean.getId()));
globalSystemControl.setQuestId(Integer.parseInt(cQuestionBean.getId()));
globalSystemControl.addQuestion(new Question(cQuestionBean.getId(), cQuestionBean.getQuestDes(), cQuestionBean.getReward(), cQuestionBean.getStart(), cQuestionBean.getEnd(), cQuestionBean.getcQuestionOptionBeans()));
globalSystemControl.resetLast();
isNeedUp = true;

View File

@ -109,7 +109,7 @@ public class BuyGoodsLogic {
int goodsId = 0;
SRechargeCommodityConfig sRechargeCommodityConfig;
if(isNumeric(sdkGoodsId)){
goodsId = Integer.valueOf(sdkGoodsId);
goodsId = Integer.parseInt(sdkGoodsId);
sRechargeCommodityConfig =SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsId);
}else {
sRechargeCommodityConfig = SRechargeCommodityConfig.sdkRechargeCommodityConfigMap.get(sdkGoodsId);
@ -581,13 +581,13 @@ public class BuyGoodsLogic {
continue;
}
startTime = levelAndMoneyBagMap.get(value);
long i = discountType[3] * 3600*1000;
long i = discountType[3] * 3600*1000L;
if(now-startTime>=i){
//超过2小时重置动态购买次数
rechargeInfo.removeDyGoodsCanBuyTimes(goodsId);
continue;
}
endTime = startTime + discountType[3]*3600*1000;
endTime = startTime + discountType[3]*3600*1000L;
}

View File

@ -285,7 +285,7 @@ public class StoreLogic implements IEventHandler {
long endTime = sStoreTypeConfig.getEndTimeLong();
if(sStoreTypeConfig.getStoreOpenRule() == 2 ){
startTime = now;
endTime =Integer.parseInt(sStoreTypeConfig.getEndTime())*60*1000 + now;
endTime =Integer.parseInt(sStoreTypeConfig.getEndTime())*60*1000L + now;
}
if(sStoreTypeConfig.getStoreOpenRule() == 6 ){
long userCreateTime = user.getPlayerInfoManager().getCreateTime();
@ -314,7 +314,7 @@ public class StoreLogic implements IEventHandler {
long startTime = now;
long endTime = 0;
if(sStoreTypeConfig.getStoreOpenRule() == 2 ){
endTime =Integer.parseInt(sStoreTypeConfig.getEndTime())*60*1000 + now;
endTime =Integer.parseInt(sStoreTypeConfig.getEndTime())*60*1000L + now;
}
Map<Integer, Integer> itemNumMap = new LinkedHashMap<>();
int rewardId = getRewardId(storeType,sort,user);
@ -691,13 +691,17 @@ public class StoreLogic implements IEventHandler {
}
case 3:
long lastRefreshTime = storeInfo.getLastRefreshTime();
int intervalTime = time*1000*60*60;
if (((nowTime - lastRefreshTime) /1000/60/60) >= time){
lastRefreshTime = lastRefreshTime + ((nowTime -lastRefreshTime)/(intervalTime)) *(intervalTime);
int intervalTime = time * 1000 * 60 * 60;
if (((nowTime - lastRefreshTime) / 1000 / 60 / 60) >= time) {
lastRefreshTime = lastRefreshTime + ((nowTime - lastRefreshTime) / (intervalTime)) * (intervalTime);
storeInfo.setLastRefreshTime(lastRefreshTime);
itemNumMap = getStoreItem(sStoreTypeConfig.getId(),sStoreTypeConfig,user);
itemNumMap = getStoreItem(sStoreTypeConfig.getId(), sStoreTypeConfig, user);
}
break;
default: {
LOGGER.info("automaticRefreStore wrong type=>{} uid=>{}", type, uid);
break;
}
}
if (itemNumMap == null){
LOGGER.info("automaticRefreStore==>uid={},storeid={},type={}",uid,storeId,type);

View File

@ -174,7 +174,7 @@ public class ProtocolsManager implements ProtocolsAbstract {
try {
String crowdnum = RedisUtil.getInstence().getMapValue(RedisKey.GLOBAL_SYS_PRO,"","onlinenum",String.class);
if(null!=crowdnum&&!crowdnum.equals("")){
Blocker.maxAllowedOnlineAccountCount.set(Integer.valueOf(crowdnum));
Blocker.maxAllowedOnlineAccountCount.set(Integer.parseInt(crowdnum));
}
}catch (Exception e){
}

View File

@ -35,9 +35,6 @@ public class RetrySendIndicationThread extends Thread{
private void doWork() throws InterruptedException {
Map<Integer, ISession> sessionMap = new ConcurrentHashMap<>(OnlineUserManager.sessionMap);
if(sessionMap == null){
return;
}
long now = TimeUtils.now();
Set<Integer> removeIds = new HashSet<>();
for(ISession session : sessionMap.values()){

View File

@ -7,13 +7,11 @@ import com.ljsd.jieling.logic.dao.root.User;
*/
public class AyyncWorker implements AyncWorkerRunnable {
private User user;
private boolean isTask;
private AyncWorkerRunnable ayncWorkerRunnable;
public AyyncWorker(User user, boolean isTask, AyncWorkerRunnable ayncWorkerRunnable) {
this.user = user;
this.isTask = isTask;
this.ayncWorkerRunnable = ayncWorkerRunnable;
}
@ -28,10 +26,6 @@ public class AyyncWorker implements AyncWorkerRunnable {
this.user = user;
}
public void setTask(boolean task) {
isTask = task;
}
public User getUser() {
return user;
}

View File

@ -296,7 +296,7 @@ public class FightDataUtil {
if (StringUtil.isEmpty(skillId)){
return skill;
}
SSkillLogicVo sSkillLogicVo = SSkillLogicConfig.getsSkillLogicVo(Integer.valueOf(skillId));
SSkillLogicVo sSkillLogicVo = SSkillLogicConfig.getsSkillLogicVo(Integer.parseInt(skillId));
if (sSkillLogicVo != null && sSkillLogicVo.getSkillTargetVoList().size()>0) {
// float cd = sSkillLogicVo.getCd();
// if(args!=null&&args.length>0){

View File

@ -360,9 +360,9 @@ public class ItemUtil {
String[] rewards= rewardStr.split("#");
String[] weights= weight.split("#");
for (int i = 0; i < rewards.length; i++) {
int rewardId = Integer.valueOf(rewards[i]);
int rewardId = Integer.parseInt(rewards[i]);
if (dropAddition.contains(rewardId)) {
int dropWeight = Integer.valueOf(weights[i]);
int dropWeight = Integer.parseInt(weights[i]);
SRewardItem sRewardItem = SRewardItem.getsDropMap().get(rewardId);
//权重加成 1等级权重加成
int[] chanceAddition = sRewardItem.getChanceAddition();
@ -398,26 +398,26 @@ public class ItemUtil {
private static void getSuccessivelyRandmoMap(User user,SRewardGroup sRewardGroup, String[]
rewardArr, String[] weightArr, Map<Integer, Integer> itemMap, Map<Integer, Integer>
cardMap, Map<Integer,Integer> equipMap, Map<Integer,Integer> randomMap, float dropRatio) throws ErrorCodeException{
for (int i = 0 ; i < sRewardGroup.getRewardMaxNum();i++){
cardMap, Map<Integer,Integer> equipMap, Map<Integer,Integer> randomMap, float dropRatio) throws ErrorCodeException {
for (int i = 0; i < sRewardGroup.getRewardMaxNum(); i++) {
int id = 0;
for (int j = 0 ; j < sRewardGroup.getLoop();i++){
for (int j = 0; j < sRewardGroup.getLoop(); j++) {
int index = MathUtils.randomForStrArray(weightArr);
id = Integer.parseInt(rewardArr[index]);
if (id ==Integer.parseInt(rewardArr[j])){
if (id == Integer.parseInt(rewardArr[j])) {
break;
}
}
if (0 == id){
if (0 == id) {
int index = MathUtils.randomForStrArray(weightArr);
id = Integer.parseInt(rewardArr[index]);
}
SRewardItem sRewardItem = SRewardItem.getsDropMap().get(id);
int itemNum = getItemNum(user,sRewardItem);
if (itemNum <= 0){
int itemNum = getItemNum(user, sRewardItem);
if (itemNum <= 0) {
continue;
}
getMap(sRewardItem.getItemId(),itemNum ,itemMap, cardMap,equipMap,randomMap,dropRatio);
getMap(sRewardItem.getItemId(), itemNum, itemMap, cardMap, equipMap, randomMap, dropRatio);
}
}

View File

@ -99,7 +99,7 @@ public class SBloodyBattleSetting implements BaseConfig {
}
int[][][] monsterPatrol = sBloodyBattleSettingTmp.getMonsterPatrol();
int[][] monster = sBloodyBattleSettingTmp.getMonster();
// int[][] monster = sBloodyBattleSettingTmp.getMonster();
Map<Integer, List<Integer>> monsterPotrolPaths = new HashMap<>(monsterPatrol.length);
for(int i=0;i<monsterPatrol.length;i++){

View File

@ -293,7 +293,7 @@ public class SGameSetting implements BaseConfig {
}
public void setShowRank(int showRank) {
showRank = showRank;
this.showRank = showRank;
}
public int getMaxNameLength() {

View File

@ -100,7 +100,7 @@ public class SSpecialConfig implements BaseConfig {
if (value == null) {
return -1;
}
return Integer.valueOf(value);
return Integer.parseInt(value);
}
public static int[] getOnceArrayValue(String key) {

View File

@ -229,7 +229,7 @@ public class STableManager {
try {
dealParams(clazz, map, key, type, obj, prarms);
}catch (Exception e){
System.out.println("clazz = [" + clazz + "], line = [" + line.substring(0,10) + "]"+prarms.toString() );
LOGGER.error("clazz = [" + clazz + "], line = [" + line.substring(0,10) + "]"+prarms.toString() );
throw e;
}
break;

View File

@ -35,7 +35,6 @@ public class ExcelUtils {
}
public static void genJavaFile(String fileName){
Map<String,String> fieldInfo = new HashMap<>();
File file = new File("conf/server/"+fileName +".txt");
StringBuffer stringBuffer = new StringBuffer("package config;\n" +
"\n" +