guild & fix map
parent
fdc0501110
commit
acffeefb07
|
@ -4,6 +4,12 @@ public interface GlobalsDef {
|
|||
String DEFAULT_NAME = "无名妖灵师";
|
||||
int MAP_MISSION_RETURN = -9999;
|
||||
|
||||
int CHAIRMAN = 1;
|
||||
int VICE_CHAIRMAN = 2;
|
||||
int HIGHER = 3;
|
||||
int ELITES = 4;
|
||||
int MEMBER = 5; // 门主, 副门主, 长老, 精英, 弟子
|
||||
|
||||
int RANDOM_LOTTERY_TYPE = 1;
|
||||
|
||||
int MAIL_RED_TYPE = 1; // 邮件红点红点
|
||||
|
|
|
@ -108,6 +108,9 @@ public class RedisKey {
|
|||
|
||||
public static final String TOWER_RANK = "TOWER_RANK";
|
||||
|
||||
|
||||
public static final String FAMILY_ID = "FAMILY_ID";
|
||||
|
||||
public static String getKey(String type, String key, boolean withoutServerId) {
|
||||
if (withoutServerId) {
|
||||
return GameApplication.areaId + Delimiter_colon + type + Delimiter_colon + String.valueOf(key);
|
||||
|
|
|
@ -112,4 +112,7 @@ public interface BIReason {
|
|||
|
||||
int BUY_TREASURE_CONSUME = 1029;
|
||||
|
||||
|
||||
int CREATE_GUILD_CONSUME = 1030; // 创建宗门消耗
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class FamilyCreateHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.FAMILY_CREATE_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
Family.FamilyCreateReqeust familyCreateReqeust = Family.FamilyCreateReqeust.parseFrom(bytes);
|
||||
GuildLogic.createFamily(iSession,familyCreateReqeust.getName(),familyCreateReqeust.getAnnounce());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class FamilyRecommandHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.FAMILY_RECOMEND_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
GuildLogic.recommendFamily(iSession);
|
||||
}
|
||||
}
|
|
@ -1276,17 +1276,18 @@ public class MapLogic {
|
|||
}
|
||||
if(sOptionConfig!=null){
|
||||
int[][] jumpTypeValues = sOptionConfig.getJumpTypeValues();
|
||||
SOptionAddCondition sOptionAddConditions = SOptionAddCondition.sOptionAddConditionMap.get(jumpTypeValues[1][1]);
|
||||
if(sOptionAddConditions!=null && sOptionAddConditions.getType() == 7){
|
||||
Cell cell = mapManager.getMapInfo().get(triggerXY);
|
||||
if (cell != null ) {
|
||||
nextEventId = getNextEventId(user, cell, sOptionConfig);
|
||||
cell.setEventId(nextEventId);
|
||||
mapManager.addOrUpdateCell(triggerXY, cell);
|
||||
fightEndResponse.setEventId(nextEventId);
|
||||
if(jumpTypeValues[0][0] == 3){
|
||||
SOptionAddCondition sOptionAddConditions = SOptionAddCondition.sOptionAddConditionMap.get(jumpTypeValues[1][1]);
|
||||
if(sOptionAddConditions!=null && sOptionAddConditions.getType() == 7){
|
||||
Cell cell = mapManager.getMapInfo().get(triggerXY);
|
||||
if (cell != null ) {
|
||||
nextEventId = getNextEventId(user, cell, sOptionConfig);
|
||||
cell.setEventId(nextEventId);
|
||||
mapManager.addOrUpdateCell(triggerXY, cell);
|
||||
fightEndResponse.setEventId(nextEventId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
||||
return;
|
||||
|
|
|
@ -171,7 +171,9 @@ public class ActivityLogic {
|
|||
|
||||
public void initServenHappy(User user, SGlobalActivity sGlobalActivity) throws Exception {
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.SERVENHAPPY_REFRESH,sGlobalActivity.getId());
|
||||
user.getActivityManager().addActivity(sGlobalActivity.getId(),new ActivityMission());
|
||||
ActivityMission activityMission = new ActivityMission();
|
||||
activityMission.initOtherMission(new ArrayList<>());
|
||||
user.getActivityManager().addActivity(sGlobalActivity.getId(),activityMission);
|
||||
}
|
||||
|
||||
|
||||
|
@ -395,7 +397,7 @@ public class ActivityLogic {
|
|||
Integer activityId = activityState.getKey();
|
||||
ActivityMission activityMission = activityState.getValue();
|
||||
//todo 活动未初始化成功
|
||||
if(activityMission == null || activityMission.getActivityProgressInfoMap().isEmpty()){
|
||||
if(activityMission == null){
|
||||
continue;
|
||||
}
|
||||
int activityStatus = activityMission.getActivityState();
|
||||
|
@ -505,6 +507,9 @@ public class ActivityLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(activityProgressInfoMap.isEmpty()){
|
||||
isAllTaked =false;
|
||||
}
|
||||
if(isAllTaked){
|
||||
activityMission.updateActivityState(ActivityType.FINISH_STATE);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class GuilidManager {
|
||||
|
||||
private static Map<Integer,GuildInfo> guildInfoMap = new HashMap<>();
|
||||
|
||||
public static void addGuildInfo(GuildInfo guildInfo) throws Exception {
|
||||
MongoUtil.getInstence().getMyMongoTemplate().save(guildInfo);
|
||||
guildInfoMap.put(guildInfo.getId(),guildInfo);
|
||||
}
|
||||
|
||||
public static Collection<GuildInfo> recommandGuild(User user) {
|
||||
return guildInfoMap.values();
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.ljsd.jieling.logic.dao.root;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class FamilyInfo {
|
||||
|
||||
private int id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String announce;
|
||||
|
||||
private int joinType ; //加入类型 1:直接加入 2:申请加入 3:禁止加入
|
||||
|
||||
private Map<Integer, Set<Integer>> members = new ConcurrentHashMap();
|
||||
|
||||
private long createTime;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.ljsd.jieling.logic.dao.root;
|
||||
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class GuildInfo {
|
||||
|
||||
public static final String _COLLECTION_NAME = "familyInfo";
|
||||
|
||||
private int id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String announce;
|
||||
|
||||
private int joinType ; //加入类型 0:直接加入 1:申请加入 2:禁止加入
|
||||
|
||||
private Map<Integer, Set<Integer>> members = new ConcurrentHashMap();
|
||||
|
||||
private long createTime;
|
||||
|
||||
public GuildInfo(int creator, String name, String announce){
|
||||
this.id = ((Long)RedisUtil.getInstence().increment(RedisKey.FAMILY_ID)).intValue();
|
||||
this.name = name;
|
||||
this.announce = announce;
|
||||
members.get(GlobalsDef.CHAIRMAN).add(creator);
|
||||
this.createTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getAnnounce() {
|
||||
return announce;
|
||||
}
|
||||
|
||||
public int getJoinType() {
|
||||
return joinType;
|
||||
}
|
||||
|
||||
public Map<Integer, Set<Integer>> getMembers() {
|
||||
return members;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.ljsd.jieling.logic.family;
|
||||
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
public class FamilyLogic {
|
||||
|
||||
public static void createFamily(ISession session,String familyName,String announce){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void recommendFamily(ISession session){
|
||||
|
||||
}
|
||||
|
||||
public static void applyFamily(ISession session){
|
||||
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@ public class MissionLoigc {
|
|||
getVipMission(user,missionList);
|
||||
getCopyMission(user,missionList);
|
||||
getTreasureMission(user,missionList,ActivityType.TREASURE);
|
||||
// getTreasureMission(user,missionList,ActivityType.SERVERHAPPY);
|
||||
getTreasureMission(user,missionList,ActivityType.SERVERHAPPY);
|
||||
PlayerInfoProto.GetMissionResponse build = PlayerInfoProto.GetMissionResponse.newBuilder().addAllUserMissionInfo(missionList).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_MISSION_RESPONSE_VALUE,build,true);
|
||||
}
|
||||
|
@ -433,6 +433,9 @@ public class MissionLoigc {
|
|||
case ARENA_RANK:
|
||||
count=-1*cumulationData.arenaRank;
|
||||
break;
|
||||
case SENVER_HAPPY:
|
||||
count=cumulationData.senvenScores;
|
||||
break;
|
||||
default:
|
||||
count = 0;
|
||||
break;
|
||||
|
|
|
@ -140,6 +140,8 @@ public enum MissionType {
|
|||
return FAST_ADVENTUREREWARD_TIMES;
|
||||
case 37:
|
||||
return ARENA_RANK;
|
||||
case 38:
|
||||
return SENVER_HAPPY;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue