message.expireTime=(int)Instant.now().getEpochSecond();// Just set the mail as expired for now. I don't want to implement a counter specifically for an account...
if(message.stateValue==1){// Make sure it isn't a gift
if(message.expireTime<Instant.now().getEpochSecond()){// Make sure the message isn't expired (The game won't show expired mail, but I don't want to send unnecessary information).
if(mailDataList.size()<=1000){// Make sure that there isn't over 1000 messages in the mailbox. (idk what will happen if there is but the game probably won't like it.)
proto.setIsTruncated(false);// When enabled this will send a notification to the user that their inbox is full when opening the mailbox.
proto.setIsTruncated(mailDataList.size()<=1000?false:true);// When enabled this will send a notification to the user telling them their inbox is full and they should delete old messages when opening the mailbox.