充值活动

back_recharge
wangyuan 2019-06-04 10:12:11 +08:00
parent c70d69a187
commit e354951bf7
14 changed files with 177 additions and 63 deletions

View File

@ -28,3 +28,10 @@ int int mut,int#int,2 mut,int#int,2
37 3 7051 3#20000
38 3 8051 14#200000
39 3 9051 10001#1
40 4 1 10005#1
41 5 6#1 16#100|3#5000
42 5 6#2 16#100|3#5001
43 5 6#3 16#100|3#5002
44 5 100#1 16#100|3#5003
45 5 100#2 16#100|3#5004
46 5 100#3 16#100|3#5005

View File

@ -3,3 +3,5 @@ int int string string int
1 1 0 604800 2
2 2 0 604800 2
3 3 0 0 1
4 4 0 0 1
5 5 0 0 1

View File

@ -2533,7 +2533,7 @@ int int int float int int
100638 6018 25 1.0 1 1
100639 6019 25 1.0 1 1
100640 6020 25 1.0 1 1
210101 3 100 1.0 1300 10000
210101 3 100 1.0 1300 1300
210102 3 100 1.0 1700 1700
210103 3 100 1.0 2300 2300
210201 3 100 1.0 2400 2400

View File

@ -109,16 +109,16 @@ int string int int int mut,int#int,1 mut,int#int,1 int mut,int#int,2 int int int
122 止玄秘录-蓝图 3 4 100 1#100 3017#1 1 25|0#0#0#500 0 1 0 0
123 无锋秘录-蓝图 3 4 100 1#100 3018#1 1 25|0#0#0#500 0 1 0 0
124 千钧秘录-蓝图 3 4 100 1#100 3019#1 1 25|0#0#0#500 0 1 0 0
125 撼岳秘录-蓝图 3 4 100 1#100 3020#1 1 25|0#0#0#500 0 1 0 0
126 逐光战甲-蓝图 3 4 100 1#100 3021#1 1 25|0#0#0#500 0 1 0 0
127 遗迹战甲-蓝图 3 4 100 1#100 3022#1 1 25|0#0#0#500 0 1 0 0
128 天启战甲-蓝图 3 4 100 1#100 3023#1 1 25|0#0#0#500 0 1 0 0
129 遗迹战盔-蓝图 3 4 100 1#100 3024#1 1 25|0#0#0#500 0 1 0 0
130 天启战盔-蓝图 3 4 100 1#100 3025#1 1 25|0#0#0#500 0 1 0 0
131 遗迹战靴-蓝图 3 4 100 1#100 3026#1 1 25|0#0#0#500 0 1 0 0
132 天启战靴-蓝图 3 4 100 1#100 3027#1 1 25|0#0#0#500 0 1 0 0
133 离恨神杖-蓝图 3 4 100 1#100 3028#1 1 25|0#0#0#500 0 1 0 0
134 无始神杖-蓝图 3 4 100 1#100 3029#1 1 25|0#0#0#500 0 1 0 0
125 撼岳秘录-蓝图 3 5 100 1#100 3020#1 1 25|0#0#0#500 0 1 0 0
126 逐光战甲-蓝图 3 5 100 1#100 3021#1 1 25|0#0#0#500 0 1 0 0
127 遗迹战甲-蓝图 3 5 100 1#100 3022#1 1 25|0#0#0#500 0 1 0 0
128 天启战甲-蓝图 3 5 100 1#100 3023#1 1 25|0#0#0#500 0 1 0 0
129 遗迹战盔-蓝图 3 5 100 1#100 3024#1 1 25|0#0#0#500 0 1 0 0
130 天启战盔-蓝图 3 5 100 1#100 3025#1 1 25|0#0#0#500 0 1 0 0
131 遗迹战靴-蓝图 3 5 100 1#100 3026#1 1 25|0#0#0#500 0 1 0 0
132 天启战靴-蓝图 3 5 100 1#100 3027#1 1 25|0#0#0#500 0 1 0 0
133 离恨神杖-蓝图 3 5 100 1#100 3028#1 1 25|0#0#0#500 0 1 0 0
134 无始神杖-蓝图 3 5 100 1#100 3029#1 1 25|0#0#0#500 0 1 0 0
135 归凡神杖-蓝图 3 5 100 1#100 3030#1 1 25|0#0#0#500 0 1 0 0
136 道衍神杖-蓝图 3 5 100 1#100 3031#1 1 25|0#0#0#500 0 1 0 0
137 离恨神刺-蓝图 3 5 100 1#100 3032#1 1 25|0#0#0#500 0 1 0 0
@ -128,54 +128,56 @@ int string int int int mut,int#int,1 mut,int#int,1 int mut,int#int,2 int int int
141 离恨神戟-蓝图 3 5 100 1#100 3036#1 1 25|0#0#0#500 0 1 0 0
142 无始神戟-蓝图 3 5 100 1#100 3037#1 1 25|0#0#0#500 0 1 0 0
143 归凡神戟-蓝图 3 5 100 1#100 3038#1 1 25|0#0#0#500 0 1 0 0
144 道衍神戟-蓝图 3 5 100 1#100 3039#1 1 25|0#0#0#500 0 1 0 0
145 离恨古剑-蓝图 3 5 100 1#100 3040#1 1 25|0#0#0#500 0 1 0 0
146 无始古剑-蓝图 3 5 100 1#100 3041#1 1 25|0#0#0#500 0 1 0 0
147 归凡古剑-蓝图 3 5 100 1#100 3042#1 1 25|0#0#0#500 0 1 0 0
148 道衍古剑-蓝图 3 5 100 1#100 3043#1 1 25|0#0#0#500 0 1 0 0
149 离恨宝录-蓝图 3 5 100 1#100 3044#1 1 25|0#0#0#500 0 1 0 0
150 无始宝录-蓝图 3 5 100 1#100 3045#1 1 25|0#0#0#500 0 1 0 0
151 归凡宝录-蓝图 3 5 100 1#100 3046#1 1 25|0#0#0#500 0 1 0 0
152 道衍宝录-蓝图 3 5 100 1#100 3047#1 1 25|0#0#0#500 0 1 0 0
153 神凰羽衣-蓝图 3 5 100 1#100 3048#1 1 25|0#0#0#500 0 1 0 0
154 饕餮战衣-蓝图 3 5 100 1#100 3049#1 1 25|0#0#0#500 0 1 0 0
155 轮回羽衣-蓝图 3 5 100 1#100 3050#1 1 25|0#0#0#500 0 1 0 0
156 盘龙战甲-蓝图 3 5 100 1#100 3051#1 1 25|0#0#0#500 0 1 0 0
157 麒麟战盔-蓝图 3 5 100 1#100 3052#1 1 25|0#0#0#500 0 1 0 0
158 应龙战盔-蓝图 3 5 100 1#100 3053#1 1 25|0#0#0#500 0 1 0 0
159 九霄华冠-蓝图 3 5 100 1#100 3054#1 1 25|0#0#0#500 0 1 0 0
160 麒麟战靴-蓝图 3 5 100 1#100 3055#1 1 25|0#0#0#500 0 1 0 0
161 应龙战靴-蓝图 3 5 100 1#100 3056#1 1 25|0#0#0#500 0 1 0 0
162 九霄华履-蓝图 3 5 100 1#100 3057#1 1 25|0#0#0#500 0 1 0 0
163 四星万能碎片 3 6 100 1#100 12012#25 1 25|0#0#0#500 0 1 0 0
144 道衍神戟-蓝图 3 6 100 1#100 3039#1 1 25|0#0#0#500 0 1 0 0
145 离恨古剑-蓝图 3 6 100 1#100 3040#1 1 25|0#0#0#500 0 1 0 0
146 无始古剑-蓝图 3 6 100 1#100 3041#1 1 25|0#0#0#500 0 1 0 0
147 归凡古剑-蓝图 3 6 100 1#100 3042#1 1 25|0#0#0#500 0 1 0 0
148 道衍古剑-蓝图 3 6 100 1#100 3043#1 1 25|0#0#0#500 0 1 0 0
149 离恨宝录-蓝图 3 6 100 1#100 3044#1 1 25|0#0#0#500 0 1 0 0
150 无始宝录-蓝图 3 6 100 1#100 3045#1 1 25|0#0#0#500 0 1 0 0
151 归凡宝录-蓝图 3 6 100 1#100 3046#1 1 25|0#0#0#500 0 1 0 0
152 道衍宝录-蓝图 3 6 100 1#100 3047#1 1 25|0#0#0#500 0 1 0 0
153 神凰羽衣-蓝图 3 6 100 1#100 3048#1 1 25|0#0#0#500 0 1 0 0
154 饕餮战衣-蓝图 3 6 100 1#100 3049#1 1 25|0#0#0#500 0 1 0 0
155 轮回羽衣-蓝图 3 6 100 1#100 3050#1 1 25|0#0#0#500 0 1 0 0
156 盘龙战甲-蓝图 3 6 100 1#100 3051#1 1 25|0#0#0#500 0 1 0 0
157 麒麟战盔-蓝图 3 6 100 1#100 3052#1 1 25|0#0#0#500 0 1 0 0
158 应龙战盔-蓝图 3 6 100 1#100 3053#1 1 25|0#0#0#500 0 1 0 0
159 九霄华冠-蓝图 3 6 100 1#100 3054#1 1 25|0#0#0#500 0 1 0 0
160 麒麟战靴-蓝图 3 6 100 1#100 3055#1 1 25|0#0#0#500 0 1 0 0
161 应龙战靴-蓝图 3 6 100 1#100 3056#1 1 25|0#0#0#500 0 1 0 0
162 九霄华履-蓝图 3 6 100 1#100 3057#1 1 25|0#0#0#500 0 1 0 0
101 100金币 2 1 100 1#100 14#100 1 14|0#0#0#100 0 1 0 0
102 1000金币 2 2 100 1#100 14#1000 1 14|0#0#0#100 0 2 0 0
103 10000金币 2 3 100 1#100 14#10000 1 14|0#0#0#100 0 3 0 0
104 55555金币 2 1 100 1#100 14#5555 1 14|0#0#0#100 0 4 0 2
201 史诗减伤符文 4 1 100 1#100 8025#1 1 24|0#0#0#120 0 1 0 0
202 史诗增伤符文 4 1 100 1#100 8026#1 1 24|0#0#0#120 0 1 0 0
203 史诗命中符文 4 1 100 1#100 8027#1 1 24|0#0#0#120 0 1 0 0
204 史诗抵抗符文 4 1 100 1#100 8028#1 1 24|0#0#0#120 0 1 0 0
205 史诗暴击符文 4 2 100 1#100 8029#1 1 24|0#0#0#120 0 1 0 0
206 史诗暴伤符文 4 2 100 1#100 8030#1 1 24|0#0#0#120 0 1 0 0
207 传说减伤符文 4 2 100 1#100 8031#1 1 24|0#0#0#120 0 1 0 0
208 传说增伤符文 4 2 100 1#100 8032#1 1 24|0#0#0#120 0 1 0 0
209 传说命中符文 4 3 100 1#100 8033#1 1 24|0#0#0#120 0 1 0 0
210 传说抵抗符文 4 3 100 1#100 8034#1 1 24|0#0#0#120 0 1 0 0
211 传说暴击符文 4 3 100 1#100 8035#1 1 24|0#0#0#120 0 1 0 0
212 传说暴伤符文 4 3 100 1#100 8036#1 1 24|0#0#0#120 0 1 0 0
213 传说火焰符文 4 4 100 1#100 8037#1 1 24|0#0#0#120 0 1 0 0
214 传说碧水符文 4 4 100 1#100 8038#1 1 24|0#0#0#120 0 1 0 0
215 传说清风符文 4 4 100 1#100 8039#1 1 24|0#0#0#120 0 1 0 0
216 传说大地符文 4 4 100 1#100 8040#1 1 24|0#0#0#120 0 1 0 0
217 传说光明符文 4 5 100 1#100 8041#1 1 24|0#0#0#120 0 1 0 0
218 传说暗黑符文 4 5 100 1#100 8042#1 1 24|0#0#0#120 0 1 0 0
219 传说烈焰符文 4 5 100 1#100 8043#1 1 24|0#0#0#180 0 1 0 0
220 传说洛水符文 4 5 100 1#100 8044#1 1 24|0#0#0#180 0 1 0 0
221 传说狂风符文 4 6 100 1#100 8045#1 1 24|0#0#0#180 0 1 0 0
222 传说裂地符文 4 6 100 1#100 8046#1 1 24|0#0#0#180 0 1 0 0
223 传说纯白符文 4 6 100 1#100 8047#1 1 24|0#0#0#180 0 1 0 0
224 传说黑曜符文 4 6 100 1#100 8048#1 1 24|0#0#0#180 0 1 0 0
201 减伤符文 4 1 100 1#100 8025#1 1 24|0#0#0#120 0 1 0 0
202 增伤符文 4 1 100 1#100 8026#1 1 24|0#0#0#120 0 1 0 0
203 命中符文 4 1 100 1#100 8027#1 1 24|0#0#0#120 0 1 0 0
204 抵抗符文 4 2 100 1#100 8028#1 1 24|0#0#0#120 0 1 0 0
205 暴击符文 4 2 100 1#100 8029#1 1 24|0#0#0#120 0 1 0 0
206 暴伤符文 4 2 100 1#100 8030#1 1 24|0#0#0#120 0 1 0 0
207 减伤符文 4 3 100 1#100 8031#1 1 24|0#0#0#120 0 1 0 0
208 增伤符文 4 3 100 1#100 8032#1 1 24|0#0#0#120 0 1 0 0
209 命中符文 4 3 100 1#100 8033#1 1 24|0#0#0#120 0 1 0 0
210 抵抗符文 4 3 100 1#100 8034#1 1 24|0#0#0#120 0 1 0 0
211 暴击符文 4 3 100 1#100 8035#1 1 24|0#0#0#120 0 1 0 0
212 暴伤符文 4 3 100 1#100 8036#1 1 24|0#0#0#120 0 1 0 0
213 火焰符文 4 4 100 1#100 8037#1 1 24|0#0#0#120 0 1 0 0
214 碧水符文 4 4 100 1#100 8038#1 1 24|0#0#0#120 0 1 0 0
215 清风符文 4 4 100 1#100 8039#1 1 24|0#0#0#120 0 1 0 0
216 大地符文 4 4 100 1#100 8040#1 1 24|0#0#0#120 0 1 0 0
217 光明符文 4 4 100 1#100 8041#1 1 24|0#0#0#120 0 1 0 0
218 暗黑符文 4 4 100 1#100 8042#1 1 24|0#0#0#120 0 1 0 0
219 烈焰符文 4 5 100 1#100 8043#1 1 24|0#0#0#180 0 1 0 0
220 洛水符文 4 5 100 1#100 8044#1 1 24|0#0#0#180 0 1 0 0
221 狂风符文 4 5 100 1#100 8045#1 1 24|0#0#0#180 0 1 0 0
222 裂地符文 4 5 100 1#100 8046#1 1 24|0#0#0#180 0 1 0 0
223 纯白符文 4 5 100 1#100 8047#1 1 24|0#0#0#180 0 1 0 0
224 黑曜符文 4 5 100 1#100 8048#1 1 24|0#0#0#180 0 1 0 0
225 叶青 4 6 100 1#100 6004#1 1 24|0#0#0#240 0 1 0 0
226 饕餮 4 6 100 1#100 6005#1 1 24|0#0#0#240 0 1 0 0
227 嗜魂虎 4 6 100 1#100 6006#1 1 24|0#0#0#240 0 1 0 0
1001 100金币 5 1 100 1#100 14#100 1 14|0#0#0#100 0 1 0 0
1002 1000金币 5 2 100 1#100 14#1000 1 14|0#0#0#100 0 2 0 0
1003 10000金币 5 3 100 1#100 14#10000 1 14|0#0#0#100 0 3 0 0

View File

@ -39,6 +39,8 @@ public class SActivityRewardConfig implements BaseConfig {
sActivityRewardConfigListMap = sActivityRewardConfigListMapTmp;
}
public static SActivityRewardConfig getsActivityRewardConfigByMissionId(int missionId) {
return sActivityRewardConfigMap.get(missionId);
}

View File

@ -44,5 +44,7 @@ public interface BIReason {
int VIP_DAY_REWARD = 29; //VIP 每日赠送
int FIRST_RECHARGE_REWARD = 30; //首冲奖励
}

View File

@ -0,0 +1,23 @@
package com.ljsd.jieling.handler;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import org.springframework.stereotype.Component;
@Component
public class UpdateRechargeHandler extends BaseHandler{
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.RECHARGE_INFO_REQUEST;
}
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
int money = PlayerInfoProto.RechargeInfoRequest.parseFrom(netData.parseClientProtoNetData()).getMoney();
PlayerLogic.getInstance().updateRechargeInfo(iSession,money);
}
}

View File

@ -158,6 +158,17 @@ public class ActivityLogic {
}
}
break;
case ActivityType.RechargeTotal:{
long now = TimeUtils.now();
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
int days = TimeUtils.differentDays(rechargeInfo.getCreateTime(), now);
if(missionProgress<values[0][0] || days<values[0][1]){
LOGGER.error("the uid={} the misionId={},the missionProgress={},the require is={} ",uid,missionId,missionProgress,values[0][0]);
MessageUtil.sendErrorResponse(session,0,rewardResponseValue,"not finish");
return;
}
}
break;
default:
if(missionProgress<values[0][0]){
LOGGER.error("the uid={} the misionId={},the missionProgress={},the require is={} ",uid,missionId,missionProgress,values[0][0]);

View File

@ -17,5 +17,7 @@ public interface ActivityType {
int OnlineReward =1; //在线奖励
int SevenLogin = 2; //七日登陆
int ChapterReward = 3; //七日登陆
int ChapterReward = 3; //章节奖励
int FirstRecharge =4;
int RechargeTotal =5;
}

View File

@ -58,6 +58,8 @@ public class PlayerManager extends MongoBase {
private Map<Integer,Integer> vipInfo = new HashMap<>();
private RechargeInfo rechargeInfo;
public PlayerManager(){
this.setRootCollection(User._COLLECTION_NAME);
}
@ -304,4 +306,14 @@ public class PlayerManager extends MongoBase {
updateString("vipInfo", vipInfo);
setHadTakeDailyBoxVip(-1);
}
public RechargeInfo getRechargeInfo() {
return rechargeInfo;
}
public void setRechargeInfo(RechargeInfo rechargeInfo) {
rechargeInfo.init(this.getRootId(), getMongoKey()+".rechargeInfo");
this.rechargeInfo = rechargeInfo;
updateString("rechargeInfo", rechargeInfo);
}
}

View File

@ -0,0 +1,30 @@
package com.ljsd.jieling.logic.dao;
import com.ljsd.common.mogodb.MongoBase;
public class RechargeInfo extends MongoBase{
private int saveAmt;//累计充值
private long createTime;
public RechargeInfo(){
}
public void setSaveAmt(int saveAmt){
if(this.saveAmt == 0){
createTime = System.currentTimeMillis();
updateString("createTime",createTime);
}
updateString("saveAmt",saveAmt);
this.saveAmt = saveAmt;
}
public int getSaveAmt() {
return saveAmt;
}
public long getCreateTime() {
return createTime;
}
}

View File

@ -81,6 +81,7 @@ public class UserManager {
playerManager.setCreateTime(now);
playerManager.setLoginTime(now);
playerManager.updateVipInfo(user,0);
playerManager.setRechargeInfo(new RechargeInfo());
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy());
ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD);

View File

@ -1,16 +1,13 @@
package com.ljsd.jieling.logic.player;
import com.ljsd.jieling.config.SGameSetting;
import com.ljsd.jieling.config.SRandomName;
import com.ljsd.jieling.config.SVipLevelConfig;
import com.ljsd.jieling.config.*;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.logic.dao.Item;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.TeamPosManager;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mail.MailLogic;
@ -233,4 +230,24 @@ public class PlayerLogic {
}
}
public void updateRechargeInfo(ISession session,int money) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
PlayerManager playerInfoManager = user.getPlayerInfoManager();
RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo();
int saveAmt = rechargeInfo.getSaveAmt();
PlayerInfoProto.RechargeInfoResponse.Builder builder = PlayerInfoProto.RechargeInfoResponse.newBuilder();
if(saveAmt == 0){
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.FirstRecharge,1);
SActivityRewardConfig sActivityRewardConfig = SActivityRewardConfig.getsActivityRewardConfigByActivityId(4).get(0);
int[][] reward = sActivityRewardConfig.getReward();
builder.setDrop(ItemUtil.drop(user,reward,BIReason.FIRST_RECHARGE_REWARD));
}
int totalMoney = saveAmt + money;
rechargeInfo.setSaveAmt(totalMoney);
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,totalMoney);
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.RECHARGE_INFO_RESPONSE_VALUE,builder.build(),true);
}
}

View File

@ -15,6 +15,7 @@ public class CBean2Proto {
public static CommonProto.Player getPlayer(int uid, PlayerManager playerManager, int maxMapId, int mapId, MapManager mapManager) {
RechargeInfo rechargeInfo = playerManager.getRechargeInfo();
CommonProto.Player player = CommonProto.Player
.newBuilder()
.setUid(uid)
@ -30,6 +31,8 @@ public class CBean2Proto {
.setServerTime((int)(System.currentTimeMillis()/1000))
.setBuyFightCount(mapManager.getBuyFightCount())
.setDayFightCount(mapManager.getDayFightCount())
.setRechargeTime((int)(rechargeInfo.getCreateTime()/1000))
.setSaveAmt(rechargeInfo.getSaveAmt())
.build();
return player;
}