Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
4ef73f2406
|
@ -41,6 +41,9 @@ local function casterBulletEffect(caster, target, interval)
|
|||
end
|
||||
|
||||
local function calBuffHit(caster, target, baseRandom)
|
||||
if caster.isTeam then --异妖不走效果命中公式
|
||||
return baseRandom
|
||||
end
|
||||
local hit = (1 + caster:GetRoleData(RoleDataName.Hit) / (1 + target:GetRoleData(RoleDataName.Dodge)))
|
||||
return BattleUtil.ErrorCorrection(hit * baseRandom)
|
||||
end
|
||||
|
|
|
@ -54,6 +54,7 @@ public interface Global {
|
|||
int NO_FIND_ONESELF_STATE = 10001; // 不能查找自己
|
||||
int RENAME_DIRTY = 10002;
|
||||
int RENAME_SIZE_ERROR = 10003;
|
||||
int SHOW_TIPS_ERROR = 20000;
|
||||
|
||||
//跑马灯状态
|
||||
int LUCKY_LUCK = 1; //吉运
|
||||
|
|
|
@ -82,6 +82,8 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
pid = Integer.valueOf(loginRequest.getChannelS());
|
||||
}
|
||||
|
||||
LOGGER.info("the uid={},the channel={}",userId,pid);
|
||||
|
||||
|
||||
//登陆注册入内存
|
||||
String openIdFront = loginRequest.getOpenId();
|
||||
|
|
|
@ -9,16 +9,14 @@ import com.ljsd.jieling.protocols.PlayerInfoProto;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GetPlayerOneTeamInfo extends BaseHandler {
|
||||
public class GetPlayerOneTeamInfo extends BaseHandler<PlayerInfoProto.GetPlayerOneTeamInfoRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GET_PLAYER_ONE_TEAM_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
PlayerInfoProto.GetPlayerOneTeamInfoRequest info = PlayerInfoProto.GetPlayerOneTeamInfoRequest.parseFrom(bytes);
|
||||
PlayerLogic.getInstance().getOneTeamInfo(iSession, info.getPlayerId(), MessageTypeProto.MessageType.GET_PLAYER_ONE_TEAM_INFO_RESPONSE);
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.GetPlayerOneTeamInfoRequest proto) throws Exception {
|
||||
PlayerLogic.getInstance().getOneTeamInfo(iSession, proto.getPlayerId(),proto.getTeamId(), MessageTypeProto.MessageType.GET_PLAYER_ONE_TEAM_INFO_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,16 @@ package com.ljsd.jieling.hotfix;
|
|||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.sun.tools.attach.AgentInitializationException;
|
||||
import com.sun.tools.attach.AgentLoadException;
|
||||
import com.sun.tools.attach.AttachNotSupportedException;
|
||||
import com.sun.tools.attach.VirtualMachine;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.List;
|
||||
|
@ -60,7 +64,7 @@ public class HotfixUtil{
|
|||
for (ClassBean cl : list) {
|
||||
String path = "../conf/hotswap/"+cl.getName();
|
||||
LOGGER.info("HotfixUtil->i={},path={}", i, path);
|
||||
vm.loadAgent("../lib/hotfix.jar",path);//path参数即agentmain()方法的第一个参数
|
||||
vm.loadAgent("../lib/serverlogiclib/hotfix.jar",path);//path参数即agentmain()方法的第一个参数
|
||||
i++;
|
||||
}
|
||||
currVerion = version;
|
||||
|
|
|
@ -162,7 +162,7 @@ public class FriendLogic {
|
|||
return false;
|
||||
}
|
||||
// todo 走配置
|
||||
int maxSize = 200;
|
||||
int maxSize = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAMOUNT_LIMIT);
|
||||
if (friends.size() >= maxSize) { //用户已达上限不推荐好友信息
|
||||
return false;
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ public class FriendLogic {
|
|||
int maxFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAMOUNT_LIMIT);
|
||||
int maxApplyFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAPPLYAMOUNT_LIMIT);
|
||||
if (friends.size() >= maxFriends){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"好友已达上限");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR,msgId,"好友已达上限");
|
||||
return;
|
||||
}
|
||||
for (Integer inviteUid : inviteUidsList){
|
||||
|
@ -285,18 +285,18 @@ public class FriendLogic {
|
|||
switch (type){
|
||||
case 1://同意
|
||||
if (friends.contains(friendId)){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"对方已是你的好友");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR,msgId,"对方已是你的好友");
|
||||
return;
|
||||
}
|
||||
if (friends.size() >= maxFriends){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"好友已达上限");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR,msgId,"好友已达上限");
|
||||
return;
|
||||
}
|
||||
friendUser = UserManager.getUser(friendId);
|
||||
FriendManager friendfriendManager = friendUser.getFriendManager();
|
||||
friendFriendList = friendUser.getFriendManager().getFriends();
|
||||
if (friendFriendList.size() >=maxFriends){
|
||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"对方好友已达上限");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR,msgId,"对方好友已达上限");
|
||||
return;
|
||||
}
|
||||
if (applyFriends.contains(friendId)){
|
||||
|
@ -410,7 +410,7 @@ public class FriendLogic {
|
|||
FriendManager friendManager = user.getFriendManager();
|
||||
List<Integer> friends = friendManager.getFriends();
|
||||
if (!friends.contains(friendId)){
|
||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "你没有该好友");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR, msgId, "你没有该好友");
|
||||
return;
|
||||
}
|
||||
User friendUser = UserManager.getUser(friendId);
|
||||
|
@ -445,18 +445,18 @@ public class FriendLogic {
|
|||
int times = 0;
|
||||
if (type == 1) {//赠送一个人
|
||||
if (!friends.contains(friendId)) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "没有该好友");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR, msgId, "没有该好友");
|
||||
return;
|
||||
}
|
||||
if (giveMap.get(friendId) == 1) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "已经赠送过");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR ,msgId, "已经赠送过");
|
||||
return;
|
||||
}
|
||||
User friendUser = UserManager.getUser(friendId);
|
||||
FriendManager friendManager1 = friendUser.getFriendManager();
|
||||
Map<Integer, Integer> haveRewardMap = friendUser.getFriendManager().getHaveRewardMap();
|
||||
if (haveRewardMap.containsKey(uid) && haveRewardMap.get(uid) != 0) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "已经赠送过");
|
||||
MessageUtil.sendErrorResponse(iSession,Global.SHOW_TIPS_ERROR, msgId, "已经赠送过");
|
||||
return;
|
||||
}
|
||||
friendManager.updateGiveMap(friendId,1);
|
||||
|
@ -570,13 +570,13 @@ public class FriendLogic {
|
|||
// return;
|
||||
// }
|
||||
if (playerInfoManager.getNickName().equals(name)){
|
||||
MessageUtil.sendErrorResponse(iSession, Global.NO_FIND_ONESELF_STATE, msgId, "不能查找自己");
|
||||
MessageUtil.sendErrorResponse(iSession, Global.SHOW_TIPS_ERROR, msgId, "不能查找自己");
|
||||
return;
|
||||
}
|
||||
String key = RedisKey.getKey(RedisKey.C_User_Name_Key, name, false);
|
||||
Object friend = RedisUtil.getInstence().get(key);
|
||||
if (friend == null){
|
||||
MessageUtil.sendErrorResponse(iSession, Global.USER_NO_EXIT_STATE, msgId, "玩家不存在");
|
||||
MessageUtil.sendErrorResponse(iSession, Global.SHOW_TIPS_ERROR, msgId, "玩家不存在");
|
||||
return;
|
||||
}
|
||||
int type = 1;
|
||||
|
|
|
@ -162,7 +162,6 @@ public class HeroLogic {
|
|||
|
||||
|
||||
public void random(ISession session,int type) throws Exception {
|
||||
LOGGER.info("test randomxxxxx... the type={} ",type);
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
SLotterySetting sLotterySetting = SLotterySetting.getsLotterySettingMap().get(type);
|
||||
|
@ -434,12 +433,12 @@ public class HeroLogic {
|
|||
if (hero == null) {
|
||||
break;
|
||||
}
|
||||
if(heroAllAttributeMap.get(heroInfo)!=null){
|
||||
if(heroAllAttributeMap.get(heroInfo.getHeroId())!=null){
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
|
||||
Map<String, Integer> endlessHeroInfo = user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo();
|
||||
if(endlessHeroInfo!=null&& endlessHeroInfo.size()>0){
|
||||
if(endlessHeroInfo!=null&& endlessHeroInfo.containsKey(heroInfo.getHeroId())){
|
||||
int curHp = (int)(endlessHeroInfo.get(heroInfo.getHeroId()) /10000.00 * heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()));
|
||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), curHp);
|
||||
}
|
||||
|
|
|
@ -430,24 +430,27 @@ public class PlayerLogic {
|
|||
}
|
||||
|
||||
}
|
||||
public void getOneTeamInfo(ISession session, int id,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
public void getOneTeamInfo(ISession session, int id,int teamId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(id);
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
CommonProto.Team.Builder team = CommonProto.Team.newBuilder();
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
for (TeamPosHeroInfo heroInfo:teamPosManager.getTeamPosForHero().get(1)) {
|
||||
int templateId = user.getHeroManager().getHero(heroInfo.getHeroId()).getTemplateId();
|
||||
team.addHeroTid(templateId);
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
for (TeamPosHeroInfo heroInfo:teamPosManager.getTeamPosForHero().get(teamId)) {
|
||||
int templateId = user.getHeroManager().getHero(heroInfo.getHeroId()).getTemplateId();
|
||||
team.addHeroTid(templateId);
|
||||
}
|
||||
}
|
||||
|
||||
CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setHead(1)
|
||||
.setHeadFrame(playerManager.getHeadFrame())
|
||||
.setName(playerManager.getNickName()).setUid(session.getUid());
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
teamInfo.setTeam(team);
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,1,false));
|
||||
if(teamPosManager.getTeamPosForPoken().get(1)!=null&&teamPosManager.getTeamPosForPoken().get(1).size()>0){
|
||||
for(TeamPosForPokenInfo posForPokenInfo:teamPosManager.getTeamPosForPoken().get(1)){
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
if(teamPosManager.getTeamPosForPoken().get(teamId)!=null&&teamPosManager.getTeamPosForPoken().get(teamId).size()>0){
|
||||
for(TeamPosForPokenInfo posForPokenInfo:teamPosManager.getTeamPosForPoken().get(teamId)){
|
||||
teamInfo.addPokemonInfos(posForPokenInfo.getPokenId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,10 +199,20 @@ public class BuyGoodsLogic {
|
|||
MailLogic.getInstance().sendMail(user.getId(),title,content,rewardStr,nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
resultRes.setResultCode(1);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,orderId,resultRes.getResultCode(),price);
|
||||
notifyPaySuccessFul(uid,goodsId);
|
||||
return resultRes;
|
||||
|
||||
}
|
||||
|
||||
//通知前端充值成功
|
||||
public static void notifyPaySuccessFul(int uid,int goodsId){
|
||||
ISession session = OnlineUserManager.getSessionByUid(uid);
|
||||
if(session!=null){
|
||||
PlayerInfoProto.NotifyPaySuccessfulIndicaiton build = PlayerInfoProto.NotifyPaySuccessfulIndicaiton.newBuilder().setGoodsId(goodsId).build();
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.NOTIFY_PAY_SUCCESS_INDICATION_VALUE,build,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 购买物品后钩子函数
|
||||
|
|
|
@ -545,10 +545,13 @@ public class ItemUtil {
|
|||
|
||||
continue;
|
||||
}
|
||||
Equip equip = new Equip(user.getId(), entry.getKey());
|
||||
equips.add(equip);
|
||||
equipProtoList.add(CBean2Proto.getEquipProto(equip));
|
||||
LOGGER.info("the uid={},the curMapId={},add equip={},equipNum={},totalEquipNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),1,equips.size());
|
||||
Integer nums = entry.getValue();
|
||||
for(int i=0;i<nums;i++){
|
||||
Equip equip = new Equip(user.getId(), entry.getKey());
|
||||
equips.add(equip);
|
||||
equipProtoList.add(CBean2Proto.getEquipProto(equip));
|
||||
}
|
||||
LOGGER.info("the uid={},the curMapId={},add equip={},equipNum={},totalEquipNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),nums,equips.size());
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
|
||||
|
@ -556,10 +559,13 @@ public class ItemUtil {
|
|||
if (sEquipSign == null) {
|
||||
continue;
|
||||
}
|
||||
SoulEquip soulEquip1 = new SoulEquip(user.getId(), entry.getKey());
|
||||
soulEquips.add(soulEquip1);
|
||||
soulEquiplist.add(CBean2Proto.getEquipProto(soulEquip1));
|
||||
LOGGER.info("the uid={},the curMapId={},add equip={},equipNum={},totalEquipNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),1,equips.size());
|
||||
Integer nums = entry.getValue();
|
||||
for(int i=0;i<nums;i++){
|
||||
SoulEquip soulEquip1 = new SoulEquip(user.getId(), entry.getKey());
|
||||
soulEquips.add(soulEquip1);
|
||||
soulEquiplist.add(CBean2Proto.getEquipProto(soulEquip1));
|
||||
}
|
||||
LOGGER.info("the uid={},the curMapId={},add equip={},equipNum={},totalEquipNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),nums,equips.size());
|
||||
}
|
||||
|
||||
mapManager.setTemporaryItems(temporaryItems);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class MonsterUtil {
|
|||
for(int j = 0; j<contents.length;j++){
|
||||
for(int k = 0;k<contents[j].length;k++){
|
||||
SMonsterConfig monster = integerSMonsterConfigMap.get(contents[j][k]);
|
||||
int monsterForce = (int)(monster.getAttack()*3+monster.getHp()*0.21+monster.getPhysicalDefence()*0.5+monster.getMagicDefence()*0.5);
|
||||
int monsterForce = (int)(monster.getAttack()*3+monster.getHp()*0.32+monster.getPhysicalDefence()*0.8+monster.getMagicDefence()*0.8);
|
||||
totalMonsterForce+=monsterForce;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue