back_recharge
parent
3dfe572bfd
commit
9660e22f9c
|
@ -124,7 +124,7 @@ public interface BIReason {
|
|||
int REPLACE_SOUL_REWARD = 69;//替换魂印
|
||||
|
||||
int JEWEL_DECOMPOSE = 70;//分解宝器
|
||||
|
||||
int FETE_REWARD = 71;//祭祀掉落
|
||||
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||
|
@ -228,6 +228,7 @@ public interface BIReason {
|
|||
|
||||
int JEWEL_BUILD_OR_UP_CONSUME = 1055;//宝器升级或精炼消耗
|
||||
|
||||
int FETE_CONSUME = 1056;//祭祀消耗
|
||||
|
||||
|
||||
}
|
|
@ -10,6 +10,7 @@ import com.ljsd.jieling.exception.LogicException;
|
|||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -43,6 +44,11 @@ public abstract class BaseHandler<T extends GeneratedMessage> {
|
|||
Field field = protoClazz.getField("PARSER");
|
||||
Parser<T> parser = (Parser) field.get(protoClazz);
|
||||
proto=parser.parseFrom(netData.parseClientProtoNetData());
|
||||
GeneratedMessage generatedMessage = processWithProto(iSession.getUid(), proto);
|
||||
if(generatedMessage!=null){
|
||||
MessageUtil.sendIndicationMessage(iSession.getUid(),generatedMessage);
|
||||
return;
|
||||
}
|
||||
processWithProto(iSession,proto);
|
||||
} catch(NoSuchFieldException|SecurityException|IllegalAccessException|IllegalArgumentException|ExceptionInInitializerError|InvalidProtocolBufferException var5){
|
||||
throw new LogicException("解析协议失败",var5);
|
||||
|
@ -71,6 +77,14 @@ public abstract class BaseHandler<T extends GeneratedMessage> {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* process/processWithProto只需要重写一个
|
||||
* 携带返回值 直接返回
|
||||
*/
|
||||
public GeneratedMessage processWithProto(int uid, T proto) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean getTClassIsNull() {
|
||||
Type superClass = this.getClass().getGenericSuperclass();
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildCache;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SGuildLevelConfig;
|
||||
import config.SGuildSacrificeConfig;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: 祭祀请求
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/5/5 15:19
|
||||
*/
|
||||
public class FamilyFeteRequestHandler extends BaseHandler<Family.FamilyFeteRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, Family.FamilyFeteRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
if (user == null)
|
||||
return null;
|
||||
//check cfg
|
||||
int type = proto.getType();
|
||||
SGuildSacrificeConfig sGuildSacrificeConfig = STableManager.getConfig(SGuildSacrificeConfig.class).get(type);
|
||||
if (sGuildSacrificeConfig == null) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
//check guild
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if (guildId == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
|
||||
//check cost
|
||||
boolean enough = ItemUtil.itemCost(user, sGuildSacrificeConfig.getExpend(), BIReason.FETE_CONSUME, 0);
|
||||
if (!enough) {
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
//up value
|
||||
user.getGuildMyInfo().setFetetype(type);
|
||||
|
||||
//drop item
|
||||
ItemUtil.drop(user, sGuildSacrificeConfig.getReward(), BIReason.FETE_REWARD);
|
||||
|
||||
//drop exp
|
||||
//TODO lock 操作公会
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
if (guildInfo == null) {
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NULL);
|
||||
}
|
||||
int addexp = sGuildSacrificeConfig.getGuildExperience();
|
||||
//自动推送给所有成员
|
||||
guildInfo.addFete(sGuildSacrificeConfig.getGuildExperience());
|
||||
|
||||
Map<Integer, SGuildLevelConfig> levelConfigMap = STableManager.getConfig(SGuildLevelConfig.class);
|
||||
if (guildInfo.getExp() + addexp >= levelConfigMap.get(guildInfo.getLevel()).getExp()) {
|
||||
guildInfo.updateLevel(guildInfo.getLevel() + 1);
|
||||
guildInfo.updateExp(guildInfo.getExp() + addexp - levelConfigMap.get(guildInfo.getLevel()).getExp());
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_INFO, "", String.valueOf(guildInfo.getId()), new GuildCache(GameApplication.serverId, guildInfo.getIcon(), guildInfo.getLevel(), guildInfo.getName()));
|
||||
} else {
|
||||
guildInfo.updateExp(guildInfo.getExp() + addexp);
|
||||
}
|
||||
int exp = guildInfo.getExp();
|
||||
return Family.FamilyFeteResponse.newBuilder().setCurExp(exp).build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SGuildSacrificeConfig;
|
||||
import config.SGuildSacrificeRewardConfig;
|
||||
import manager.STableManager;
|
||||
|
||||
/**
|
||||
* Description: 祭祀请求领取奖励
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/5/5 15:19
|
||||
*/
|
||||
public class FamilyGetFeteRewardRequestHandler extends BaseHandler<Family.FamilyGetFeteRewardRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, Family.FamilyGetFeteRewardRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
if(user==null)
|
||||
return null;
|
||||
int id = proto.getId();
|
||||
//check conf
|
||||
SGuildSacrificeRewardConfig sGuildSacrificeRewardConfig = STableManager.getConfig(SGuildSacrificeRewardConfig.class).get(id);
|
||||
if(sGuildSacrificeRewardConfig==null){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
//check guild
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if(guildId == 0){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
|
||||
//check 最近一次公会id
|
||||
if(user.getGuildMyInfo().getFeteguild()!=guildId)
|
||||
throw new ErrorCodeException("当前公会未祭祀");
|
||||
|
||||
|
||||
//check value 检查下公会进度;
|
||||
//TODO 加锁
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
int fete = guildInfo.getFete();
|
||||
if(sGuildSacrificeRewardConfig.getScore()>fete){
|
||||
throw new ErrorCodeException("当前公会祭祀积分进度未达成 target:"+sGuildSacrificeRewardConfig.getScore()+"now:"+fete);
|
||||
}
|
||||
|
||||
//up value
|
||||
user.getGuildMyInfo().addHadTakeReward(id);
|
||||
//drop
|
||||
//drop item
|
||||
ItemUtil.drop(user, sGuildSacrificeRewardConfig.getReward(), BIReason.FETE_REWARD);
|
||||
|
||||
return Family.FamilyFeteResponse.newBuilder().build();
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.logic.friend.FriendLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.GameMisionType;
|
||||
|
@ -318,6 +319,7 @@ public class GlobalDataManaager implements IManager {
|
|||
ActivityLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
||||
GuildLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||
BuyGoodsLogic.flushEveryDay(user);
|
||||
ExpeditionLogic.getInstance().flushUserdataEveryDay(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
|
|
|
@ -6,7 +6,9 @@ import manager.STableManager;
|
|||
import util.CellUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class GuildMyInfo extends MongoBase {
|
||||
private static int speed = 200;
|
||||
|
@ -16,6 +18,10 @@ public class GuildMyInfo extends MongoBase {
|
|||
private long preMoveTimestamp; //上次更新时间
|
||||
private int maxBossHurt; //工会boss最高伤害
|
||||
private int lastHurt; //上一次伤害
|
||||
private int fetetype;//祭祀类型
|
||||
private int feteguild;//祭祀公会id
|
||||
private Set<Integer> hadTakeReward= new HashSet<>();//已经领取的进度奖励
|
||||
|
||||
public void clearOfLevelGuild(){
|
||||
path.clear();
|
||||
curPos = STableManager.getFigureConfig(CommonStaticConfig.class).getInitPos();
|
||||
|
@ -116,4 +122,38 @@ public class GuildMyInfo extends MongoBase {
|
|||
public long getPreMoveTimestamp() {
|
||||
return preMoveTimestamp;
|
||||
}
|
||||
|
||||
public int getFetetype() {
|
||||
return fetetype;
|
||||
}
|
||||
|
||||
public void setFetetype(int fetetype) {
|
||||
this.fetetype = fetetype;
|
||||
updateString("fetetype",fetetype);
|
||||
}
|
||||
|
||||
public int getFeteguild() {
|
||||
return feteguild;
|
||||
}
|
||||
|
||||
public void setFeteguild(int feteguild) {
|
||||
this.feteguild = feteguild;
|
||||
updateString("feteguild",feteguild);
|
||||
}
|
||||
|
||||
public Set<Integer> getHadTakeReward() {
|
||||
return hadTakeReward;
|
||||
}
|
||||
|
||||
public void addHadTakeReward(Integer id) {
|
||||
if(this.hadTakeReward==null){
|
||||
this.hadTakeReward= new HashSet<>();
|
||||
}
|
||||
this.hadTakeReward.add(id);
|
||||
updateString("hadTakeReward",hadTakeReward);
|
||||
}
|
||||
public void clearHadTakeReward() {
|
||||
this.hadTakeReward.clear();
|
||||
updateString("hadTakeReward",hadTakeReward);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package com.ljsd.jieling.logic.dao.root;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.AyncWorkerRunnable;
|
||||
import com.ljsd.jieling.util.InnerMessageUtil;
|
||||
import config.SGuildSetting;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import util.MathUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class GuildInfo extends MongoBase {
|
||||
|
@ -47,6 +49,8 @@ public class GuildInfo extends MongoBase {
|
|||
|
||||
private int intoLevel;
|
||||
|
||||
private int fete;// 公会祈福获得的积分
|
||||
|
||||
public GuildInfo() {
|
||||
setRootCollection(_COLLECTION_NAME);
|
||||
}
|
||||
|
@ -187,10 +191,27 @@ public class GuildInfo extends MongoBase {
|
|||
fightResult.put(type,value);
|
||||
updateString("fightResult."+type,value);
|
||||
}
|
||||
//TODO 外面对公会加锁
|
||||
public void updateExp(int exp){
|
||||
updateString("exp",exp);
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
//TODO 外面对公会加锁
|
||||
public void addFete(int fetev){
|
||||
this.fete+=fetev;
|
||||
updateString("fete",fete);
|
||||
GuildLogic.sendIndicationToMember(this, MessageTypeProto.MessageType.FamilyFeteRewardProcessIndication, Family.FamilyFeteRewardProcessIndication.newBuilder().setScore(fete).build());
|
||||
}
|
||||
public void reSetFete(){
|
||||
this.fete=0;
|
||||
updateString("fete",fete);
|
||||
GuildLogic.sendIndicationToMember(this, MessageTypeProto.MessageType.FamilyFeteRewardProcessIndication, Family.FamilyFeteRewardProcessIndication.newBuilder().setScore(fete).build());
|
||||
}
|
||||
public int getFete() {
|
||||
return fete;
|
||||
}
|
||||
|
||||
public void updateContinueCount(int count){
|
||||
updateString("continueCount",count);
|
||||
this.continueCount = count;
|
||||
|
|
|
@ -12,7 +12,13 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.IEventHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.MinuteTaskEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.*;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
|
@ -26,6 +32,7 @@ import com.ljsd.jieling.network.session.ISession;
|
|||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
|
@ -36,9 +43,73 @@ import util.TimeUtils;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
public class GuildLogic {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(GuildLogic.class);
|
||||
public class GuildLogic {
|
||||
|
||||
static GuildLogic guildLogicInstance = new GuildLogic();
|
||||
public static GuildLogic getInstance(){
|
||||
return guildLogicInstance;
|
||||
};
|
||||
|
||||
public void flushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder)throws Exception {
|
||||
takeAllReward(user);
|
||||
user.getGuildMyInfo().setFetetype(0);
|
||||
user.getGuildMyInfo().clearHadTakeReward();
|
||||
if(null!=fBuilder){
|
||||
fBuilder.setLastFeteType(user.getGuildMyInfo().getFetetype());
|
||||
fBuilder.addAllTakeFeteReward(new HashSet<>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void takeAllReward(User user) throws Exception {
|
||||
|
||||
List<int[][]> itemArrs = new LinkedList<>();
|
||||
|
||||
//补发前日未领取的奖
|
||||
Map<Integer, SGuildSacrificeRewardConfig> config = STableManager.getConfig(SGuildSacrificeRewardConfig.class);
|
||||
if (null == config) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if(guildId == 0){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
|
||||
//check 最近一次公会id
|
||||
if(user.getGuildMyInfo().getFeteguild()!=guildId)
|
||||
return;
|
||||
|
||||
Set<Integer> objects = config.keySet();
|
||||
objects.removeAll(user.getGuildMyInfo().getHadTakeReward());
|
||||
|
||||
for (Integer missionId : objects) {
|
||||
//checkAndUpdate cfg
|
||||
SGuildSacrificeRewardConfig sGuildSacrificeRewardConfig = config.get(missionId);
|
||||
|
||||
//take rewards checkAndUpdate
|
||||
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
int fete = guildInfo.getFete();
|
||||
if(sGuildSacrificeRewardConfig.getScore()>fete){
|
||||
continue;
|
||||
}
|
||||
//up miss
|
||||
int[][] reward = sGuildSacrificeRewardConfig.getReward();
|
||||
itemArrs.add(reward);
|
||||
}
|
||||
|
||||
if (itemArrs.size() == 0)
|
||||
return;
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("guildsacrifice_reward_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("guildsacrifice_reward_txt");
|
||||
String mailReward = ItemUtil.getMailReward(itemArrs);
|
||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||
MailLogic.getInstance().sendMail(user.getId(), title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(GuildLogic.class);
|
||||
|
||||
public static int getMemberType(int targetUid, Map<Integer, Set<Integer>> members ){
|
||||
for(Map.Entry<Integer,Set<Integer>> memberEntry : members.entrySet()){
|
||||
|
@ -501,6 +572,7 @@ public class GuildLogic {
|
|||
GuilidManager.removeOneApplyGuildInfos(guildInfo.getId(),applyId);
|
||||
guildInfo.addMembers(GlobalsDef.MEMBER,applyId);
|
||||
targetUser.getPlayerInfoManager().setGuildId(guildInfo.getId());
|
||||
MessageUtil.sendIndicationMessage(targetUser.getId(),Family.FamilyFeteRewardProcessIndication.newBuilder().setScore(guildInfo.getFete()).build());
|
||||
PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(applyId), PlayerInfoCache.class);
|
||||
cache.setGuildPosition(GlobalsDef.MEMBER);
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(applyId),cache);
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocol.ProtocolsAbstract;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
@ -114,10 +115,13 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
}
|
||||
|
||||
|
||||
public void processMessage(PacketNetData packetNetData) {
|
||||
public void processMessage(ISession session,PacketNetData packetNetData) {
|
||||
BaseHandler baseHandler = handlers.get(packetNetData.getMsgId());
|
||||
if (baseHandler == null) {
|
||||
//检查一下 是否有getMessageCode()返回null
|
||||
//检查一下 是否有getMessageCode()返回null 或者就没有定义handler
|
||||
try {
|
||||
MessageUtil.sendErrorResponse(session, 0, session.getLastMsgId() + 1,"request unknow commond : 通知服务器开发人员");
|
||||
}catch (Exception e){}
|
||||
LOGGER.info("request unknow commond : " + packetNetData.getMsgId());
|
||||
return;
|
||||
} else {
|
||||
|
|
|
@ -126,7 +126,7 @@ public class SessionManager implements INetSession<ISession>, INetReceived<ISess
|
|||
return;
|
||||
}
|
||||
|
||||
ProtocolsManager.getInstance().processMessage(packetNetData);
|
||||
ProtocolsManager.getInstance().processMessage(session,packetNetData);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -137,8 +137,9 @@ public class MinuteTask extends Thread {
|
|||
LOGGER.info("DailyOfFiveTask start ...");
|
||||
GlobalDataManaager.everTask(5);
|
||||
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
|
||||
for(int guild:guildInfoMap.keySet()){
|
||||
RedisUtil.getInstence().del(RedisKey.getKey(RedisKey.GUILD_RED_PACKAGE_RANK,String.valueOf(guild),false));
|
||||
for(Map.Entry<Integer,GuildInfo> guildInfoEntry:guildInfoMap.entrySet()){
|
||||
RedisUtil.getInstence().del(RedisKey.getKey(RedisKey.GUILD_RED_PACKAGE_RANK,String.valueOf(guildInfoEntry.getKey()),false));
|
||||
guildInfoEntry.getValue().reSetFete();
|
||||
}
|
||||
LOGGER.info("DailyOfFiveTask end ...");
|
||||
}
|
||||
|
|
|
@ -444,6 +444,9 @@ public class CBean2Proto {
|
|||
.setFrame(user.getPlayerInfoManager().getHeadFrame())
|
||||
.setMaxBossHurt(user.getGuildMyInfo().getMaxBossHurt())
|
||||
.setLastHurt(user.getGuildMyInfo().getLastHurt())
|
||||
.setLastFeteType(user.getGuildMyInfo().getFetetype())
|
||||
.setLastFeteGuildId(user.getGuildMyInfo().getFeteguild())
|
||||
.addAllTakeFeteReward(user.getGuildMyInfo().getHadTakeReward())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -152,6 +152,9 @@ public class MessageUtil {
|
|||
*/
|
||||
public static void sendIndicationMessage(int uid, GeneratedMessage generatedMessage) {
|
||||
ISession session = OnlineUserManager.getSessionByUid(uid);
|
||||
sendIndicationMessage(session,generatedMessage);
|
||||
}
|
||||
public static void sendIndicationMessage(ISession session, GeneratedMessage generatedMessage) {
|
||||
if(null == session){
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package config;
|
||||
|
||||
import manager.Table;
|
||||
|
||||
@Table(name ="GuildSacrificeConfig")
|
||||
public class SGuildSacrificeConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int[][] expend;
|
||||
|
||||
private int[][] reward;
|
||||
|
||||
private int guildExperience;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int[][] getExpend() {
|
||||
return expend;
|
||||
}
|
||||
|
||||
public int[][] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int getGuildExperience() {
|
||||
return guildExperience;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package config;
|
||||
|
||||
import manager.Table;
|
||||
|
||||
@Table(name ="GuildSacrificeRewardConfig")
|
||||
public class SGuildSacrificeRewardConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int score;
|
||||
|
||||
private int[][] reward;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public int[][] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue