feat: add ability to buy resin with primogems (#2104)

* feat: add ability to buy resin with primogems

* ResinManager#buy returns RetCode value
This commit is contained in:
hamusuke
2023-04-10 09:20:12 +09:00
committed by GitHub
Unverified
parent 7254f55762
commit caf9521013
9 changed files with 1265 additions and 118 deletions
@@ -7,17 +7,16 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ResinChangeNotifyOuterClass.ResinChangeNotify;
public class PacketResinChangeNotify extends BasePacket {
public PacketResinChangeNotify(Player player) {
super(PacketOpcodes.ResinChangeNotify);
ResinChangeNotify proto = ResinChangeNotify.newBuilder()
.setCurValue(player.getProperty(PlayerProperty.PROP_PLAYER_RESIN))
.setNextAddTimestamp(player.getNextResinRefresh())
.build();
// ToDo: Add ability to buy resin with primogems, has to be included here.
this.setData(proto);
}
public PacketResinChangeNotify(Player player) {
super(PacketOpcodes.ResinChangeNotify);
ResinChangeNotify proto = ResinChangeNotify.newBuilder()
.setCurValue(player.getProperty(PlayerProperty.PROP_PLAYER_RESIN))
.setNextAddTimestamp(player.getNextResinRefresh())
.setCurBuyCount(player.getResinBuyCount())
.build();
this.setData(proto);
}
}