代码整理

master_dev
grimm 2024-05-07 17:28:01 +08:00
parent ff8bda897d
commit e0b8ebf56c
1 changed files with 16 additions and 8 deletions

View File

@ -128,18 +128,26 @@ public class MessageUtil {
user.getPlayerInfoManager().setReds(reds); user.getPlayerInfoManager().setReds(reds);
} }
public static void sendBagIndication(int sendUid,int type, List<CommonProto.Item> sendToFront,boolean isMax) { public static void sendBagIndication(int sendUid, int type, List<CommonProto.Item> sendToFront, boolean isIndicationMax) {
if(!isMax){ PlayerInfoProto.UpdateBagIndication.Builder builder = PlayerInfoProto.UpdateBagIndication.newBuilder()
if(null!= SimpleTransaction.current()){ .addAllItem(sendToFront)
PlayerInfoProto.UpdateBagIndication.Builder build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type).setIsMax(isMax?1:0); .setType(type);
SimpleTransaction.current().dealWhileCommit(new SimpleTransaction.SendTask(build.build(), MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE));
if (isIndicationMax) {
builder.setIsMax(1);
} else {
builder.setIsMax(0);
SimpleTransaction transaction = SimpleTransaction.current();
if (transaction != null) {
transaction.dealWhileCommit(new SimpleTransaction.SendTask(builder.build(), MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE));
return; return;
} }
} }
ISession session = OnlineUserManager.sessionMap.get(sendUid); ISession session = OnlineUserManager.sessionMap.get(sendUid);
if(session!=null){ if (session != null) {
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type).setIsMax(isMax?1:0).build(); MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE, builder.build(), true);
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE,build,true);
} }
} }