Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
71cdd2c8
Commit
71cdd2c8
authored
Apr 19, 2022
by
Magix
Committed by
GitHub
Apr 19, 2022
Browse files
Merge branch 'main' into main
parents
f54cfc6c
14da6c47
Changes
10
Hide whitespace changes
Inline
Side-by-side
.gitmodules
0 → 100644
View file @
71cdd2c8
[submodule "Grasscutter-Protos"]
path = Grasscutter-Protos
url = https://github.com/Melledy/Grasscutter-Protos
Grasscutter-Protos
@
0537e9cc
Subproject commit 0537e9cc4c7856a7c6f88bbbaa908a80c4ee677e
data/Banners.json
View file @
71cdd2c8
...
...
@@ -17,39 +17,24 @@
"gachaType"
:
301
,
"scheduleId"
:
903
,
"bannerType"
:
"EVENT"
,
"prefabPath"
:
"GachaShowPanel_A07
6
"
,
"previewPrefabPath"
:
"UI_Tab_GachaShowPanel_A07
6
"
,
"titlePath"
:
"UI_GACHA_SHOW_PANEL_A07
6
_TITLE"
,
"prefabPath"
:
"GachaShowPanel_A07
9
"
,
"previewPrefabPath"
:
"UI_Tab_GachaShowPanel_A07
9
"
,
"titlePath"
:
"UI_GACHA_SHOW_PANEL_A07
9
_TITLE"
,
"costItem"
:
223
,
"beginTime"
:
0
,
"endTime"
:
1924992000
,
"sortId"
:
9998
,
"maxItemType"
:
1
,
"rateUpItems1"
:
[
1066
],
"rateUpItems2"
:
[
1023
,
1043
,
1064
]
},
{
"gachaType"
:
400
,
"scheduleId"
:
913
,
"bannerType"
:
"EVENT"
,
"prefabPath"
:
"GachaShowPanel_A077"
,
"previewPrefabPath"
:
"UI_Tab_GachaShowPanel_A077"
,
"titlePath"
:
"UI_Tab_GachaShowPanel_A077"
,
"costItem"
:
223
,
"beginTime"
:
0
,
"endTime"
:
1924992000
,
"sortId"
:
9998
,
"maxItemType"
:
1
,
"rateUpItems1"
:
[
1022
],
"rateUpItems2"
:
[
1023
,
1043
,
1064
]
"rateUpItems1"
:
[
1002
],
"rateUpItems2"
:
[
1053
,
1020
,
1045
]
},
{
"gachaType"
:
302
,
"scheduleId"
:
9
2
3
,
"scheduleId"
:
9
1
3
,
"bannerType"
:
"WEAPON"
,
"prefabPath"
:
"GachaShowPanel_A0
7
8"
,
"previewPrefabPath"
:
"UI_Tab_GachaShowPanel_A0
7
8"
,
"titlePath"
:
"UI_GACHA_SHOW_PANEL_A0
7
8_TITLE"
,
"prefabPath"
:
"GachaShowPanel_A08
0
"
,
"previewPrefabPath"
:
"UI_Tab_GachaShowPanel_A08
0
"
,
"titlePath"
:
"UI_GACHA_SHOW_PANEL_A08
0
_TITLE"
,
"costItem"
:
223
,
"beginTime"
:
0
,
"endTime"
:
1924992000
,
...
...
@@ -58,7 +43,7 @@
"eventChance"
:
75
,
"softPity"
:
80
,
"hardPity"
:
80
,
"rateUpItems1"
:
[
115
1
0
,
1
5
50
3
],
"rateUpItems2"
:
[
1140
2
,
1240
3
,
1340
1
,
1440
2
,
1540
5
]
"rateUpItems1"
:
[
1150
9
,
1
2
50
4
],
"rateUpItems2"
:
[
1140
1
,
1240
2
,
1340
7
,
1440
1
,
1540
1
]
}
]
\ No newline at end of file
]
proxy.py
View file @
71cdd2c8
...
...
@@ -20,7 +20,7 @@
#
##
from
mitmproxy
import
ctx
,
http
from
mitmproxy
import
http
class
MlgmXyysd_Genshin_Impact_Proxy
:
...
...
@@ -53,16 +53,13 @@ class MlgmXyysd_Genshin_Impact_Proxy:
"hk4e-sdk-os-static.hoyoverse.com"
,
"sdk-os-static.hoyoverse.com"
,
"api-account-os.hoyoverse.com"
,
"hk4e-sdk-os.hoyoverse.com"
"hk4e-sdk-os.hoyoverse.com"
,
"overseauspider.yuanshen.com"
]
if
flow
.
request
.
url
.
startswith
(
"http://overseauspider.yuanshen.com:8888/log"
):
ctx
.
log
.
info
(
"Block overseauspider.yuanshen.com"
)
flow
.
response
=
http
.
HTTPResponse
.
make
(
404
)
elif
flow
.
request
.
host
in
LIST_DOMAINS
:
ctx
.
log
.
info
(
"Redirect "
+
flow
.
request
.
host
)
if
flow
.
request
.
host
in
LIST_DOMAINS
:
flow
.
request
.
host
=
REMOTE_HOST
addons
=
[
MlgmXyysd_Genshin_Impact_Proxy
()
]
\ No newline at end of file
]
run.bat
deleted
100644 → 0
View file @
f54cfc6c
@echo
off
::This will not work if your java is in a different location, plugin as necessary
::this just saves you from changing your PATH
"C:\Program Files\Java\jdk1.8.0_202\bin\java.exe"
-jar
./grasscutter.jar
\ No newline at end of file
src/main/java/emu/grasscutter/commands/PlayerCommands.java
View file @
71cdd2c8
...
...
@@ -189,35 +189,26 @@ public final class PlayerCommands {
description
=
"Gives the player a specified character"
,
permission
=
"player.givechar"
)
public
static
class
GiveCharCommand
implements
CommandHandler
{
@Override
public
void
execute
(
GenshinPlayer
player
,
List
<
String
>
args
)
{
int
target
,
avatarI
D
,
level
=
1
,
ascension
=
1
;
int
target
,
avatarI
d
,
level
=
1
,
ascension
=
1
;
if
(
args
.
size
()
<
2
)
{
CommandHandler
.
sendMessage
(
null
,
"Usage: givechar <player> <avatarId> [level]"
);
if
(
args
.
size
()
<
1
)
{
CommandHandler
.
sendMessage
(
player
,
"Usage: givechar <player> <avatarId> [level]"
);
return
;
}
switch
(
args
.
size
())
{
default
:
CommandHandler
.
sendMessage
(
null
,
"Usage: givechar <player> <avatarId> [level]"
);
CommandHandler
.
sendMessage
(
player
,
"Usage: givechar <player> <avatarId> [level]"
);
return
;
case
1
:
try
{
avatarID
=
Integer
.
parseInt
(
args
.
get
(
0
));
target
=
player
.
getAccount
().
getPlayerId
();
}
catch
(
NumberFormatException
ignored
)
{
// TODO: Parse from avatar name using GM Handbook.
CommandHandler
.
sendMessage
(
player
,
"Invalid avatar id."
);
return
;
}
break
;
case
2
:
try
{
target
=
Integer
.
parseInt
(
args
.
get
(
0
));
if
(
Grasscutter
.
getGameServer
().
getPlayerByUid
(
target
)
==
null
)
{
target
=
player
.
getUid
();
level
=
Integer
.
parseInt
(
args
.
get
(
1
));
avatarID
=
Integer
.
parseInt
(
args
.
get
(
0
));
target
=
player
.
getUid
();
level
=
Integer
.
parseInt
(
args
.
get
(
1
));
avatarId
=
Integer
.
parseInt
(
args
.
get
(
0
));
}
else
{
avatarI
D
=
Integer
.
parseInt
(
args
.
get
(
1
));
avatarI
d
=
Integer
.
parseInt
(
args
.
get
(
1
));
}
}
catch
(
NumberFormatException
ignored
)
{
// TODO: Parse from avatar name using GM Handbook.
...
...
@@ -232,7 +223,7 @@ public final class PlayerCommands {
CommandHandler
.
sendMessage
(
player
,
"Invalid player ID."
);
return
;
}
avatarI
D
=
Integer
.
parseInt
(
args
.
get
(
1
));
avatarI
d
=
Integer
.
parseInt
(
args
.
get
(
1
));
level
=
Integer
.
parseInt
(
args
.
get
(
2
));
}
catch
(
NumberFormatException
ignored
)
{
// TODO: Parse from avatar name using GM Handbook.
...
...
@@ -244,22 +235,22 @@ public final class PlayerCommands {
GenshinPlayer
targetPlayer
=
Grasscutter
.
getGameServer
().
getPlayerByUid
(
target
);
if
(
targetPlayer
==
null
)
{
CommandHandler
.
sendMessage
(
null
,
"Player not found."
);
return
;
CommandHandler
.
sendMessage
(
player
,
"Player not found."
);
return
;
}
AvatarData
avatarData
=
GenshinData
.
getAvatarDataMap
().
get
(
avatarI
D
);
AvatarData
avatarData
=
GenshinData
.
getAvatarDataMap
().
get
(
avatarI
d
);
if
(
avatarData
==
null
)
{
CommandHandler
.
sendMessage
(
null
,
"Invalid avatar id."
);
return
;
CommandHandler
.
sendMessage
(
player
,
"Invalid avatar id."
);
return
;
}
// Calculate ascension level.
if
(
level
<=
40
)
{
ascension
=
(
int
)
Math
.
ceil
(
level
/
20
);
}
else
if
(
level
>
20
)
{
ascension
=
(
int
)
Math
.
ceil
(
level
/
10
)
-
3
;
ascension
=
(
int
)
Math
.
ceil
(
level
/
20
f
);
}
else
{
ascension
=
(
int
)
Math
.
ceil
(
level
/
10
f
)
-
3
;
}
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarI
D
);
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarI
d
);
avatar
.
setLevel
(
level
);
avatar
.
setPromoteLevel
(
ascension
);
...
...
@@ -280,7 +271,7 @@ public final class PlayerCommands {
int
target
=
Integer
.
parseInt
(
args
.
get
(
0
));
int
avatarID
=
Integer
.
parseInt
(
args
.
get
(
1
));
int
level
=
1
;
if
(
args
.
size
()
>
2
)
level
=
Integer
.
parseInt
(
args
.
get
(
2
));
int
ascension
=
1
;
int
ascension
;
GenshinPlayer
targetPlayer
=
Grasscutter
.
getGameServer
().
getPlayerByUid
(
target
);
if
(
targetPlayer
==
null
)
{
...
...
@@ -294,9 +285,9 @@ public final class PlayerCommands {
// Calculate ascension level.
if
(
level
<=
40
)
{
ascension
=
(
int
)
Math
.
ceil
(
level
/
20
);
}
else
if
(
level
>
20
)
{
ascension
=
(
int
)
Math
.
ceil
(
level
/
10
)
-
3
;
ascension
=
(
int
)
Math
.
ceil
(
level
/
20
f
);
}
else
{
ascension
=
(
int
)
Math
.
ceil
(
level
/
10
f
)
-
3
;
}
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarID
);
...
...
@@ -465,7 +456,7 @@ public final class PlayerCommands {
@Override
public
void
execute
(
GenshinPlayer
player
,
List
<
String
>
args
)
{
if
(
args
.
size
()
<
1
)
{
CommandHandler
.
sendMessage
(
null
,
"Usage: setworldlevel <level>"
);
return
;
CommandHandler
.
sendMessage
(
player
,
"Usage: setworldlevel <level>"
);
return
;
}
try
{
...
...
@@ -503,21 +494,18 @@ public final class PlayerCommands {
@Override
public
void
execute
(
GenshinPlayer
player
,
List
<
String
>
args
)
{
if
(
args
.
size
()
<
1
)
{
CommandHandler
.
sendMessage
(
null
,
"Usage: changescene <scene id>"
);
return
;
CommandHandler
.
sendMessage
(
player
,
"Usage: changescene <scene id>"
);
return
;
}
int
sceneId
=
0
;
try
{
sceneId
=
Integer
.
parseInt
(
args
.
get
(
0
));
int
sceneId
=
Integer
.
parseInt
(
args
.
get
(
0
));
boolean
result
=
player
.
getWorld
().
transferPlayerToScene
(
player
,
sceneId
,
player
.
getPos
());
if
(!
result
)
{
CommandHandler
.
sendMessage
(
null
,
"Scene does not exist or you are already in it"
);
}
}
catch
(
Exception
e
)
{
return
;
}
boolean
result
=
player
.
getWorld
().
transferPlayerToScene
(
player
,
sceneId
,
player
.
getPos
());
if
(!
result
)
{
CommandHandler
.
sendMessage
(
null
,
"Scene does not exist or you are already in it"
);
CommandHandler
.
sendMessage
(
player
,
"Usage: changescene <scene id>"
);
return
;
}
}
}
...
...
src/main/java/emu/grasscutter/data/ResourceLoader.java
View file @
71cdd2c8
...
...
@@ -197,7 +197,7 @@ public class ResourceLoader {
}
else
{
Map
<
String
,
OpenConfigEntry
>
map
=
new
TreeMap
<>();
java
.
lang
.
reflect
.
Type
type
=
new
TypeToken
<
Map
<
String
,
OpenConfigData
[]>>()
{}.
getType
();
String
[]
folderNames
=
{
"BinOutput
\\
Talent
\\
EquipTalents
\\
"
,
"BinOutput
\\
Talent
\\
AvatarTalents
\\
"
};
String
[]
folderNames
=
{
"BinOutput
/
Talent
/
EquipTalents
/
"
,
"BinOutput
/
Talent
/
AvatarTalents
/
"
};
for
(
String
name
:
folderNames
)
{
File
folder
=
new
File
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
name
));
...
...
src/main/java/emu/grasscutter/game/managers/InventoryManager.java
View file @
71cdd2c8
...
...
@@ -471,7 +471,7 @@ public class InventoryManager {
}
// Consume weapon
player
.
getInventory
().
removeItem
(
feed
);
player
.
getInventory
().
removeItem
(
feed
,
1
);
// Get
weapon
.
setRefinement
(
targetRefineLevel
);
...
...
@@ -804,6 +804,12 @@ public class InventoryManager {
// Get talent
int
currentTalentLevel
=
avatar
.
getCoreProudSkillLevel
();
int
nextTalentId
=
((
avatar
.
getAvatarId
()
%
10000000
)
*
10
)
+
currentTalentLevel
+
1
;
if
(
avatar
.
getAvatarId
()
==
10000006
)
{
// Lisa is special in that her talentId starts with 4 instead of 6.
nextTalentId
=
40
+
currentTalentLevel
+
1
;
}
AvatarTalentData
talentData
=
GenshinData
.
getAvatarTalentDataMap
().
get
(
nextTalentId
);
if
(
talentData
==
null
)
{
...
...
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
71cdd2c8
...
...
@@ -389,6 +389,10 @@ public final class DispatchServer {
"/sdk/upload"
,
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
);
server
.
createContext
(
// /perf/config/verify?device_id=xxx&platform=x&name=xxx
"/perf/config/verify"
,
new
DispatchHttpJsonHandler
(
"{\"code\":0}"
)
);
// Start server
server
.
start
();
Grasscutter
.
getLogger
().
info
(
"Dispatch server started on port "
+
getAddress
().
getPort
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java
View file @
71cdd2c8
...
...
@@ -59,6 +59,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.
setEnterReason
(
reason
.
getValue
())
.
addSceneTagIdList
(
102
)
.
addSceneTagIdList
(
107
)
.
addSceneTagIdList
(
109
)
.
addSceneTagIdList
(
113
)
.
addSceneTagIdList
(
117
)
.
setUnk1
(
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment