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 gmCommandType = Integer.parseInt(commandArray[0]);// 1:道具(type#数量) 2: 卡牌
|
||||
int prarm1 = 0, prarm2 = 0;
|
||||
String prarm3 = "";
|
||||
if (gmCommandType == 0){
|
||||
prarm1 = Integer.parseInt(commandArray[1]);
|
||||
}else {
|
||||
prarm1 = Integer.parseInt(commandArray[1]);
|
||||
prarm2 = Integer.parseInt(commandArray[2]);
|
||||
if (prarm1 ==1){
|
||||
prarm3 = commandArray[2].replace(",","#");
|
||||
}
|
||||
}
|
||||
User cUser = UserManager.getUser(uid);
|
||||
switch (gmCommandType){
|
||||
|
@ -68,7 +71,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
break;
|
||||
case GlobalGm.SEND_MAIIL:
|
||||
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);
|
||||
PlayerInfoProto.RedPointInfo redPointInfo = PlayerInfoProto.RedPointInfo.newBuilder().setType(1).build();
|
||||
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())
|
||||
.build());
|
||||
}
|
||||
MailLogic.getInstance().delUserMail(userId);
|
||||
CommonProto.Player player = CBean2Proto.getPlayer(userId, user.getPlayerInfoManager(), user.getPlayerInfoManager().getMapId(), user.getMapManager().getCurMapId(),user.getMapManager());
|
||||
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
|
||||
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
|
||||
|
|
|
@ -147,9 +147,14 @@ public class MailLogic {
|
|||
Mail mail = mailManager.getMailMap().get(mailId);
|
||||
if (mail == null){
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -158,6 +163,7 @@ public class MailLogic {
|
|||
User user = UserManager.getUser(userId);
|
||||
MailManager mailManager = user.getMailManager();
|
||||
StringBuilder mailItem = new StringBuilder();
|
||||
List<String> delMailIds = new CopyOnWriteArrayList<>();
|
||||
for (String mailId : mailIdsList){
|
||||
Mail mail = mailManager.getMail(mailId);
|
||||
if (mail == null){
|
||||
|
@ -168,11 +174,15 @@ public class MailLogic {
|
|||
}else{
|
||||
mailItem.append("|").append(mail.getMailItem());
|
||||
}
|
||||
mail.setState(Global.MAIL_DRAW_ST_GOT);
|
||||
mailManager.addMail(mail);
|
||||
delMailIds.add(mailId);
|
||||
// mail.setState(Global.MAIL_DRAW_ST_GOT);
|
||||
// mailManager.addMail(mail);
|
||||
}
|
||||
int[][] itemArr = StringUtil.parseFiledInt2(mailItem.toString());
|
||||
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, itemArr);
|
||||
for (String mailId:delMailIds){
|
||||
mailManager.removeMail(mailId);
|
||||
}
|
||||
return dropBuilder;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue