Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gc to 3.3 #1981

Merged
merged 8 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed codes
  • Loading branch information
Simplxss committed Dec 22, 2022
commit 6ee37a3997c06c35f9987eacb3f537047c165410
2 changes: 1 addition & 1 deletion src/main/java/emu/grasscutter/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import emu.grasscutter.utils.Utils;

public final class GameConstants {
public static String VERSION = "3.2.0";
public static String VERSION = "3.3.0";

public static final int DEFAULT_TEAMS = 4;
public static final int MAX_TEAMS = 10;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emu/grasscutter/data/excels/ItemData.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class ItemData extends GameResource {
private List<Integer> furnType;
private List<Integer> furnitureGadgetID;

@SerializedName(value="roomSceneId", alternate={"BMEPAMCNABE", "DANFGGLKLNO", "JFDLJGDFIGL", "OHIANNAEEAK"})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to yukiz's res, i search the bug for a afternoon, qwq

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

顽张ってね

@SerializedName(value="roomSceneId", alternate={"BMEPAMCNABE", "DANFGGLKLNO", "JFDLJGDFIGL", "OHIANNAEEAK", "MFGACDIOHGF"})
private int roomSceneId;

// Custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void handleModifierChange(AbilityInvokeEntry invoke) throws Exception {

// Destroying rocks
if (target instanceof EntityGadget targetGadget && targetGadget.getContent() instanceof GadgetGatherObject gatherObject) {
if (data.getAction() == ModifierAction.REMOVED) {
if (data.getAction() == ModifierAction.MODIFIER_ACTION_REMOVED) {
gatherObject.dropItems(this.getPlayer());
return;
}
Expand All @@ -151,7 +151,7 @@ private void handleModifierChange(AbilityInvokeEntry invoke) throws Exception {
}

// This is not how it works but we will keep it for now since healing abilities dont work properly anyways
if (data.getAction() == ModifierAction.ADDED && data.getParentAbilityName() != null) {
if (data.getAction() == ModifierAction.MODIFIER_ACTION_ADDED && data.getParentAbilityName() != null) {
// Handle add modifier here
String modifierString = data.getParentAbilityName().getStr();
AbilityModifierEntry modifier = GameData.getAbilityModifiers().get(modifierString);
Expand All @@ -164,7 +164,7 @@ private void handleModifierChange(AbilityInvokeEntry invoke) throws Exception {

// Add to meta modifier list
target.getMetaModifiers().put(head.getInstancedModifierId(), modifierString);
} else if (data.getAction() == ModifierAction.REMOVED) {
} else if (data.getAction() == ModifierAction.MODIFIER_ACTION_REMOVED) {
// Handle remove modifier
String modifierString = target.getMetaModifiers().get(head.getInstancedModifierId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public BattlePassSchedule getScheduleProto() {
.setEndTime(2059483200)
.setIsViewed(this.isViewed())
.setUnlockStatus(this.isPaid() ? BattlePassUnlockStatus.BATTLE_PASS_UNLOCK_STATUS_PAID : BattlePassUnlockStatus.BATTLE_PASS_UNLOCK_STATUS_FREE)
.setUnk2700ODHAAHEPFAG(2) // Not bought on Playstation.
.setPaidPlatformFlags(2) // Not bought on Playstation.
.setCurCyclePoints(this.getCyclePoints())
.setCurCycle(BattlePassCycle.newBuilder()
.setBeginTime(0)
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/emu/grasscutter/game/friends/Friendship.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
@Entity(value = "friendships", useDiscriminator = false)
public class Friendship {
@Id private ObjectId id;

@Transient private Player owner;

@Indexed private int ownerId;
@Indexed private int friendId;
private boolean isFriend;
private int askerId;

private PlayerProfile profile;

@Deprecated // Morphia use only
public Friendship() { }

public Friendship(Player owner, Player friend, Player asker) {
this.setOwner(owner);
this.ownerId = owner.getUid();
Expand Down Expand Up @@ -69,12 +69,12 @@ public void setAskerId(int askerId) {
public PlayerProfile getFriendProfile() {
return profile;
}

public void setFriendProfile(Player character) {
if (character == null || this.friendId != character.getUid()) return;
this.profile = character.getProfile();
}

public boolean isOnline() {
return getFriendProfile().getPlayer() != null;
}
Expand All @@ -86,7 +86,7 @@ public void save() {
public void delete() {
DatabaseHelper.deleteFriendship(this);
}

public FriendBrief toProto() {
FriendBrief proto = FriendBrief.newBuilder()
.setUid(getFriendProfile().getUid())
Expand All @@ -95,7 +95,7 @@ public FriendBrief toProto() {
.setProfilePicture(ProfilePicture.newBuilder().setAvatarId(getFriendProfile().getAvatarId()))
.setWorldLevel(getFriendProfile().getWorldLevel())
.setSignature(getFriendProfile().getSignature())
.setOnlineState(getFriendProfile().isOnline() ? FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE : FriendOnlineState.FRIEND_ONLINE_STATE_FREIEND_DISCONNECT)
.setOnlineState(getFriendProfile().isOnline() ? FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE : FriendOnlineState.FRIEND_ONLINE_STATE_DISCONNECT)
.setIsMpModeAvailable(true)
.setLastActiveTime(getFriendProfile().getLastActiveTime())
.setNameCardId(getFriendProfile().getNameCard())
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/emu/grasscutter/game/home/GameHome.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void onOwnerLogin(Player player) {
player.getSession().send(new PacketHomeComfortInfoNotify(player));
player.getSession().send(new PacketFurnitureCurModuleArrangeCountNotify());
player.getSession().send(new PacketHomeMarkPointNotify(player));
player.getSession().send(new PacketUnlockedHomeBgmNotify(player));
player.getSession().send(new PacketHomeAllUnlockedBgmIdListNotify(player));
}

public Player getPlayer() {
Expand All @@ -99,8 +99,8 @@ public boolean addUnlockedHomeBgm(int homeBgmId) {
if (!getUnlockedHomeBgmList().add(homeBgmId)) return false;

var player = this.getPlayer();
player.sendPacket(new PacketUnlockHomeBgmNotify(homeBgmId));
player.sendPacket(new PacketUnlockedHomeBgmNotify(player));
player.sendPacket(new PacketHomeNewUnlockedBgmIdListNotify(homeBgmId));
player.sendPacket(new PacketHomeAllUnlockedBgmIdListNotify(player));
save();
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/emu/grasscutter/game/home/HomeSceneItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void update(HomeSceneArrangementInfo arrangementInfo) {
this.bornPos = new Position(arrangementInfo.getBornPos());
this.bornRot = new Position(arrangementInfo.getBornRot());
this.djinnPos = new Position(arrangementInfo.getDjinnPos());
this.homeBgmId = arrangementInfo.getUnk2700BJHAMKKECEI();
this.homeBgmId = arrangementInfo.getBgmId();
this.mainHouse = HomeFurnitureItem.parseFrom(arrangementInfo.getMainHouse());
this.tmpVersion = arrangementInfo.getTmpVersion();
}
Expand Down Expand Up @@ -84,7 +84,7 @@ public HomeSceneArrangementInfo toProto() {
.setDjinnPos(djinnPos.toProto())
.setIsSetBornPos(true)
.setSceneId(sceneId)
.setUnk2700BJHAMKKECEI(homeBgmId)
.setBgmId(homeBgmId)
.setTmpVersion(tmpVersion);

if (mainHouse != null) {
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/emu/grasscutter/game/player/TeamManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
import emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType;
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
import emu.grasscutter.server.event.player.PlayerTeamDeathEvent;
import emu.grasscutter.server.packet.send.PacketAddCustomTeamRsp;
import emu.grasscutter.server.packet.send.PacketAddBackupAvatarTeamRsp;
import emu.grasscutter.server.packet.send.PacketAvatarDieAnimationEndRsp;
import emu.grasscutter.server.packet.send.PacketAvatarFightPropUpdateNotify;
import emu.grasscutter.server.packet.send.PacketAvatarLifeStateChangeNotify;
import emu.grasscutter.server.packet.send.PacketAvatarTeamAllDataNotify;
import emu.grasscutter.server.packet.send.PacketAvatarTeamUpdateNotify;
import emu.grasscutter.server.packet.send.PacketChangeAvatarRsp;
import emu.grasscutter.server.packet.send.PacketChangeMpTeamAvatarRsp;
import emu.grasscutter.server.packet.send.PacketChangeTeamNameRsp;
import emu.grasscutter.server.packet.send.PacketChooseCurAvatarTeamRsp;
import emu.grasscutter.server.packet.send.PacketCustomTeamListNotify;
import emu.grasscutter.server.packet.send.PacketDelBackupAvatarTeamRsp;
import emu.grasscutter.server.packet.send.PacketPlayerEnterSceneNotify;
import emu.grasscutter.server.packet.send.PacketRemoveCustomTeamRsp;
import emu.grasscutter.server.packet.send.PacketSceneTeamUpdateNotify;
import emu.grasscutter.server.packet.send.PacketSetUpAvatarTeamRsp;
import emu.grasscutter.server.packet.send.PacketWorldPlayerDieNotify;
Expand Down Expand Up @@ -660,7 +660,7 @@ public void onPlayerLogin() { // Hack for now to fix resonances on login
public synchronized void addNewCustomTeam() {
// Sanity check - max number of teams.
if (this.teams.size() == GameConstants.MAX_TEAMS) {
player.sendPacket(new PacketAddCustomTeamRsp(Retcode.RET_FAIL));
player.sendPacket(new PacketAddBackupAvatarTeamRsp(Retcode.RET_FAIL));
return;
}

Expand All @@ -677,21 +677,21 @@ public synchronized void addNewCustomTeam() {
this.teams.put(id, new TeamInfo());

// Send packets.
player.sendPacket(new PacketCustomTeamListNotify(player));
player.sendPacket(new PacketAddCustomTeamRsp());
player.sendPacket(new PacketAvatarTeamAllDataNotify(player));
player.sendPacket(new PacketAddBackupAvatarTeamRsp());
}

public synchronized void removeCustomTeam(int id) {
// Check if the target id exists.
if (!this.teams.containsKey(id)) {
player.sendPacket(new PacketRemoveCustomTeamRsp(Retcode.RET_FAIL, id));
player.sendPacket(new PacketDelBackupAvatarTeamRsp(Retcode.RET_FAIL, id));
}

// Remove team.
this.teams.remove(id);

// Send packets.
player.sendPacket(new PacketCustomTeamListNotify(player));
player.sendPacket(new PacketRemoveCustomTeamRsp(id));
player.sendPacket(new PacketAvatarTeamAllDataNotify(player));
player.sendPacket(new PacketDelBackupAvatarTeamRsp(id));
}
}
3 changes: 1 addition & 2 deletions src/main/java/emu/grasscutter/game/quest/GameMainQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import javax.script.CompiledScript;
import javax.script.ScriptException;

import static emu.grasscutter.config.Configuration.SCRIPT;

@Entity(value = "quests", useDiscriminator = false)
public class GameMainQuest {
Expand Down Expand Up @@ -356,7 +355,7 @@ public ParentQuest toProto() {
.setIsFinished(isFinished());

proto.setParentQuestState(getState().getValue())
.setCutsceneEncryptionKey(QuestManager.getQuestKey(parentQuestId));
.setVideoKey(QuestManager.getQuestKey(parentQuestId));
for (GameQuest quest : this.getChildQuests().values()) {
if (quest.getState() != QuestState.QUEST_STATE_UNSTARTED) {
ChildQuest childQuest = ChildQuest.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import emu.grasscutter.game.props.EnterReason;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
import emu.grasscutter.net.proto.PlayerApplyEnterMpReasonOuterClass.PlayerApplyEnterMpReason;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.player.Player.SceneLoadState;
import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private InvestigationMonsterOuterClass.InvestigationMonster getInvestigationMons
var bossChest = group.searchBossChestInGroup();
if (bossChest.isPresent()) {
builder.setResin(bossChest.get().resin);
builder.setBossChestNum(bossChest.get().take_num);
// builder.setBossChestNum(bossChest.get().take_num);
}
}
return builder.build();
Expand Down
Loading