Giter Site home page Giter Site logo

grasscutters / grasscutter Goto Github PK

View Code? Open in Web Editor NEW
15.6K 186.0 4.4K 94.56 MB

A server software reimplementation for a certain anime game.

Home Page: https://grasscutter.io/

License: GNU Affero General Public License v3.0

Java 95.31% Batchfile 0.18% Python 0.62% HTML 0.31% Shell 0.47% JavaScript 0.02% TypeScript 2.50% SCSS 0.57% Dockerfile 0.02%
java kcp server private-server

grasscutter's Introduction

Grasscutter

Documentation GitHub release (latest by date) GitHub GitHub last commit GitHub Workflow Status
Discord - Grasscutter

EN | 简中 | 繁中 | FR | ES | HE | RU | PL | ID | KR | FIL/PH | NL | JP | IT | VI

Attention: We always welcome contributors to the project. Before adding your contribution, please carefully read our Code of Conduct.

Current features

  • Logging in
  • Combat
  • Friends list
  • Teleportation
  • Gacha system
  • Co-op partially works
  • Spawning monsters via console
  • Inventory features (receiving items/characters, upgrading items/characters, etc)

Quick setup guide

Note: For support please join our Discord.

Quick Start (automatic)

  • Get Java 17

  • Get MongoDB Community Server

  • Get game version REL4.0.x (If you don't have a 4.0.x client, you can find it here and open any of the links to download it): 4.0.x Client-github 4.0.x Client-cloud drive

  • Download the latest Cultivation version. Use the .msi installer.

  • After opening Cultivation (as admin), press the download button in the upper right corner.

  • Click Download All-in-One

  • Click the gear in the upper right corner

  • Set the game Install path to where your game is located.

  • Set the Custom Java Path to C:\Program Files\Java\jdk-17\bin\java.exe

  • Leave all other settings on default

  • Click the small button next to launch.

  • Click the launch button.

  • Log in with whatever username you want. Password can be anything.

Building

Grasscutter uses Gradle to handle dependencies & building.

Requirements:

Clone
git clone --recurse-submodules https://github.com/Grasscutters/Grasscutter.git
cd Grasscutter
Compile

Note: Handbook generation may fail on some systems. To disable the handbook generation, append -PskipHandbook=1 to the gradlew jar command.

Windows:

.\gradlew.bat # Setting up environments
.\gradlew jar

Linux (GNU):

chmod +x gradlew
./gradlew jar
Compiling the Handbook (Manually)

With Gradle:

./gradlew generateHandbook

With NPM:

cd src/handbook
npm install
npm run build

You can find the output jar in the root of the project folder.

Troubleshooting

For a list of common issues and solutions and to ask for help, please join our Discord server and go to the support channel.

grasscutter's People

Contributors

4benj avatar akka0 avatar alt3ri avatar baisugar avatar birdulon avatar eternalcomet avatar exzork avatar ganyuslefthorn avatar gentlespoon avatar github-actions[bot] avatar hamusuke0323 avatar jie65535 avatar kengxxiao avatar kingrainbow44 avatar loulou310 avatar lunaticwhat avatar memetrollsxd avatar mingjun97 avatar mlgmxyysd avatar notthorny avatar omg-xtao avatar realheart avatar scooterboo avatar secretboy-smr avatar spikehd avatar startforkiller avatar tesutarin avatar totallynotondre avatar yazawazi avatar zhaodice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grasscutter's Issues

Add more detail of merge commits message

It's too hard to quickly locate some commits when the commits log contains tons of "Merge pull request ... from ..."

And I recommend using rebase rather than merge except we need to solve conflicts.

Error 4206

After I login ,it pops Error 4206.
Im using the latest dev branch.

Server log:
[16:35:08] [INFO] Game Server started on port 22102
[16:35:11] [INFO] [Dispatch] Client localhost/127.0.0.1:40396 is trying to log in via token
[16:35:11] [INFO] [Dispatch] Client localhost/127.0.0.1:40396 logged in via token as 10002
[16:35:11] [INFO] [Dispatch] Client localhost/127.0.0.1:40410 succeed to exchange combo token

Mitm log:
127.0.0.1:43226: client connect
127.0.0.1:43226: error establishing server connection: [Errno 111] Connect call failed ('127.0.0.1', 8888)
127.0.0.1:43226: POST http://localhost:8888/log
<< [Errno 111] Connect call failed ('127.0.0.1', 8888)
127.0.0.1:43226: client disconnect
127.0.0.1:43230: client connect
127.0.0.1:43230: error establishing server connection: [Errno 111] Connect call failed ('127.0.0.1', 8888)
127.0.0.1:43230: POST http://localhost:8888/log
<< [Errno 111] Connect call failed ('127.0.0.1', 8888)
127.0.0.1:43230: client disconnect
127.0.0.1:43234: client connect
127.0.0.1:43234: error establishing server connection: [Errno 111] Connect call failed ('127.0.0.1', 8888)
127.0.0.1:43234: POST http://localhost:8888/log
<< [Errno 111] Connect call failed ('127.0.0.1', 8888)
127.0.0.1:43234: client disconnect

java Version
openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment Microsoft-25298 (build 16.0.2+7)
OpenJDK 64-Bit Server VM Microsoft-25298 (build 16.0.2+7, mixed mode)ion

Compilation Error After pull #114

Compilation Error After pull #114

/home/kiana/Grasscutter/src/main/java/emu/grasscutter/tools/Tools.java:34: 错误: 对于FileReader(java.lang.String,java.nio.charset.Charset), 找不到合适的构造器
try (FileReader fileReader = new FileReader(Utils.toFilePath(Grasscutter.getConfig().RESOURCE_FOLDER + "TextMap/TextMapEN.json"), StandardCharsets.UTF_8)) {
^
构造器 java.io.FileReader.FileReader(java.lang.String)不适用
(实际参数列表和形式参数列表长度不同)
构造器 java.io.FileReader.FileReader(java.io.File)不适用
(实际参数列表和形式参数列表长度不同)
构造器 java.io.FileReader.FileReader(java.io.FileDescriptor)不适用
(实际参数列表和形式参数列表长度不同)
/home/kiana/Grasscutter/src/main/java/emu/grasscutter/tools/Tools.java:40: 错误: 对于PrintWriter(java.lang.String,java.nio.charset.Charset), 找不到合适的构造器
try (PrintWriter writer = new PrintWriter(fileName, StandardCharsets.UTF_8)) {
^
构造器 java.io.PrintWriter.PrintWriter(java.io.Writer,boolean)不适用
(参数不匹配; java.lang.String无法转换为java.io.Writer)
构造器 java.io.PrintWriter.PrintWriter(java.io.OutputStream,boolean)不适用
(参数不匹配; java.lang.String无法转换为java.io.OutputStream)
构造器 java.io.PrintWriter.PrintWriter(java.nio.charset.Charset,java.io.File)不适用
(参数不匹配; java.lang.String无法转换为java.nio.charset.Charset)
构造器 java.io.PrintWriter.PrintWriter(java.lang.String,java.lang.String)不适用
(参数不匹配; java.nio.charset.Charset无法转换为java.lang.String)
构造器 java.io.PrintWriter.PrintWriter(java.io.File,java.lang.String)不适用
(参数不匹配; java.lang.String无法转换为java.io.File)
注: 某些消息已经过简化; 请使用 -Xdiags:verbose 重新编译以获得完整输出
2 个错误

Exception when generating handbook

D:\Grasscutter>java -jar grasscutter.jar -handbook
[12:59:46] [WARN] Could not find resource: data/AbilityEmbryos.json
[12:59:46] [INFO] Loaded 300 AvatarTalentDatas.
[12:59:46] [INFO] Loaded 400 AvatarSkillDatas.
[12:59:46] [INFO] Loaded 73 AvatarSkillDepotDatas.
[12:59:46] [INFO] Loaded 167 MonsterDescribeDatas.
[12:59:46] [INFO] Loaded 1 AvatarCostumeDatas.
[12:59:46] [INFO] Loaded 3032 NpcDatas.
[12:59:46] [INFO] Loaded 66 ReliquaryMainPropDatas.
[12:59:47] [INFO] Loaded 200 MonsterCurveDatas.
[12:59:47] [INFO] Loaded 90 AvatarLevelDatas.
[12:59:47] [INFO] Loaded 6889 ItemDatas.
[12:59:47] [INFO] Loaded 336 AvatarPromoteDatas.
[12:59:47] [INFO] Loaded 335 ReliquaryAffixDatas.
[12:59:47] [INFO] Loaded 90 WeaponLevelDatas.
[12:59:47] [INFO] Loaded 939 WeaponPromoteDatas.
[12:59:47] [INFO] Loaded 9 AvatarFlycloakDatas.
[12:59:47] [INFO] Loaded 6626 GadgetDatas.
[12:59:47] [INFO] Loaded 100 AvatarCurveDatas.
[12:59:47] [INFO] Loaded 42 ReliquarySetDatas.
[12:59:47] [INFO] Loaded 100 WeaponCurveDatas.
[12:59:47] [INFO] Loaded 744 EquipAffixDatas.
[12:59:47] [INFO] Loaded 60 PlayerLevelDatas.
[12:59:47] [INFO] Loaded 101 ReliquaryLevelDatas.
[12:59:47] [INFO] Loaded 2420 ProudSkillDatas.
[12:59:47] [INFO] Loaded 568 MonsterDatas.
[12:59:47] [INFO] Loaded 78 AvatarDatas.
Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 22442 column 76 path $.
        at com.google.gson.Gson.fromJson(Gson.java:947)
        at com.google.gson.Gson.fromJson(Gson.java:897)
        at emu.grasscutter.tools.Tools.createGmHandbook(Tools.java:32)
        at emu.grasscutter.Grasscutter.main(Grasscutter.java:61)
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 22442 column 76 path $.
        at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
        at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:490)
        at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:413)
        at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:184)
        at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
        at com.google.gson.Gson.fromJson(Gson.java:932)
        ... 3 more

Exception when starting the server : Address already in use: bind

PS F:\UserFolder\Desktop\YuanShen> java -jar grasscutter.jar
[17:41:00] [INFO] Starting `Grasscutter...`
[17:41:00] [INFO] Loaded 300 AvatarTalentDatas.
[17:41:00] [INFO] Loaded 400 AvatarSkillDatas.
[17:41:00] [INFO] Loaded 3794 FetterDatas.
[17:41:00] [INFO] Loaded 73 AvatarSkillDepotDatas.
[17:41:00] [INFO] Loaded 167 MonsterDescribeDatas.
[17:41:00] [INFO] Loaded 1 AvatarCostumeDatas.
[17:41:00] [INFO] Loaded 3032 NpcDatas.
[17:41:00] [INFO] Loaded 66 ReliquaryMainPropDatas.
[17:41:00] [INFO] Loaded 200 MonsterCurveDatas.
[17:41:00] [INFO] Loaded 717 SceneDatas.
[17:41:00] [INFO] Loaded 90 AvatarLevelDatas.
[17:41:00] [INFO] Loaded 6889 ItemDatas.
[17:41:00] [INFO] Loaded 336 AvatarPromoteDatas.
[17:41:00] [INFO] Loaded 335 ReliquaryAffixDatas.
[17:41:00] [INFO] Loaded 90 WeaponLevelDatas.
[17:41:00] [INFO] Loaded 939 WeaponPromoteDatas.
[17:41:00] [INFO] Loaded 9 AvatarFlycloakDatas.
[17:41:00] [INFO] Loaded 6626 GadgetDatas.
[17:41:00] [INFO] Loaded 100 AvatarCurveDatas.
[17:41:00] [INFO] Loaded 42 ReliquarySetDatas.
[17:41:00] [INFO] Loaded 100 WeaponCurveDatas.
[17:41:00] [INFO] Loaded 744 EquipAffixDatas.
[17:41:00] [INFO] Loaded 60 PlayerLevelDatas.
[17:41:00] [INFO] Loaded 101 ReliquaryLevelDatas.
[17:41:00] [INFO] Loaded 2420 ProudSkillDatas.
[17:41:01] [INFO] Loaded 568 MonsterDatas.
[17:41:01] [INFO] Loaded 78 AvatarDatas.
[17:41:01] [ERROR] Relic properties are missing weights! Please check your ReliquaryMainPropExcelConfigData or ReliquaryAffixExcelConfigData files in your ExcelBinOutput folder.
[17:41:01] [INFO] Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms'}
[17:41:01] [INFO] Opened connection [connectionId{localValue:2, serverValue:63}] to localhost:27017
[17:41:01] [INFO] Opened connection [connectionId{localValue:1, serverValue:62}] to localhost:27017
[17:41:01] [INFO] Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=24613000}
[17:41:01] [INFO] Opened connection [connectionId{localValue:3, serverValue:64}] to localhost:27017
[17:41:01] [WARN] [Dispatch] No SSL cert found! Falling back to HTTP server.
Exception in thread "main" java.net.BindException: Address already in use: bind
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Net.java:555)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89)
        at jdk.httpserver/sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:101)
        at jdk.httpserver/sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
        at jdk.httpserver/sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
        at jdk.httpserver/com.sun.net.httpserver.HttpServer.create(HttpServer.java:150)
        at emu.grasscutter.server.dispatch.DispatchServer.start(DispatchServer.java:182)
        at emu.grasscutter.Grasscutter.main(Grasscutter.java:78)``

Missing the ISSUE TEMPLATE

The project is currently missing the Issue Templates which might be a good addition to this project so that people can interact with this project with some categorized sections. If you want to add that, then I would like to add a PR with some relevant templates. Please let me know what do you think about that.

Exception reflections.ReflectionsException: Scanner TypeAnnotationsScanner was not configured

Exception in thread "main" org.reflections.ReflectionsException: Scanner TypeAnnotationsScanner was not configured
at org.reflections.Store.get(Store.java:39)
at org.reflections.Store.get(Store.java:61)
at org.reflections.Store.get(Store.java:46)
at org.reflections.Reflections.getTypesAnnotatedWith(Reflections.java:429)
at org.reflections.Reflections.getTypesAnnotatedWith(Reflections.java:416)
at emu.grasscutter.command.CommandMap.scan(CommandMap.java:147)
at emu.grasscutter.command.CommandMap.(CommandMap.java:19)
at emu.grasscutter.server.game.GameServer.(GameServer.java:60)
at emu.grasscutter.Grasscutter.main(Grasscutter.java:80)
When it starts
Cannot continue

When using LAN server, connection error is reported 4206.

Reported by Discord user @YYLMZXC#7780, I started the issue on his behalf.

Description: He tried to set up a LAN server and tried to log in on another host, but it failed with error 4206.

Related information:

  • According to him, the ports are not occupied;
  • The firewall is set up properly and there is no blocking;
  • The PublicIP is modified to his LAN address;
  • The client uses Fiddler Classic and modifies the script to link to his server.
  • The version used is v1.0.0.

Images:
error
4206
console

Missing the Code of Conduct

The project is currently missing the Code of Conduct which defines standards for how to engage in a community. If you want to add that, then I would like to add a PR with the Code of Conduct. Please let me know what you think about that.

Can't send messages to the server in game

There are some commands that prompt me to "Run this command in-game." But I can't send any messages to the server in the game. Whether I entered the command or other words and clicked send but nothing happened

Implement account system

In the current Dispatch server implementation, no password is required to log in to the game, which is undoubtedly very insecure.

@Asnxthaony found that passwords were encrypted in transit using RSA, decryption was nearly impossible.

For this, I came up with the following solution for reference:

  1. Patch the game to 1) replace RSA key 2) disable password encrypt
    • Hard, needs to be disassembled
    • Unsafe, may be banned if you do not use proxy after patch
  2. Simulate the in-game login method (but is_crypto: false) in outside launcher (such as GlassClipper X, and fill in the combo token into the game's registry
    • PC (Windows) only, mobile client cannot use this method to login
    • The registry is encrypted
  3. Login outside the game, generate a temporary token (like JWT), and use this token as a username to log in in the game (keep password blank)
    • How long is the temporary period?
    • How to revoke token if it is accidentally leaked?
    • length limit (?)
  4. Login inside game: Only user name is required for login. After entering the game, use the chat box to enter the password, like AuthMe (a CraftBukkit plugin)
    • Calling up the chat box isn't as easy as Minecraft (just press /), users need at least 4 steps to bring up the chat box with player Server.
    • It may not be so easy to implement (?)
  5. Enter the user name and password in the same input box, using the specified separator as a boundary
    • The separator may be confused with the password/username entered by the player
    • When logging in, the password will be displayed in plaintext on the game
    • length limit (?)
  6. Implement the third-party login
    • Impossible, mobile client login by password only

Any other better?

Friendship level issue | Fetter issue

Hello,

I just recently update my grasscutter to the latest version and I encountered one issue.

Friendship level is automatically 10, although I never set friendship XP.

I tried purging my database and create a new account to see if the issue is gone but sadly, it was still present. Whatever I do.

I'm really annoyed at this issue since there's too many exclamation marks in characters selection.
(The exclamation mark is coming from this)
image

That's all, thanks.

Infinite loading

╭─root@localhost ~/disk/g/Grasscutter ‹stable*›
╰─➤ java -version 130 ↵
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

╭─root@localhost ~/disk/g/Grasscutter ‹stable*›
╰─➤ java -jar grasscutter.jar
[14:17:57] [INFO] Starting Grasscutter...
[14:17:58] [INFO] Loaded 300 AvatarTalentDatas.
[14:17:58] [INFO] Loaded 400 AvatarSkillDatas.
[14:17:58] [INFO] Loaded 3794 FetterDatas.
[14:17:58] [INFO] Loaded 73 AvatarSkillDepotDatas.
[14:17:58] [INFO] Loaded 167 MonsterDescribeDatas.
[14:17:58] [INFO] Loaded 1 AvatarCostumeDatas.
[14:17:58] [INFO] Loaded 3032 NpcDatas.
[14:17:58] [INFO] Loaded 66 ReliquaryMainPropDatas.
[14:17:58] [INFO] Loaded 200 MonsterCurveDatas.
[14:17:58] [INFO] Loaded 717 SceneDatas.
[14:17:58] [INFO] Loaded 90 AvatarLevelDatas.
[14:17:58] [INFO] Loaded 6889 ItemDatas.
[14:17:58] [INFO] Loaded 336 AvatarPromoteDatas.
[14:17:58] [INFO] Loaded 90 WeaponLevelDatas.
[14:17:58] [INFO] Loaded 335 ReliquaryAffixDatas.
[14:17:58] [INFO] Loaded 939 WeaponPromoteDatas.
[14:17:58] [INFO] Loaded 9 AvatarFlycloakDatas.
[14:17:58] [INFO] Loaded 6626 GadgetDatas.
[14:17:58] [INFO] Loaded 42 ReliquarySetDatas.
[14:17:58] [INFO] Loaded 100 AvatarCurveDatas.
[14:17:58] [INFO] Loaded 100 WeaponCurveDatas.
[14:17:58] [INFO] Loaded 744 EquipAffixDatas.
[14:17:58] [INFO] Loaded 60 PlayerLevelDatas.
[14:17:58] [INFO] Loaded 101 ReliquaryLevelDatas.
[14:17:58] [INFO] Loaded 2420 ProudSkillDatas.
[14:17:59] [INFO] Loaded 568 MonsterDatas.
[14:17:59] [INFO] Loaded 78 AvatarDatas.
[14:17:59] [ERROR] Scene point files cannot be found, you cannot use teleport waypoints!
[14:17:59] [ERROR] Relic properties are missing weights! Please check your ReliquaryMainPropExcelConfigData or ReliquaryAffixExcelConfigData files in your ExcelBinOutput folder.
[14:17:59] [INFO] Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms'}
[14:17:59] [INFO] Opened connection [connectionId{localValue:2, serverValue:4}] to localhost:27017
[14:17:59] [INFO] Opened connection [connectionId{localValue:1, serverValue:5}] to localhost:27017
[14:17:59] [INFO] Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=6, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=58043385}
[14:17:59] [INFO] Opened connection [connectionId{localValue:3, serverValue:6}] to localhost:27017
[14:17:59] [INFO] [Dispatch] Dispatch server started on port 443
[14:18:00] [INFO] Registered 86 PacketHandlers
[14:18:00] [INFO] Banners successfully loaded.
[14:18:00] [INFO] Game Server started on port 22102
[14:18:40] [INFO] [Dispatch] Client localhost/127.0.0.1:41870 request: query_region_list

config.json

{
"DatabaseUrl": "mongodb://localhost:27017",
"DatabaseCollection": "grasscutter",
"RESOURCE_FOLDER": "./resources/",
"DATA_FOLDER": "./data/",
"PACKETS_FOLDER": "./packets/",
"DUMPS_FOLDER": "./dumps/",
"KEY_FOLDER": "./keys/",
"RunMode": "HYBRID",
"GameServer": {
"Name": "Test",
"Ip": "0.0.0.0",
"PublicIp": "127.0.0.1",
"Port": 22102,
"DispatchServerDatabaseUrl": "mongodb://localhost:27017",
"DispatchServerDatabaseCollection": "grasscutter",
"LOG_PACKETS": false,
"InventoryLimitWeapon": 2000,
"InventoryLimitRelic": 2000,
"InventoryLimitMaterial": 2000,
"InventoryLimitFurniture": 2000,
"InventoryLimitAll": 30000,
"MaxAvatarsInTeam": 4,
"MaxAvatarsInTeamMultiplayer": 4,
"MaxEntityLimit": 1000,
"WatchGacha": false,
"WelcomeEmotes": [
2007,
1002,
4010
],
"WelcomeMotd": "Welcome to Grasscutter emu",
"Game": {
"ADVENTURE_EXP_RATE": 1.0,
"MORA_RATE": 1.0,
"DOMAIN_DROP_RATE": 1.0
}
},
"DispatchServer": {
"Ip": "0.0.0.0",
"PublicIp": "127.0.0.1",
"Port": 443,
"KeystorePath": "./keystore.p12",
"KeystorePassword": "",
"UseSSL": true,
"AutomaticallyCreateAccounts": false,
"GameServers": []
}
}

Screenshot_2022-04-24-14-19-35-929_com miHoYo Yuanshen

Help-seeking role cannot attack.

I got the character, but the character can't hold a weapon and can't release the skill normally. After releasing the skill, the character will get stuck and can't move. Is there any solution?

Terminology suggestions

  1. I suggest using reimplementation instead of emulation. Current use of the term emulation usually means "to run exactly what was run somewhere else, using means to imitate underlying systems" - a.k.a. emulating a whole platform (console games) to run software for it.
  2. I suggest using "Anime Game" instead of the game's name. Using the trademarked name may ruffle feathers and otherwise bring unwanted attention to the project.

development/keystore.p12 Installation failure in windows 10

Even though it shows that the certificate was successfully added, it does not appear in the Trusted Certification Authorities directory when you start certmgr.msc via win+r.
Compared to the certificate under stable, there is no "security prompt" during the installation process.
The certificate under stable can be installed normally.
1 (2)

Not working on android

The game can't logon correctly on android. The login screen flashes and then nothing happend.
I have properly installed mitmproxy certs to /system and trusted it.
I thought it was because im running server remotely,but after i moved the server to a chroot Linux container(Arch linux) on the phone,the issue still.
The mitmproxy seems redirecting the server traffic correctly. But i just cant login.

Android 12,OSREL

CNREL (mobile) login request not handled correctly

When I try to login in CNRELAndroid2.6.0 and CNRELiOS2.6.0, the game prompts a network error.

I have:

  • Connect to mitmproxy using WiFi proxy or VPN
  • Installed mitmproxy CA cert
  • Trusted mitmproxy CA cert

It seems that the server did not process the login request correctly for the following domains

gameapi-account.mihoyo.com
minor-api.mihoyo.com
public-data-api.mihoyo.com
uspider.yuanshen.com
sdk-static.mihoyo.com

2 clients cannot connect to a single server on the same public IP address

If you run a proxy, then connect (for example) a mobile device and your PC to a public server (ex. grasscutter.xigam.tech), the client that connects second will not get past PlayerTokenRsp (UID in bottom right corner).

EDIT: The client may not even get to PlayerTokenRsp, a previous attempt of mine had already logged into an instance before connecting, so the UID persisted.

Can't Create Account

CentOS 7.9 jdk8u202 Mongodb 4.4.14-rc0
I think server already started normally

[root@YSServer GenshinImpact]# java -jar grasscutter.jar
[10:59:14] [INFO] Starting Grasscutter...
[10:59:14] [INFO] Loaded 300 AvatarTalentDatas.
[10:59:14] [INFO] Loaded 400 AvatarSkillDatas.
[10:59:14] [INFO] Loaded 3794 FetterDatas.
[10:59:14] [INFO] Loaded 73 AvatarSkillDepotDatas.
[10:59:14] [INFO] Loaded 167 MonsterDescribeDatas.
[10:59:14] [INFO] Loaded 1 AvatarCostumeDatas.
[10:59:14] [INFO] Loaded 3032 NpcDatas.
[10:59:14] [INFO] Loaded 66 ReliquaryMainPropDatas.
[10:59:14] [INFO] Loaded 200 MonsterCurveDatas.
[10:59:14] [INFO] Loaded 717 SceneDatas.
[10:59:14] [INFO] Loaded 90 AvatarLevelDatas.
[10:59:14] [INFO] Loaded 6889 ItemDatas.
[10:59:14] [INFO] Loaded 336 AvatarPromoteDatas.
[10:59:14] [INFO] Loaded 335 ReliquaryAffixDatas.
[10:59:14] [INFO] Loaded 90 WeaponLevelDatas.
[10:59:14] [INFO] Loaded 939 WeaponPromoteDatas.
[10:59:14] [INFO] Loaded 9 AvatarFlycloakDatas.
[10:59:14] [INFO] Loaded 6626 GadgetDatas.
[10:59:14] [INFO] Loaded 100 AvatarCurveDatas.
[10:59:14] [INFO] Loaded 42 ReliquarySetDatas.
[10:59:14] [INFO] Loaded 100 WeaponCurveDatas.
[10:59:14] [INFO] Loaded 744 EquipAffixDatas.
[10:59:14] [INFO] Loaded 60 PlayerLevelDatas.
[10:59:14] [INFO] Loaded 101 ReliquaryLevelDatas.
[10:59:14] [INFO] Loaded 2420 ProudSkillDatas.
[10:59:14] [INFO] Loaded 568 MonsterDatas.
[10:59:14] [INFO] Loaded 78 AvatarDatas.
[10:59:15] [INFO] Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms'}
[10:59:15] [INFO] Opened connection [connectionId{localValue:1, serverValue:27}] to localhost:27017
[10:59:15] [INFO] Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=9, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=33997742}
[10:59:15] [INFO] Opened connection [connectionId{localValue:2, serverValue:26}] to localhost:27017
[10:59:15] [INFO] Opened connection [connectionId{localValue:3, serverValue:28}] to localhost:27017
[10:59:16] [INFO] [Dispatch] Dispatch server started on port 443
[10:59:16] [INFO] Registered 86 PacketHandlers
[10:59:16] [INFO] Banners successfully loaded.
[10:59:16] [INFO] Game Server started on port 22102
[11:02:55] [INFO] [Dispatch] Client 192.168.180.9/192.168.180.9:54283 request: query_region_list

and here is my config.json

cat /opt/GenshinImpact/config.json
{
"DatabaseUrl": "mongodb://localhost:27017",
"DatabaseCollection": "grasscutter",
"RESOURCE_FOLDER": "./resources/",
"DATA_FOLDER": "./data/",
"PACKETS_FOLDER": "./packets/",
"DUMPS_FOLDER": "./dumps/",
"KEY_FOLDER": "./keys/",
"RunMode": "HYBRID",
"GameServer": {
"Name": "Test",
"Ip": "0.0.0.0",
"PublicIp": "192.168.208.25",
"Port": 22102,
"DispatchServerDatabaseUrl": "mongodb://localhost:27017",
"DispatchServerDatabaseCollection": "grasscutter",
"LOG_PACKETS": false,
"InventoryLimitWeapon": 2000,
"InventoryLimitRelic": 2000,
"InventoryLimitMaterial": 2000,
"InventoryLimitFurniture": 2000,
"InventoryLimitAll": 30000,
"MaxAvatarsInTeam": 4,
"MaxAvatarsInTeamMultiplayer": 4,
"MaxEntityLimit": 1000,
"WatchGacha": false,
"WelcomeEmotes": [
2007,
1002,
4010
],
"WelcomeMotd": "Welcome to Grasscutter emu",
"Game": {
"ADVENTURE_EXP_RATE": 1.0,
"MORA_RATE": 1.0,
"DOMAIN_DROP_RATE": 1.0
}
},
"DispatchServer": {
"Ip": "0.0.0.0",
"PublicIp": "192.168.208.25",
"Port": 443,
"KeystorePath": "./keystore.p12",
"KeystorePassword": "",
"UseSSL": true,
"AutomaticallyCreateAccounts": true,
"GameServers": []
}

but when I Create Account ,It show a white screen like this

image

I also checked MongoDB , it create a db but no data here

image

image

I tried trued "AutomaticallyCreateAccounts" and login directly and I can't login

image

I think is wired , any idea?

Upgrade to BEYOND Java 8

At the moment Grasscutter is locked to Java 8. (if this isn't true, someone let me know)
The reasons for this are:

  • The MongoDB mapper (at its current version) is not compatible with Java versions beyond 9.
  • The client seems to not be able to connect to the game server

I've already attempted updating the MongoDB wrapper to 16 with success, but the second issue is still applicable.
Worst case scenario: the KCP server will need updating to support newer versions of Java.
Best case scenario: I screwed something up while trying to update.

If anyone wants the updated database wrapper, let me know!

EDIT:

  • Refactor KCP system
  • Refactor dispatch system
    With both of these, Java 8+ should be supported just fine.

Server Error When Logging In

I compiled grasscutter from latest dev branch.
And uses java 16.

org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class emu.grasscutter.game.player.PlayerBirthday.
at org.bson.internal.CodecCache.lambda$getOrThrow$1(CodecCache.java:52)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at org.bson.internal.CodecCache.getOrThrow(CodecCache.java:51)
at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:64)
at org.bson.internal.ChildCodecRegistry.get(ChildCodecRegistry.java:52)
at dev.morphia.mapping.codec.PropertyCodecRegistryImpl$FallbackPropertyCodecProvider.get(PropertyCodecRegistryImpl.java:82)
at dev.morphia.mapping.codec.PropertyCodecRegistryImpl.get(PropertyCodecRegistryImpl.java:58)
at dev.morphia.mapping.codec.pojo.MorphiaCodec.specializePropertyCodecs(MorphiaCodec.java:153)
at dev.morphia.mapping.codec.pojo.MorphiaCodec.(MorphiaCodec.java:64)
at dev.morphia.mapping.codec.MorphiaCodecProvider.get(MorphiaCodecProvider.java:60)
at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:57)
at org.bson.internal.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:39)
at com.mongodb.internal.operation.Operations.createFindOperation(Operations.java:163)
at com.mongodb.internal.operation.Operations.find(Operations.java:153)
at com.mongodb.internal.operation.SyncOperations.find(SyncOperations.java:93)
at com.mongodb.client.internal.FindIterableImpl.asReadOperation(FindIterableImpl.java:236)
at com.mongodb.client.internal.FindIterableImpl.asReadOperation(FindIterableImpl.java:40)
at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:135)
at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:92)
at dev.morphia.query.MorphiaQuery.prepareCursor(MorphiaQuery.java:321)
at dev.morphia.query.MorphiaQuery.iterator(MorphiaQuery.java:200)
at dev.morphia.query.MorphiaQuery.first(MorphiaQuery.java:188)
at dev.morphia.query.MorphiaQuery.first(MorphiaQuery.java:183)
at emu.grasscutter.database.DatabaseHelper.checkPlayerExists(DatabaseHelper.java:98)
at emu.grasscutter.server.packet.recv.HandlerGetPlayerTokenReq.handle(HandlerGetPlayerTokenReq.java:40)
at emu.grasscutter.server.game.GameServerPacketHandler.handle(GameServerPacketHandler.java:81)
at emu.grasscutter.server.game.GameSession.onMessage(GameSession.java:234)
at emu.grasscutter.netty.MihoyoKcpChannel.channelRead(MihoyoKcpChannel.java:43)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.jpower.kcp.netty.UkcpServerChannel$UkcpServerUnsafe.read(UkcpServerChannel.java:603)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
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(Thread.java:831)

Unable to login after do gacha

image

image

At the same time, the dispatch account is lost.

It seems that the database has gone wrong. Restarting the server and database server not work.

No exceptions reported on the console.

The replacement verification code page is used to authenticate the account

Replace the verification code with the password input box to authenticate the account

Pop up verification code:
/account/risky/api/check

{"retcode":0,"message":"OK","data":{"id":"","action":"ACTION_GEETEST","geetest":{"challenge":"","gt":"","new_captcha":1,"success":1}}}
Change action to action_ Geetest and new_ Change CAPTCHA to 1

Hijacking verification code:

https://api-na.geetest.com/gettype.php

geetest_********({"status": "success", "data": {"type": "fullpage", "static_servers": ["static.geetest.com/", "dn-staticdown.qbox.me/"], "click": "/static/js/click.3.0.4.js", "pencil": "/static/js/pencil.1.0.3.js", "voice": "/static/js/voice.1.2.0.js", "fullpage": "/static/js/fullpage.9.0.9.js", "beeline": "/static/js/beeline.1.0.1.js", "slide": "/static/js/slide.7.8.6.js", "geetest": "/static/js/geetest.6.0.9.js", "aspect_radio": {"slide": 103, "click": 128, "voice": 128, "pencil": 128, "beeline": 50}}})

Modify the content of the request and replace the JS address in it

I think we can hijack the verification code page through the above methods and change the verification code page to the password input box to provide account authentication

Unterminated object at line 22442 column 76 path $

when i use:"java -jar grasscutter.jar -handbook" the cmd allways said:

Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 22442 column 76 path $.
at com.google.gson.Gson.fromJson(Gson.java:947)
at com.google.gson.Gson.fromJson(Gson.java:897)
at emu.grasscutter.tools.Tools.createGmHandbook(Tools.java:34)
at emu.grasscutter.Grasscutter.main(Grasscutter.java:62)
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 22442 column 76 path $.
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1562)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:490)
at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:413)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:184)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
at com.google.gson.Gson.fromJson(Gson.java:932)
... 3 more

i dont know why. and if i ignore this ,just run:"java -jar grasscutter.jar" thats ok ,the server can run successfully.

bug when i join the game ,the registration interface is blank (the cmd can show :some one try login,and the database is empty)
maybe there's something wrong,can someone help me?thanks~

Handbook utility generate null for all non-EN monster

If you change TextMap/TextMapEN.json to another langauge, say, TextMap/TextMapCHS.json, the monster part will always generate a null part.

Example (using TextMapCHS.json)

// Monsters
20010101 : null
20010201 : null
20010202 : null
20010301 : null
20010302 : null
20010401 : null
20010402 : null
...

Compared to the original TextMapEN.json one:

// Monsters
20010101 : Dendro Slime
20010201 : Large Dendro Slime
20010202 : 
20010301 : Anemo Slime
20010302 : Anemo Slime (Mechanicus)
20010401 : Large Anemo Slime
20010402 : Large Anemo Slime (Mechanicus)
20010403 : 
20010501 : Electro Slime
20010502 : Electro Slime (Mechanicus)
20010601 : Large Electro Slime
20010602 : Large Electro Slime (Mechanicus)
20010604 : 

.jar file not communicating with MongoDB server

Steps taken during startup process:
MongoDB service started from cmd
MongoDBCompass opened to verify server status, successfully connected to localhost:27017 (picture attached to verify connection)
Attempted to run grasscutter.jar (pre-packaged version), received error message below

Persists after disabling windows firewall, allowing MongoDB to connect to all local ports, and running the cmd as admin; Windows 11 OS with MongoDB 5.0.7 and JDK 8.0

image
image

Exception when restart server

Restarting (stop & start) the server when the player is online will bring up spam

java.io.IOException: Conv inconsistency
        at io.jpower.kcp.netty.Ukcp.input(Ukcp.java:147)
        at io.jpower.kcp.netty.UkcpServerChildChannel.kcpInput(UkcpServerChildChannel.java:201)
        at io.jpower.kcp.netty.UkcpServerChannel$UkcpServerUnsafe.read(UkcpServerChannel.java:591)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)

Attempting to run GC on Linux doesn't work

This is because GC is hardcoded to use the file separator \ (how it is on Windows).
UNIX-based operating systems use / as the file seperator.
Example: File folder = new File(Grasscutter.getConfig().RESOURCE_FOLDER + "BinOutput\\Avatar\\");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.