发送抢到红包消息

back_recharge
lvxinran 2020-01-15 14:25:29 +08:00
parent 58f1606268
commit 5f181a4df7
1 changed files with 8 additions and 2 deletions

View File

@ -1064,10 +1064,16 @@ public class GuildLogic {
if(redPackage!=null){
builder.setIsSuccess(1);
RedPackage packInfo = RedisUtil.getInstence().getMapValue(RedisKey.FAMILY_RED_PACKAGE, String.valueOf(UserManager.getUser(uid).getPlayerInfoManager().getGuildId()), String.valueOf(redId), RedPackage.class);
if(packInfo==null){
throw new ErrorCodeException(ErrorCode.FAMILY_NULL);
}
SGuildRedPackConfig config = SGuildRedPackConfig.sGuildRedPackConfigMap.get(packInfo.getTypeId());
ItemUtil.drop(UserManager.getUser(uid),new int[][]{new int[]{config.getTotalMoney()[0],Integer.parseInt(String.valueOf(redPackage))}},BIReason.RED_PACKAGE_REWARD);
int count = Integer.parseInt(String.valueOf(redPackage));
ItemUtil.drop(UserManager.getUser(uid),new int[][]{new int[]{config.getTotalMoney()[0],count}},BIReason.RED_PACKAGE_REWARD);
builder.setCount(count);
builder.setItemId(config.getTotalMoney()[0]);
int position = getMemberType(uid, GuilidManager.guildInfoMap.get(UserManager.getUser(uid).getPlayerInfoManager().getGuildId()).getMembers());
RedisUtil.getInstence().putMapEntry("red_already_list", String.valueOf(redId),String.valueOf(uid),new AcceptRedInfo(uid,config.getTotalMoney()[0],Integer.parseInt(String.valueOf(redPackage)),(int)(TimeUtils.now()/1000),position));
RedisUtil.getInstence().putMapEntry("red_already_list", String.valueOf(redId),String.valueOf(uid),new AcceptRedInfo(uid,config.getTotalMoney()[0], count,(int)(TimeUtils.now()/1000),position));
}
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build(),true);
}