Merge branch 'master' of 60.1.1.230:backend/jieling_server
commit
894c9e7267
|
@ -51,11 +51,14 @@ public class GMRequestHandler extends BaseHandler{
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
int gmCommandType = Integer.parseInt(commandArray[0]);// 1:道具(type#数量) 2: 卡牌
|
int gmCommandType = Integer.parseInt(commandArray[0]);// 1:道具(type#数量) 2: 卡牌
|
||||||
int prarm1 = 0, prarm2 = 0;
|
int prarm1 = 0, prarm2 = 0;
|
||||||
|
String prarm3 = "";
|
||||||
if (gmCommandType == 0){
|
if (gmCommandType == 0){
|
||||||
prarm1 = Integer.parseInt(commandArray[1]);
|
prarm1 = Integer.parseInt(commandArray[1]);
|
||||||
}else {
|
}else {
|
||||||
prarm1 = Integer.parseInt(commandArray[1]);
|
prarm1 = Integer.parseInt(commandArray[1]);
|
||||||
prarm2 = Integer.parseInt(commandArray[2]);
|
if (prarm1 ==1){
|
||||||
|
prarm3 = commandArray[2].replace(",","#");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
User cUser = UserManager.getUser(uid);
|
User cUser = UserManager.getUser(uid);
|
||||||
switch (gmCommandType){
|
switch (gmCommandType){
|
||||||
|
@ -68,7 +71,7 @@ public class GMRequestHandler extends BaseHandler{
|
||||||
break;
|
break;
|
||||||
case GlobalGm.SEND_MAIIL:
|
case GlobalGm.SEND_MAIIL:
|
||||||
int nowTime =(int) (TimeUtils.now()/1000);
|
int nowTime =(int) (TimeUtils.now()/1000);
|
||||||
Mail mail = new Mail(uid,"GM","GM",prarm1+"#"+prarm2,nowTime,30*24*60*60,"GM", Global.MAIL_TYPE_GM);
|
Mail mail = new Mail(uid,"GM","GM",prarm3,nowTime,30*24*60*60,"GM", Global.MAIL_TYPE_GM);
|
||||||
cUser.getMailManager().addMail(mail);
|
cUser.getMailManager().addMail(mail);
|
||||||
PlayerInfoProto.RedPointInfo redPointInfo = PlayerInfoProto.RedPointInfo.newBuilder().setType(1).build();
|
PlayerInfoProto.RedPointInfo redPointInfo = PlayerInfoProto.RedPointInfo.newBuilder().setType(1).build();
|
||||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.SEND_RED_POINT_INDICATION_VALUE,redPointInfo,true);
|
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.SEND_RED_POINT_INDICATION_VALUE,redPointInfo,true);
|
||||||
|
|
|
@ -63,7 +63,6 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
. setId(guideItem.getValue())
|
. setId(guideItem.getValue())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
MailLogic.getInstance().delUserMail(userId);
|
|
||||||
CommonProto.Player player = CBean2Proto.getPlayer(userId, user.getPlayerInfoManager(), user.getPlayerInfoManager().getMapId(), user.getMapManager().getCurMapId(),user.getMapManager());
|
CommonProto.Player player = CBean2Proto.getPlayer(userId, user.getPlayerInfoManager(), user.getPlayerInfoManager().getMapId(), user.getMapManager().getCurMapId(),user.getMapManager());
|
||||||
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
|
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
|
||||||
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
|
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
|
||||||
|
|
|
@ -147,9 +147,14 @@ public class MailLogic {
|
||||||
Mail mail = mailManager.getMailMap().get(mailId);
|
Mail mail = mailManager.getMailMap().get(mailId);
|
||||||
if (mail == null){
|
if (mail == null){
|
||||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"");
|
MessageUtil.sendErrorResponse(iSession,0,msgId,"");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mail.getMailItem().isEmpty()){
|
||||||
|
mailManager.removeMail(mailId);
|
||||||
|
}else{
|
||||||
|
mail.setState(Global.MAIL_STATE_READ);
|
||||||
|
mailManager.addMail(mail);
|
||||||
}
|
}
|
||||||
mail.setState(Global.MAIL_STATE_READ);
|
|
||||||
mailManager.addMail(mail);
|
|
||||||
MessageUtil.sendMessage(iSession, 1,msgId, null, true);
|
MessageUtil.sendMessage(iSession, 1,msgId, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +163,7 @@ public class MailLogic {
|
||||||
User user = UserManager.getUser(userId);
|
User user = UserManager.getUser(userId);
|
||||||
MailManager mailManager = user.getMailManager();
|
MailManager mailManager = user.getMailManager();
|
||||||
StringBuilder mailItem = new StringBuilder();
|
StringBuilder mailItem = new StringBuilder();
|
||||||
|
List<String> delMailIds = new CopyOnWriteArrayList<>();
|
||||||
for (String mailId : mailIdsList){
|
for (String mailId : mailIdsList){
|
||||||
Mail mail = mailManager.getMail(mailId);
|
Mail mail = mailManager.getMail(mailId);
|
||||||
if (mail == null){
|
if (mail == null){
|
||||||
|
@ -168,11 +174,15 @@ public class MailLogic {
|
||||||
}else{
|
}else{
|
||||||
mailItem.append("|").append(mail.getMailItem());
|
mailItem.append("|").append(mail.getMailItem());
|
||||||
}
|
}
|
||||||
mail.setState(Global.MAIL_DRAW_ST_GOT);
|
delMailIds.add(mailId);
|
||||||
mailManager.addMail(mail);
|
// mail.setState(Global.MAIL_DRAW_ST_GOT);
|
||||||
|
// mailManager.addMail(mail);
|
||||||
}
|
}
|
||||||
int[][] itemArr = StringUtil.parseFiledInt2(mailItem.toString());
|
int[][] itemArr = StringUtil.parseFiledInt2(mailItem.toString());
|
||||||
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, itemArr);
|
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, itemArr);
|
||||||
|
for (String mailId:delMailIds){
|
||||||
|
mailManager.removeMail(mailId);
|
||||||
|
}
|
||||||
return dropBuilder;
|
return dropBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue