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
fa9d703d
Commit
fa9d703d
authored
Apr 27, 2022
by
BaiSugar
Committed by
GitHub
Apr 27, 2022
Browse files
Merge branch 'Grasscutters:development' into development
parents
6a5d97a3
d1fc8c1f
Changes
279
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketTakePlayerLevelRewardRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.TakePlayerLevelRewardRspOuterClass.TakePlayerLevelRewardRsp
;
public
class
PacketTakePlayerLevelRewardRsp
extends
Genshin
Packet
{
public
class
PacketTakePlayerLevelRewardRsp
extends
Base
Packet
{
public
PacketTakePlayerLevelRewardRsp
(
int
level
,
int
rewardId
)
{
super
(
PacketOpcodes
.
TakePlayerLevelRewardRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketTakeoffEquipRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.TakeoffEquipRspOuterClass.TakeoffEquipRsp
;
public
class
PacketTakeoffEquipRsp
extends
Genshin
Packet
{
public
class
PacketTakeoffEquipRsp
extends
Base
Packet
{
public
PacketTakeoffEquipRsp
(
long
avatarGuid
,
int
slot
)
{
super
(
PacketOpcodes
.
TakeoffEquipRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketTowerAllDataRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.TowerAllDataRspOuterClass.TowerAllDataRsp
;
import
emu.grasscutter.net.proto.TowerCurLevelRecordOuterClass.TowerCurLevelRecord
;
import
emu.grasscutter.net.proto.TowerFloorRecordOuterClass.TowerFloorRecord
;
public
class
PacketTowerAllDataRsp
extends
Genshin
Packet
{
public
class
PacketTowerAllDataRsp
extends
Base
Packet
{
public
PacketTowerAllDataRsp
()
{
super
(
PacketOpcodes
.
TowerAllDataRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketUnlockAvatarTalentRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.UnlockAvatarTalentRspOuterClass.UnlockAvatarTalentRsp
;
public
class
PacketUnlockAvatarTalentRsp
extends
Genshin
Packet
{
public
class
PacketUnlockAvatarTalentRsp
extends
Base
Packet
{
public
PacketUnlockAvatarTalentRsp
(
Genshin
Avatar
avatar
,
int
talentId
)
{
public
PacketUnlockAvatarTalentRsp
(
Avatar
avatar
,
int
talentId
)
{
super
(
PacketOpcodes
.
UnlockAvatarTalentRsp
);
UnlockAvatarTalentRsp
proto
=
UnlockAvatarTalentRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketUnlockNameCardNotify.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.UnlockNameCardNotifyOuterClass.UnlockNameCardNotify
;
public
class
PacketUnlockNameCardNotify
extends
Genshin
Packet
{
public
class
PacketUnlockNameCardNotify
extends
Base
Packet
{
public
PacketUnlockNameCardNotify
(
int
nameCard
)
{
super
(
PacketOpcodes
.
UnlockNameCardNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketUseItemRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.UseItemRspOuterClass.UseItemRsp
;
public
class
PacketUseItemRsp
extends
Genshin
Packet
{
public
class
PacketUseItemRsp
extends
Base
Packet
{
public
PacketUseItemRsp
(
long
targetGuid
,
G
enshin
Item
useItem
)
{
public
PacketUseItemRsp
(
long
targetGuid
,
G
ame
Item
useItem
)
{
super
(
PacketOpcodes
.
UseItemRsp
);
UseItemRsp
proto
=
UseItemRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWeaponAwakenRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WeaponAwakenRspOuterClass.WeaponAwakenRsp
;
public
class
PacketWeaponAwakenRsp
extends
Genshin
Packet
{
public
class
PacketWeaponAwakenRsp
extends
Base
Packet
{
public
PacketWeaponAwakenRsp
(
Genshin
Avatar
avatar
,
G
enshin
Item
item
,
G
enshin
Item
feedWeapon
,
int
oldRefineLevel
)
{
public
PacketWeaponAwakenRsp
(
Avatar
avatar
,
G
ame
Item
item
,
G
ame
Item
feedWeapon
,
int
oldRefineLevel
)
{
super
(
PacketOpcodes
.
WeaponAwakenRsp
);
WeaponAwakenRsp
.
Builder
proto
=
WeaponAwakenRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWeaponPromoteRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WeaponPromoteRspOuterClass.WeaponPromoteRsp
;
public
class
PacketWeaponPromoteRsp
extends
Genshin
Packet
{
public
class
PacketWeaponPromoteRsp
extends
Base
Packet
{
public
PacketWeaponPromoteRsp
(
G
enshin
Item
item
,
int
oldPromoteLevel
)
{
public
PacketWeaponPromoteRsp
(
G
ame
Item
item
,
int
oldPromoteLevel
)
{
super
(
PacketOpcodes
.
WeaponPromoteRsp
);
WeaponPromoteRsp
proto
=
WeaponPromoteRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWeaponUpgradeRsp.java
View file @
fa9d703d
...
...
@@ -2,15 +2,15 @@ package emu.grasscutter.server.packet.send;
import
java.util.List
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam
;
import
emu.grasscutter.net.proto.WeaponUpgradeRspOuterClass.WeaponUpgradeRsp
;
public
class
PacketWeaponUpgradeRsp
extends
Genshin
Packet
{
public
class
PacketWeaponUpgradeRsp
extends
Base
Packet
{
public
PacketWeaponUpgradeRsp
(
G
enshin
Item
item
,
int
oldLevel
,
List
<
ItemParam
>
leftoverOres
)
{
public
PacketWeaponUpgradeRsp
(
G
ame
Item
item
,
int
oldLevel
,
List
<
ItemParam
>
leftoverOres
)
{
super
(
PacketOpcodes
.
WeaponUpgradeRsp
);
WeaponUpgradeRsp
proto
=
WeaponUpgradeRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWearEquipRsp.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WearEquipRspOuterClass.WearEquipRsp
;
public
class
PacketWearEquipRsp
extends
Genshin
Packet
{
public
class
PacketWearEquipRsp
extends
Base
Packet
{
public
PacketWearEquipRsp
(
long
avatarGuid
,
long
equipGuid
)
{
super
(
PacketOpcodes
.
WearEquipRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldDataNotify.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PropValueOuterClass.PropValue
;
import
emu.grasscutter.net.proto.WorldDataNotifyOuterClass.WorldDataNotify
;
public
class
PacketWorldDataNotify
extends
Genshin
Packet
{
public
class
PacketWorldDataNotify
extends
Base
Packet
{
public
PacketWorldDataNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldDataNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerDieNotify.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType
;
import
emu.grasscutter.net.proto.WorldPlayerDieNotifyOuterClass.WorldPlayerDieNotify
;
public
class
PacketWorldPlayerDieNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerDieNotify
extends
Base
Packet
{
public
PacketWorldPlayerDieNotify
(
PlayerDieType
playerDieType
,
int
killerId
)
{
super
(
PacketOpcodes
.
WorldPlayerDieNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerInfoNotify.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify
;
public
class
PacketWorldPlayerInfoNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerInfoNotify
extends
Base
Packet
{
public
PacketWorldPlayerInfoNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldPlayerInfoNotify
);
...
...
@@ -14,7 +14,7 @@ public class PacketWorldPlayerInfoNotify extends GenshinPacket {
WorldPlayerInfoNotify
.
Builder
proto
=
WorldPlayerInfoNotify
.
newBuilder
();
for
(
int
i
=
0
;
i
<
world
.
getPlayers
().
size
();
i
++)
{
Genshin
Player
p
=
world
.
getPlayers
().
get
(
i
);
Player
p
=
world
.
getPlayers
().
get
(
i
);
proto
.
addPlayerInfoList
(
p
.
getOnlinePlayerInfo
());
proto
.
addPlayerUidList
(
p
.
getUid
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerLocationNotify.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorldPlayerLocationNotifyOuterClass.WorldPlayerLocationNotify
;
public
class
PacketWorldPlayerLocationNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerLocationNotify
extends
Base
Packet
{
public
PacketWorldPlayerLocationNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldPlayerLocationNotify
);
WorldPlayerLocationNotify
.
Builder
proto
=
WorldPlayerLocationNotify
.
newBuilder
();
for
(
Genshin
Player
p
:
world
.
getPlayers
())
{
for
(
Player
p
:
world
.
getPlayers
())
{
proto
.
addPlayerWorldLocList
(
p
.
getWorldPlayerLocationInfo
());
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerRTTNotify.java
View file @
fa9d703d
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerRTTInfoOuterClass.PlayerRTTInfo
;
import
emu.grasscutter.net.proto.WorldPlayerRTTNotifyOuterClass.WorldPlayerRTTNotify
;
public
class
PacketWorldPlayerRTTNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerRTTNotify
extends
Base
Packet
{
public
PacketWorldPlayerRTTNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldPlayerRTTNotify
);
WorldPlayerRTTNotify
.
Builder
proto
=
WorldPlayerRTTNotify
.
newBuilder
();
for
(
Genshin
Player
player
:
world
.
getPlayers
())
{
for
(
Player
player
:
world
.
getPlayers
())
{
proto
.
addPlayerRttList
(
PlayerRTTInfo
.
newBuilder
()
.
setUid
(
player
.
getUid
())
...
...
src/main/java/emu/grasscutter/task/TaskMap.java
View file @
fa9d703d
...
...
@@ -2,7 +2,7 @@ package emu.grasscutter.task;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.Account
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
org.quartz.CronScheduleBuilder
;
import
org.quartz.CronTrigger
;
...
...
src/main/java/emu/grasscutter/task/tasks/MoonCard.java
View file @
fa9d703d
package
emu.grasscutter.task.tasks
;
import
emu.grasscutter.database.DatabaseManager
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.task.Task
;
import
emu.grasscutter.task.TaskHandler
;
...
...
@@ -15,8 +15,8 @@ import org.quartz.JobExecutionException;
public
final
class
MoonCard
implements
TaskHandler
{
@Override
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
{
List
<
Genshin
Player
>
players
=
DatabaseManager
.
getDatastore
().
find
(
Genshin
Player
.
class
).
stream
().
toList
();
for
(
Genshin
Player
player
:
players
)
{
List
<
Player
>
players
=
DatabaseManager
.
getDatastore
().
find
(
Player
.
class
).
stream
().
toList
();
for
(
Player
player
:
players
)
{
if
(
player
.
isOnline
())
{
if
(
player
.
inMoonCard
())
{
player
.
getTodayMoonCard
();
...
...
src/main/java/emu/grasscutter/tools/Tools.java
View file @
fa9d703d
...
...
@@ -18,9 +18,9 @@ import java.util.stream.Collectors;
import
com.google.gson.reflect.TypeToken
;
import
emu.grasscutter.G
enshin
Constants
;
import
emu.grasscutter.G
ame
Constants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.data.G
enshin
Data
;
import
emu.grasscutter.data.G
ame
Data
;
import
emu.grasscutter.data.ResourceLoader
;
import
emu.grasscutter.data.def.AvatarData
;
import
emu.grasscutter.data.def.ItemData
;
...
...
@@ -45,48 +45,48 @@ public final class Tools {
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd HH:mm:ss"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
writer
.
println
(
"// G
enshin Impact "
+
Genshin
Constants
.
VERSION
+
" GM Handbook"
);
writer
.
println
(
"// G
rasscutter "
+
Game
Constants
.
VERSION
+
" GM Handbook"
);
writer
.
println
(
"// Created "
+
dtf
.
format
(
now
)
+
System
.
lineSeparator
()
+
System
.
lineSeparator
());
list
=
new
ArrayList
<>(
G
enshin
Data
.
getAvatarDataMap
().
keySet
());
list
=
new
ArrayList
<>(
G
ame
Data
.
getAvatarDataMap
().
keySet
());
Collections
.
sort
(
list
);
writer
.
println
(
"// Avatars"
);
for
(
Integer
id
:
list
)
{
AvatarData
data
=
G
enshin
Data
.
getAvatarDataMap
().
get
(
id
);
AvatarData
data
=
G
ame
Data
.
getAvatarDataMap
().
get
(
id
);
writer
.
println
(
data
.
getId
()
+
" : "
+
map
.
get
(
data
.
getNameTextMapHash
()));
}
writer
.
println
();
list
=
new
ArrayList
<>(
G
enshin
Data
.
getItemDataMap
().
keySet
());
list
=
new
ArrayList
<>(
G
ame
Data
.
getItemDataMap
().
keySet
());
Collections
.
sort
(
list
);
writer
.
println
(
"// Items"
);
for
(
Integer
id
:
list
)
{
ItemData
data
=
G
enshin
Data
.
getItemDataMap
().
get
(
id
);
ItemData
data
=
G
ame
Data
.
getItemDataMap
().
get
(
id
);
writer
.
println
(
data
.
getId
()
+
" : "
+
map
.
get
(
data
.
getNameTextMapHash
()));
}
writer
.
println
();
writer
.
println
(
"// Scenes"
);
list
=
new
ArrayList
<>(
G
enshin
Data
.
getSceneDataMap
().
keySet
());
list
=
new
ArrayList
<>(
G
ame
Data
.
getSceneDataMap
().
keySet
());
Collections
.
sort
(
list
);
for
(
Integer
id
:
list
)
{
SceneData
data
=
G
enshin
Data
.
getSceneDataMap
().
get
(
id
);
SceneData
data
=
G
ame
Data
.
getSceneDataMap
().
get
(
id
);
writer
.
println
(
data
.
getId
()
+
" : "
+
data
.
getScriptData
());
}
writer
.
println
();
writer
.
println
(
"// Monsters"
);
list
=
new
ArrayList
<>(
G
enshin
Data
.
getMonsterDataMap
().
keySet
());
list
=
new
ArrayList
<>(
G
ame
Data
.
getMonsterDataMap
().
keySet
());
Collections
.
sort
(
list
);
for
(
Integer
id
:
list
)
{
MonsterData
data
=
G
enshin
Data
.
getMonsterDataMap
().
get
(
id
);
MonsterData
data
=
G
ame
Data
.
getMonsterDataMap
().
get
(
id
);
writer
.
println
(
data
.
getId
()
+
" : "
+
map
.
get
(
data
.
getNameTextMapHash
()));
}
}
...
...
src/main/java/emu/grasscutter/utils/Utils.java
View file @
fa9d703d
...
...
@@ -174,11 +174,11 @@ public final class Utils {
// Check for resources folder.
if
(!
fileExists
(
resourcesFolder
))
{
logger
.
info
(
"Creating resources folder..."
);
logger
.
info
(
"Place a copy of '
GenshinData
' in the resources folder."
);
logger
.
info
(
"Place a copy of '
BinOutput' and 'ExcelBinOutput
' in the resources folder."
);
createFolder
(
resourcesFolder
);
exit
=
true
;
}
// Check for
GenshinData
.
// Check for
BinOutput + ExcelBinOuput
.
if
(!
fileExists
(
resourcesFolder
+
"BinOutput"
)
||
!
fileExists
(
resourcesFolder
+
"ExcelBinOutput"
))
{
logger
.
info
(
"Place a copy of 'BinOutput' and 'ExcelBinOutput' in the resources folder."
);
...
...
Prev
1
…
10
11
12
13
14
Next
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