Merge branch 'online_1121'
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserManager.javaback_recharge
commit
bacf2fc3b3
|
|
@ -101,10 +101,25 @@ public class ChatLogic {
|
|||
FriendManager friendManager = user.getFriendManager();
|
||||
|
||||
long nowTime = System.currentTimeMillis();
|
||||
String tmp = SensitivewordFilter.replaceSensitiveWord(message, 1, "*");
|
||||
String unSymbolWord = ShieldedWordUtils.replaceUnword(message);
|
||||
String tmp = SensitivewordFilter.replaceSensitiveWord(unSymbolWord, 1, "*");
|
||||
|
||||
|
||||
if(!tmp.equals(message)||playerInfoManager.getSilence()==1){
|
||||
if(tmp.contains("*") && !tmp.equals(message)||playerInfoManager.getSilence()==1){
|
||||
char[] chars = message.toCharArray();
|
||||
char[] original = unSymbolWord.toCharArray();
|
||||
char[] tmpChar = tmp.toCharArray();
|
||||
int j=0;
|
||||
char[] result = new char[chars.length];
|
||||
for(int i=0;i<chars.length;i++){
|
||||
char c= chars[i];
|
||||
if(original[j] == chars[i]){
|
||||
c = tmpChar[j];
|
||||
j++;
|
||||
}
|
||||
result[i]=c;
|
||||
}
|
||||
tmp = new String(result);
|
||||
ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,tmp,nowTime,-1);
|
||||
ChatProto.SendChatInfoResponse response = ChatProto.SendChatInfoResponse.newBuilder().setChatInfo(chatInfo).build();
|
||||
MessageUtil.sendMessage(iSession,1,msgId,response,true);
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ import com.ljsd.jieling.util.http.HttpPool;
|
|||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
public class DataMessageUtils {
|
||||
|
|
@ -29,8 +29,11 @@ public class DataMessageUtils {
|
|||
|
||||
private static Gson gson = new Gson();
|
||||
private static final String sendUrl = "https://gskuld.receiver.extranet.kt007.com:8081/skuld/game/common/";
|
||||
private static final String sendTaskUrl37 = "http://pvt.api.m.37.com/hd/postTaskInfo/" + SDK37Constans.pid + "/" + SDK37Constans.gid;
|
||||
private static final String sendRoleUrl37 = "http://pvt.api.m.37.com/report/roleChangeReport/" + SDK37Constans.pid + "/" + SDK37Constans.gid;
|
||||
private static final Map<Long,String> sendTaskUrl37Map = new HashMap<>();
|
||||
private static final String sendTaskUrl37 = "http://pvt.api.m.37.com/hd/postTaskInfo/" ;
|
||||
private static final Map<Long,String> sendRoleUrl37Map = new HashMap<>();
|
||||
private static final String sendRoleUrl37 = "http://pvt.api.m.37.com/report/roleChangeReport/";
|
||||
|
||||
private static final String sendChatContent37 = "http://cm3.api.37.com.cn/Content/_checkContent/";
|
||||
//入队列
|
||||
public static void addLogQueue(Object info) {
|
||||
|
|
@ -59,16 +62,29 @@ public class DataMessageUtils {
|
|||
String sendToUrl;
|
||||
List<BasicNameValuePair> sendForm = new ArrayList<>();
|
||||
if (object instanceof Report37TaskBean) {
|
||||
sendToUrl = sendTaskUrl37;
|
||||
long key =(long)((Report37TaskBean) object).getGid()*10000+((Report37TaskBean) object).getPid();
|
||||
sendToUrl = sendTaskUrl37Map.get((long)((Report37TaskBean) object).getGid()*10000+((Report37TaskBean) object).getPid());
|
||||
if(sendToUrl==null){
|
||||
sendToUrl = sendTaskUrl37 + ((Report37TaskBean) object).getPid() + "/" + ((Report37TaskBean) object).getGid();
|
||||
sendTaskUrl37Map.put(key,sendToUrl);
|
||||
}
|
||||
sendForm = ((Report37TaskBean) object).getPairList();
|
||||
} else if (object instanceof Report37RoleLeveBean) {
|
||||
long key =(long)((Report37RoleLeveBean) object).getGid()*10000+((Report37RoleLeveBean) object).getPid();
|
||||
sendToUrl = sendRoleUrl37Map.get((long)((Report37RoleLeveBean) object).getGid()*10000+((Report37RoleLeveBean) object).getPid());
|
||||
if(sendToUrl==null){
|
||||
sendToUrl = sendRoleUrl37 + ((Report37RoleLeveBean) object).getPid() + "/" + ((Report37RoleLeveBean) object).getGid();
|
||||
sendRoleUrl37Map.put(key,sendToUrl);
|
||||
}
|
||||
sendToUrl = sendRoleUrl37;
|
||||
sendForm = ((Report37RoleLeveBean) object).getPairList();
|
||||
} else {
|
||||
sendToUrl = "";
|
||||
}
|
||||
try {
|
||||
HttpPool.sendPostForm(sendToUrl, new UrlEncodedFormEntity(sendForm, "utf-8"));
|
||||
if(!StringUtil.isEmpty(sendToUrl)){
|
||||
HttpPool.sendPostForm(sendToUrl, new UrlEncodedFormEntity(sendForm, "utf-8"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ public abstract class Report37Bean implements Report37Param{
|
|||
private String zone_name;
|
||||
|
||||
public Report37Bean() {
|
||||
this.pid = Integer.valueOf(SDK37Constans.pid);
|
||||
this.gid = Integer.valueOf(SDK37Constans.gid);
|
||||
this.pid = 0;
|
||||
this.gid = 0;
|
||||
this.event_time = (int)(System.currentTimeMillis()/1000);
|
||||
this.zone_id = String.valueOf(GameApplication.serverId);
|
||||
this.zone_name = String.valueOf(GameApplication.serverId);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class Report37RoleLeveBean extends Report37Bean{
|
|||
pairList.add(new BasicNameValuePair("zone_id", getZone_id()));
|
||||
pairList.add(new BasicNameValuePair("zone_name", getZone_id()));
|
||||
pairList.add(new BasicNameValuePair("pid", String.valueOf(getPid())));
|
||||
pairList.add(new BasicNameValuePair("gid", getZone_id()));
|
||||
pairList.add(new BasicNameValuePair("gid", String.valueOf(getGid())));
|
||||
return pairList;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class Report37TaskBean extends Report37Bean {
|
|||
pairList.add(new BasicNameValuePair("zone_id", getZone_id()));
|
||||
pairList.add(new BasicNameValuePair("zone_name", getZone_id()));
|
||||
pairList.add(new BasicNameValuePair("pid", String.valueOf(getPid())));
|
||||
pairList.add(new BasicNameValuePair("gid", getZone_id()));
|
||||
pairList.add(new BasicNameValuePair("gid", String.valueOf(getGid())));
|
||||
return pairList;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ public class Repot37EventUtil {
|
|||
String taskName = String.valueOf(parm[1]);
|
||||
report37TaskBean.setTask_id(String.valueOf(taskId));//todo
|
||||
report37TaskBean.setTask_name(taskName);
|
||||
report37TaskBean.setGid(user.getPlayerInfoManager().getGid());
|
||||
report37TaskBean.setPid(user.getPlayerInfoManager().getPid());
|
||||
String signStr = report37TaskBean.getEvent_time() + report37TaskBean.getUid() + report37TaskBean.getZone_id() + report37TaskBean.getRoleid() + report37TaskBean.getTask_id()+SDK37Constans.appkey;
|
||||
report37TaskBean.setSign(MD5Util.encrypByMd5(signStr));
|
||||
DataMessageUtils.addLogQueue(report37TaskBean);
|
||||
|
|
@ -45,14 +47,13 @@ public class Repot37EventUtil {
|
|||
report37RoleLeveBean.setTotal_online_time(user.getPlayerInfoManager().getOnlineTime());
|
||||
report37RoleLeveBean.setGuild_id("");//todo
|
||||
report37RoleLeveBean.setGuild_name("0");//todo
|
||||
report37RoleLeveBean.setGid(user.getPlayerInfoManager().getGid());
|
||||
report37RoleLeveBean.setPid(user.getPlayerInfoManager().getPid());
|
||||
String signSt = report37RoleLeveBean.getEvent_time() + report37RoleLeveBean.getUid() + report37RoleLeveBean.getZone_id() + report37RoleLeveBean.getRoleid() + SDK37Constans.appkey;
|
||||
report37RoleLeveBean.setSign(MD5Util.encrypByMd5(signSt));
|
||||
DataMessageUtils.addLogQueue(report37RoleLeveBean);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static <T> T hadResReport(Class<T> clazz,User user, Report37EventType eventType, Object... parm){
|
||||
switch (eventType) {
|
||||
|
|
@ -63,8 +64,8 @@ public class Repot37EventUtil {
|
|||
report37CheckChat.setUid(String.valueOf(user.getPlayerInfoManager().getOpenId()));//uid
|
||||
report37CheckChat.setActor_name(user.getPlayerInfoManager().getNickName());
|
||||
report37CheckChat.setActor_id(String.valueOf(user.getId()));
|
||||
report37CheckChat.setGid(SDK37Constans.gid);
|
||||
report37CheckChat.setPid(SDK37Constans.pid);
|
||||
report37CheckChat.setGid(String.valueOf(user.getPlayerInfoManager().getGid()));
|
||||
report37CheckChat.setPid(String.valueOf(user.getPlayerInfoManager().getPid()));
|
||||
report37CheckChat.setDsid(String.valueOf(GameApplication.serverId));
|
||||
report37CheckChat.setType(parm[0].toString());//类型
|
||||
report37CheckChat.setContent(parm[1].toString());//内容
|
||||
|
|
|
|||
|
|
@ -193,6 +193,8 @@ public class RedisKey {
|
|||
public final static String CDKEY = "CDKEY";
|
||||
public final static String GLOBAL_SYS_PRO = "GLOBAL_SYS_PRO";
|
||||
|
||||
public final static String PIDGIDTEMP = "PIDGIDTEMP";
|
||||
|
||||
|
||||
public static Set<String> familyKey = new HashSet<>();
|
||||
static {
|
||||
|
|
|
|||
|
|
@ -1069,7 +1069,8 @@ public class RedisUtil {
|
|||
|
||||
public String getKey(String type,String key){
|
||||
|
||||
if(RedisKey.BLOODY_RANK.equals(type) || RedisKey.BLOODY_TEAM.equals(type) || RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.BLOODY_PERSON_BATTLE_INFO.equals(type)||RedisKey.FAMILY_INFO.equals(type)) {
|
||||
if(RedisKey.BLOODY_RANK.equals(type) || RedisKey.BLOODY_TEAM.equals(type) || RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.BLOODY_PERSON_BATTLE_INFO.equals(type)
|
||||
||RedisKey.FAMILY_INFO.equals(type)||RedisKey.PIDGIDTEMP.equals(type)) {
|
||||
return type + RedisKey.Delimiter_colon + key;
|
||||
}
|
||||
if(RedisKey.familyKey.contains(type)){
|
||||
|
|
|
|||
|
|
@ -83,13 +83,38 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
KTEnvironmentUtil.addUserEnviromentInfo(userId,paramEnvironmentBean);
|
||||
|
||||
int pid = 0;
|
||||
if(!StringUtil.isEmpty(loginRequest.getChannelS())){
|
||||
pid = Integer.valueOf(loginRequest.getChannelS());
|
||||
int gid = 0;
|
||||
String channelS = loginRequest.getChannelS();
|
||||
String[] splitChannelS = channelS.split("#");
|
||||
if(splitChannelS.length==1){
|
||||
if(!StringUtil.isEmpty(splitChannelS[0])){
|
||||
pid = Integer.valueOf(splitChannelS[0]);
|
||||
}
|
||||
}else if (splitChannelS.length>=2){
|
||||
if(!StringUtil.isEmpty(splitChannelS[0])){
|
||||
pid = Integer.valueOf(splitChannelS[0]);
|
||||
}
|
||||
if(!StringUtil.isEmpty(splitChannelS[1])){
|
||||
gid = Integer.valueOf(splitChannelS[1]);
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.info("the uid={},the channel={}",userId,pid);
|
||||
|
||||
//临时代码 等前端出新包后删除2019 11 29
|
||||
if(gid==0){
|
||||
try {
|
||||
String value =( (String) RedisUtil.getInstence().get(RedisUtil.getInstence().getKey(RedisKey.PIDGIDTEMP, Integer.toString(userId)))).replace("\"", "");
|
||||
LOGGER.info("the value={}",value);
|
||||
String[] splitvalue = value.split("#");
|
||||
if (splitvalue.length==2){
|
||||
pid = Integer.valueOf(splitvalue[0]);
|
||||
gid = Integer.valueOf(splitvalue[1]);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.info("the uid={},the pid={},the gid={},",userId,pid,gid);
|
||||
//登陆注册入内存
|
||||
String openIdFront = loginRequest.getOpenId();
|
||||
String[] split = openIdFront.split("\\.");
|
||||
|
|
@ -97,9 +122,9 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
if(split.length>=2){
|
||||
String openId = split[0];
|
||||
String chanel = split[1];
|
||||
user = UserManager.userLogin(userId,openId,chanel,pid);
|
||||
user = UserManager.userLogin(userId,openId,chanel,pid,gid);
|
||||
}else{
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid);
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid,gid);
|
||||
}
|
||||
|
||||
// String newToken = UserManager.getNewToken(userId);
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ public class ActivityLogic {
|
|||
sendLuckWheelPool(user, session);
|
||||
}
|
||||
|
||||
private void checkNeedOpenStore(User user,int storeId,long startTime,long endTime) throws Exception {
|
||||
public void checkNeedOpenStore(User user,int storeId,long startTime,long endTime) throws Exception {
|
||||
if(storeId == 0){
|
||||
return;
|
||||
}
|
||||
|
|
@ -227,6 +227,9 @@ public class ActivityLogic {
|
|||
abstractActivity.initActivity(user);
|
||||
int activityOpenState = getActivityOpenState(user, openActivityId);
|
||||
abstractActivity.setOpenState(user,activityOpenState);
|
||||
if(activityOpenState == ActivityType.UNOPEN_STATE){
|
||||
continue;
|
||||
}
|
||||
//非角色活动开启通知
|
||||
openNewActivityIds.add(openActivityId);
|
||||
if(sGlobalActivity.getShopId()!=0){
|
||||
|
|
@ -287,6 +290,9 @@ public class ActivityLogic {
|
|||
// }
|
||||
int activityOpenState = getActivityOpenState(user, activityId );
|
||||
abstractActivity.setOpenState(user,activityOpenState);
|
||||
if(activityOpenState == ActivityType.UNOPEN_STATE){
|
||||
continue;
|
||||
}
|
||||
openNewActivityIds.add(activityId);
|
||||
checkNeedOpenStore(user,sGlobalActivity.getShopId(),startTime,endTime);
|
||||
} else {
|
||||
|
|
@ -430,7 +436,7 @@ public class ActivityLogic {
|
|||
if(virtureId > myVirtureId){
|
||||
state = ActivityType.UNOPEN_STATE;
|
||||
}
|
||||
}else{
|
||||
}else if(openRuleType == 2){
|
||||
if(user.getPlayerInfoManager().getLevel()<openRulleValue){
|
||||
state = ActivityType.UNOPEN_STATE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.ljsd.jieling.logic.dao.ActivityMission;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.SGlobalActivity;
|
||||
import config.SGlobalSystemConfig;
|
||||
import config.SMainLevelConfig;
|
||||
|
|
@ -47,6 +48,11 @@ public class FightMainEventHandler implements IEventHandler{
|
|||
if(mineMainLevelConfig!=null && virtureId <= mineMainLevelConfig.getVirtureId()){
|
||||
activityMission.updateActivityState(ActivityType.OPEN_STATE);
|
||||
ActivityLogic.getInstance().sendActivityInfo(user,sGlobalActivity.getId());
|
||||
if(sGlobalActivity.getShopId()!=0){
|
||||
long startTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),user.getPlayerInfoManager().getCreateTime(), 1);
|
||||
long endTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),user.getPlayerInfoManager().getCreateTime(), 2);
|
||||
ActivityLogic.getInstance().checkNeedOpenStore(user,sGlobalActivity.getShopId(),startTime,endTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.dao.ActivityMission;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.SGlobalActivity;
|
||||
import config.SGlobalSystemConfig;
|
||||
import config.SMainLevelConfig;
|
||||
|
|
@ -49,6 +50,11 @@ public class UserLevelEventHandler implements IEventHandler{
|
|||
if(user.getPlayerInfoManager().getLevel()>=openRules[1]){
|
||||
activityMission.updateActivityState(ActivityType.OPEN_STATE);
|
||||
ActivityLogic.getInstance().sendActivityInfo(user,sGlobalActivity.getId());
|
||||
if(sGlobalActivity.getShopId()!=0){
|
||||
long startTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),user.getPlayerInfoManager().getCreateTime(), 1);
|
||||
long endTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),user.getPlayerInfoManager().getCreateTime(), 2);
|
||||
ActivityLogic.getInstance().checkNeedOpenStore(user,sGlobalActivity.getShopId(),startTime,endTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private int pid;
|
||||
|
||||
private int gid;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private int level;
|
||||
|
|
@ -505,6 +507,7 @@ public class PlayerManager extends MongoBase {
|
|||
this.phoneBindInfo = phoneBindInfo;
|
||||
}
|
||||
|
||||
|
||||
public void setPid(int pid) {
|
||||
updateString("pid",pid);
|
||||
this.pid = pid;
|
||||
|
|
@ -514,6 +517,14 @@ public class PlayerManager extends MongoBase {
|
|||
return pid;
|
||||
}
|
||||
|
||||
public int getGid() {
|
||||
return gid;
|
||||
}
|
||||
|
||||
public void setGid(int gid) {
|
||||
updateString("gid",gid);
|
||||
this.gid = gid;
|
||||
}
|
||||
|
||||
public Set<Integer> getSysMailIds() {
|
||||
return sysMailIds;
|
||||
|
|
|
|||
|
|
@ -38,31 +38,33 @@ public class UserManager {
|
|||
return userMap.containsKey(uid);
|
||||
}
|
||||
|
||||
public static User userLogin(int uid,String openId,String channel,int pid) throws Exception {
|
||||
public static User userLogin(int uid,String openId,String channel,int pid,int gid) throws Exception {
|
||||
User user = null;
|
||||
if (!UserManager.isUserExist(uid)){
|
||||
user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), uid, User.class);
|
||||
if (user == null) {
|
||||
user = registerUser(uid,openId,channel,pid);
|
||||
user = registerUser(uid,openId,channel,pid,gid);
|
||||
}
|
||||
UserManager.addUser(user);
|
||||
}else{
|
||||
user = getUser(uid);
|
||||
user.getPlayerInfoManager().setGid(gid);
|
||||
user.getPlayerInfoManager().setPid(pid);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
private static User registerUser(int uid,String openId,String channel,int pid) throws Exception {
|
||||
private static User registerUser(int uid,String openId,String channel,int pid,int gid) throws Exception {
|
||||
User user = new User(uid);
|
||||
initPlayer(user,openId,channel,pid);
|
||||
initPlayer(user,openId,channel,pid,gid);
|
||||
UserManager.addUser(user);
|
||||
MongoUtil.getInstence().getMyMongoTemplate().save(user);
|
||||
PlayerLogic.getInstance().sendTestWelfareMail(user,1,1);
|
||||
return user;
|
||||
}
|
||||
|
||||
private static void initPlayer(User user,String openId,String channel,int pid) throws Exception {
|
||||
private static void initPlayer(User user,String openId,String channel,int pid,int gid) throws Exception {
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
long now = TimeUtils.now();
|
||||
|
|
@ -81,17 +83,11 @@ public class UserManager {
|
|||
playerManager.setPhoneBindInfo(new PhoneBindInfo(""));
|
||||
playerManager.setChannel(channel);
|
||||
playerManager.setPid(pid);
|
||||
playerManager.setGid(gid);
|
||||
playerManager.setHeadFrame(STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDefaultPicture());
|
||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
|
||||
playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy());
|
||||
playerManager.setRideLevel(1);
|
||||
ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD);
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Map<String, Hero> heroMap = heroManager.getHeroMap();
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
List<Hero> teamHeros = new ArrayList<>(1);
|
||||
teamHeros.add(heroMap.values().iterator().next());
|
||||
teamPosManager.addTeamOfInitPlayer(teamHeros);
|
||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, 1, true);
|
||||
playerManager.setMaxForce(force);
|
||||
PlayerLogic.getInstance().vipflushEveryDay(user,null);
|
||||
|
|
@ -103,6 +99,13 @@ public class UserManager {
|
|||
user.getUserMissionManager().onGameEvent(user, GameEvent.BLOODY_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BEGINNER);
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.LOGIN_TIMES.getType(),1));
|
||||
ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD);
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Map<String, Hero> heroMap = heroManager.getHeroMap();
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
List<Hero> teamHeros = new ArrayList<>(1);
|
||||
teamHeros.add(heroMap.values().iterator().next());
|
||||
teamPosManager.addTeamOfInitPlayer(teamHeros);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
public class ShieldedWordUtils {
|
||||
|
||||
|
|
@ -60,4 +61,14 @@ public class ShieldedWordUtils {
|
|||
boolean hasDirtyWords = SensitivewordFilter.isContaintSensitiveWord(userName, 1);
|
||||
return hasDirtyWords;
|
||||
}
|
||||
|
||||
public static String replaceUnword(String content) {
|
||||
// 只允许字母和数字
|
||||
// String regEx = "[^a-zA-Z0-9]";
|
||||
// 清除掉所有特殊字符
|
||||
String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、? \\\\]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(content);
|
||||
return m.replaceAll("").replaceAll(" ","");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue