Grasscutters / Grasscutter

A server software reimplementation for a certain anime game.
https://grasscutter.io/
GNU Affero General Public License v3.0
16.21k stars 4.47k forks source link

[Bug] can't load the game if using the quest command #1755

Open natsuyuzora opened 2 years ago

natsuyuzora commented 2 years ago

Did you look for other closed issues that have the same problem? not sure

version game 3.0 grasscutter 1.2.3-dev-79323a0 (i have just downloaded the latest code and get the old files covered)

Describe the bug Steps:

1.Create a new ID 2.Enter the Game 3.Choose Male character / Choose Female Character (tried both) 4.On the beach, add starting quest by using follwing command: add 35104 finish 35100 finish 35101 finish 35106 finish 35105 finsh 35102 (流浪者足迹任务) 5.quit the game, return back to the login page. 6.Enter the game without problem, the loading is successful 7.Then, try to continue the next quest by using command. After commpleting each quest, quit the game and login in again. it gones fine. 8.But!!!, when finishing the quest "Going Upon the Breeze", it goes wrong. 9.1 quit the game, return back to the login page. 9.2 Enter the game. However, it falied. The loading page didn't appear, it's just full of white.(Even rebooster the game or computer)

Logs

java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2 at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source) at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source) at java.base/java.util.Objects.checkIndex(Unknown Source) at java.base/java.util.ArrayList.get(Unknown Source) at emu.grasscutter.game.quest.GameMainQuest.rewind(GameMainQuest.java:173) at emu.grasscutter.game.quest.QuestManager.onLogin(QuestManager.java:90) at emu.grasscutter.game.player.Player.onLogin(Player.java:1163) at emu.grasscutter.server.packet.recv.HandlerPlayerLoginReq.handle(HandlerPlayerLoginReq.java:48) at emu.grasscutter.server.game.GameServerPacketHandler.handle(GameServerPacketHandler.java:88) at emu.grasscutter.server.game.GameSession.handleReceive(GameSession.java:247) at emu.grasscutter.server.game.GameSessionManager$1.lambda$handleReceive$0(GameSessionManager.java:72) at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Unknown Source)

Additional context if I continue quest without quiting game, when it works to quest "Dragon Disaster", the game will crash!

Question how can i solve those problem? i just want to enjoy the story, anyone who can help me, plz

NullExir commented 2 years ago

I think your only resort at this point is to change the quest data in the MongoDB Compass, or just delete it and start that quest again, or you can use my data for that quest, I've already completed it with /quest add|finish 360** commands.

You can insert in mongoDB Compass Add Data → Insert Document

{
  "_id": {
    "$oid": "6318b21d1025285b14ee8972"
  },
  "ownerUid": 10004,
  "childQuests": {
    "36001": {
      "_t": "GameQuest",
      "subQuestId": 36001,
      "mainQuestId": 360,
      "state": "QUEST_STATE_FINISHED",
      "startTime": 1662562845,
      "acceptTime": 1662562845,
      "finishTime": 1662562896,
      "finishProgressList": [
        0
      ],
      "triggers": {}
    },
    "36003": {
      "_t": "GameQuest",
      "subQuestId": 36003,
      "mainQuestId": 360,
      "state": "QUEST_STATE_FINISHED",
      "startTime": 1662562896,
      "acceptTime": 1662562896,
      "finishTime": 1662562918,
      "finishProgressList": [
        0
      ],
      "triggers": {}
    },
    "36004": {
      "_t": "GameQuest",
      "subQuestId": 36004,
      "mainQuestId": 360,
      "state": "QUEST_STATE_FINISHED",
      "startTime": 1662562918,
      "acceptTime": 1662562918,
      "finishTime": 1662562949,
      "finishProgressList": [
        1
      ],
      "triggers": {}
    },
    "36005": {
      "_t": "GameQuest",
      "subQuestId": 36005,
      "mainQuestId": 360,
      "state": "QUEST_STATE_FINISHED",
      "startTime": 1662562949,
      "acceptTime": 1662562949,
      "finishTime": 1662563056,
      "finishProgressList": [
        0
      ],
      "triggers": {
        "ENTER_REGION_6": false
      }
    }
  },
  "parentQuestId": 360,
  "questVars": [
    0,
    0,
    0,
    0,
    0
  ],
  "state": "PARENT_QUEST_STATE_FINISHED",
  "isFinished": true,
  "questGroupSuites": [
    {
      "_t": "QuestGroupSuite",
      "scene": 3,
      "group": 133003435,
      "suite": 1
    },
    {
      "_t": "QuestGroupSuite",
      "scene": 3,
      "group": 133003435,
      "suite": 2
    },
    {
      "_t": "QuestGroupSuite",
      "scene": 3,
      "group": 133003136,
      "suite": 1
    },
    {
      "_t": "QuestGroupSuite",
      "scene": 3,
      "group": 133003136,
      "suite": 2
    }
  ],
  "talks": {
    "36001": {
      "_t": "TalkData",
      "id": 36001,
      "heroTalk": "TALK_HERO_MAIN"
    }
  },
  "rewindPositions": {},
  "rewindRotations": {}
}

img

natsuyuzora commented 2 years ago

thanks for your reply, I'd like to give a try. Since you guys are getting tutorial quests to run properly, i hope it successes as expected.

G-370 commented 2 years ago

I will be giving a look at this and make a PR, if no one else is doing it.

There's a slight problem at what is being done in https://github.com/Grasscutters/Grasscutter/blob/a90455a7a4832821885580d3cd6ab20bdd824f9e/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java#L173 Which is where the error that natsuyuzora reported originate.

Hartie95 commented 2 years ago

I will be giving a look at this and make a PR, if no one else is doing it.

There's a slight problem at what is being done in

https://github.com/Grasscutters/Grasscutter/blob/a90455a7a4832821885580d3cd6ab20bdd824f9e/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java#L173

Which is where the error that natsuyuzora reported originate.

Its fixed in my quests branch, together with other quest related thing, but its still wip since fixing quests have many connections to other components, and I went from adding some missing methods and triggers to fixing and rewriting parts of the dungeon system to fixing some things in the challenges. But if you are interested in helping with quest fixes, we will probably find things you can help with over on discord ^^

G-370 commented 2 years ago

I will be giving a look at this and make a PR, if no one else is doing it. There's a slight problem at what is being done in https://github.com/Grasscutters/Grasscutter/blob/a90455a7a4832821885580d3cd6ab20bdd824f9e/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java#L173

Which is where the error that natsuyuzora reported originate.

Its fixed in my quests branch, together with other quest related thing, but its still wip since fixing quests have many connections to other components, and I went from adding some missing methods and triggers to fixing and rewriting parts of the dungeon system to fixing some things in the challenges. But if you are interested in helping with quest fixes, we will probably find things you can help with over on discord ^^

Ah, fantastic! I will be joining you guys there