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
591ca480
Commit
591ca480
authored
Jul 13, 2022
by
AnimeGitB
Committed by
Luke H-W
Jul 17, 2022
Browse files
Some proto name changes
parent
bc2c5deb
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameActivityHandler.java
View file @
591ca480
...
@@ -29,13 +29,12 @@ public class MusicGameActivityHandler extends ActivityHandler {
...
@@ -29,13 +29,12 @@ public class MusicGameActivityHandler extends ActivityHandler {
.
putAllMusicGameRecordMap
(
.
putAllMusicGameRecordMap
(
musicGamePlayerData
.
getMusicGameRecord
().
values
().
stream
()
musicGamePlayerData
.
getMusicGameRecord
().
values
().
stream
()
.
collect
(
Collectors
.
toMap
(
MusicGamePlayerData
.
MusicGameRecord
::
getMusicId
,
MusicGamePlayerData
.
MusicGameRecord
::
toProto
)))
.
collect
(
Collectors
.
toMap
(
MusicGamePlayerData
.
MusicGameRecord
::
getMusicId
,
MusicGamePlayerData
.
MusicGameRecord
::
toProto
)))
.
addAllPersonCustomBeatmap
(
musicGamePlayerData
.
getPersonalCustomBeatmapRecord
().
values
().
stream
()
.
addAllPersonCustomBeatmap
(
musicGamePlayerData
.
getPersonalCustomBeatmapRecord
().
values
().
stream
()
.
map
(
MusicGamePlayerData
.
CustomBeatmapRecord
::
toPersonalBriefProto
)
.
map
(
MusicGamePlayerData
.
CustomBeatmapRecord
::
toPersonalBriefProto
)
.
map
(
MusicBriefInfoOuterClass
.
MusicBriefInfo
.
Builder
::
build
)
.
map
(
MusicBriefInfoOuterClass
.
MusicBriefInfo
.
Builder
::
build
)
.
toList
())
.
toList
())
.
addAll
P
ers
on
CustomBeatmap
(
musicGamePlayerData
.
getOthersCustomBeatmapRecord
().
values
().
stream
()
.
addAll
Oth
ersCustomBeatmap
(
musicGamePlayerData
.
getOthersCustomBeatmapRecord
().
values
().
stream
()
.
map
(
MusicGamePlayerData
.
CustomBeatmapRecord
::
toOthersBriefProto
)
.
map
(
MusicGamePlayerData
.
CustomBeatmapRecord
::
toOthersBriefProto
)
.
map
(
MusicBriefInfoOuterClass
.
MusicBriefInfo
.
Builder
::
build
)
.
map
(
MusicBriefInfoOuterClass
.
MusicBriefInfo
.
Builder
::
build
)
.
toList
())
.
toList
())
...
...
src/main/java/emu/grasscutter/game/activity/musicgame/MusicGamePlayerData.java
View file @
591ca480
...
@@ -71,8 +71,7 @@ public class MusicGamePlayerData {
...
@@ -71,8 +71,7 @@ public class MusicGamePlayerData {
.
setMaxScore
(
musicGameBeatmap
.
getMaxScore
())
.
setMaxScore
(
musicGameBeatmap
.
getMaxScore
())
.
setPosition
(
musicGameBeatmap
.
getSavePosition
())
.
setPosition
(
musicGameBeatmap
.
getSavePosition
())
.
setMusicNoteCount
(
musicGameBeatmap
.
getMusicNoteCount
())
.
setMusicNoteCount
(
musicGameBeatmap
.
getMusicNoteCount
())
.
setMusicShareId
(
musicShareId
)
.
setMusicShareId
(
musicShareId
);
;
}
}
public
MusicBriefInfoOuterClass
.
MusicBriefInfo
.
Builder
toOthersBriefProto
(){
public
MusicBriefInfoOuterClass
.
MusicBriefInfo
.
Builder
toOthersBriefProto
(){
...
...
src/main/java/emu/grasscutter/game/entity/EntityAvatar.java
View file @
591ca480
...
@@ -125,7 +125,7 @@ public class EntityAvatar extends GameEntity {
...
@@ -125,7 +125,7 @@ public class EntityAvatar extends GameEntity {
if
(
healed
>
0
f
)
{
if
(
healed
>
0
f
)
{
getScene
().
broadcastPacket
(
getScene
().
broadcastPacket
(
new
PacketEntityFightPropChangeReasonNotify
(
this
,
FightProperty
.
FIGHT_PROP_CUR_HP
,
healed
,
PropChangeReason
.
PROP_CHANGE_REASON_ABILITY
,
ChangeHpReason
.
CHANGE_HP_REASON_
CHANGE_HP_
ADD_ABILITY
)
new
PacketEntityFightPropChangeReasonNotify
(
this
,
FightProperty
.
FIGHT_PROP_CUR_HP
,
healed
,
PropChangeReason
.
PROP_CHANGE_REASON_ABILITY
,
ChangeHpReason
.
CHANGE_HP_REASON_ADD_ABILITY
)
);
);
}
}
...
...
src/main/java/emu/grasscutter/game/managers/SotSManager.java
View file @
591ca480
...
@@ -158,7 +158,7 @@ public class SotSManager {
...
@@ -158,7 +158,7 @@ public class SotSManager {
player
.
getTeamManager
().
healAvatar
(
entity
.
getAvatar
(),
0
,
needHP
);
player
.
getTeamManager
().
healAvatar
(
entity
.
getAvatar
(),
0
,
needHP
);
player
.
getSession
().
send
(
new
PacketEntityFightPropChangeReasonNotify
(
entity
,
FightProperty
.
FIGHT_PROP_CUR_HP
,
player
.
getSession
().
send
(
new
PacketEntityFightPropChangeReasonNotify
(
entity
,
FightProperty
.
FIGHT_PROP_CUR_HP
,
((
float
)
needHP
/
100
),
List
.
of
(
3
),
PropChangeReason
.
PROP_CHANGE_REASON_STATUE_RECOVER
,
((
float
)
needHP
/
100
),
List
.
of
(
3
),
PropChangeReason
.
PROP_CHANGE_REASON_STATUE_RECOVER
,
ChangeHpReason
.
CHANGE_HP_REASON_
CHANGE_HP_
ADD_STATUE
));
ChangeHpReason
.
CHANGE_HP_REASON_ADD_STATUE
));
player
.
getSession
().
send
(
new
PacketEntityFightPropUpdateNotify
(
entity
,
FightProperty
.
FIGHT_PROP_CUR_HP
));
player
.
getSession
().
send
(
new
PacketEntityFightPropUpdateNotify
(
entity
,
FightProperty
.
FIGHT_PROP_CUR_HP
));
}
}
...
...
src/main/java/emu/grasscutter/game/managers/deforestation/DeforestationManager.java
View file @
591ca480
...
@@ -48,8 +48,8 @@ public class DeforestationManager {
...
@@ -48,8 +48,8 @@ public class DeforestationManager {
public
void
onDeforestationInvoke
(
HitTreeNotifyOuterClass
.
HitTreeNotify
hit
){
public
void
onDeforestationInvoke
(
HitTreeNotifyOuterClass
.
HitTreeNotify
hit
){
synchronized
(
currentRecord
)
{
synchronized
(
currentRecord
)
{
//Grasscutter.getLogger().info("onDeforestationInvoke! Wood records {}", currentRecord);
//Grasscutter.getLogger().info("onDeforestationInvoke! Wood records {}", currentRecord);
VectorOuterClass
.
Vector
hitPosition
=
hit
.
get
HitPostion
();
VectorOuterClass
.
Vector
hitPosition
=
hit
.
get
TreePos
();
int
woodType
=
hit
.
get
Wood
Type
();
int
woodType
=
hit
.
get
Tree
Type
();
if
(
ColliderTypeToWoodItemID
.
containsKey
(
woodType
))
{
// is a available wood type
if
(
ColliderTypeToWoodItemID
.
containsKey
(
woodType
))
{
// is a available wood type
Scene
scene
=
player
.
getScene
();
Scene
scene
=
player
.
getScene
();
int
itemId
=
ColliderTypeToWoodItemID
.
get
(
woodType
);
int
itemId
=
ColliderTypeToWoodItemID
.
get
(
woodType
);
...
...
src/main/java/emu/grasscutter/net/packet/BasePacket.java
View file @
591ca480
...
@@ -84,7 +84,7 @@ public class BasePacket {
...
@@ -84,7 +84,7 @@ public class BasePacket {
if
(
this
.
getHeader
()
!=
null
&&
clientSequence
==
0
)
{
if
(
this
.
getHeader
()
!=
null
&&
clientSequence
==
0
)
{
return
this
;
return
this
;
}
}
setHeader
(
PacketHead
.
newBuilder
().
setClientSequenceId
(
clientSequence
).
set
Timestamp
(
System
.
currentTimeMillis
()).
build
().
toByteArray
());
setHeader
(
PacketHead
.
newBuilder
().
setClientSequenceId
(
clientSequence
).
set
SentMs
(
System
.
currentTimeMillis
()).
build
().
toByteArray
());
return
this
;
return
this
;
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerGetAllMailReq.java
View file @
591ca480
...
@@ -16,6 +16,6 @@ public class HandlerGetAllMailReq extends PacketHandler {
...
@@ -16,6 +16,6 @@ public class HandlerGetAllMailReq extends PacketHandler {
@Override
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
GetAllMailReqOuterClass
.
GetAllMailReq
req
=
GetAllMailReqOuterClass
.
GetAllMailReq
.
parseFrom
(
payload
);
GetAllMailReqOuterClass
.
GetAllMailReq
req
=
GetAllMailReqOuterClass
.
GetAllMailReq
.
parseFrom
(
payload
);
session
.
send
(
new
PacketGetAllMailRsp
(
session
.
getPlayer
(),
req
.
get
ANKKGPJCINB
()));
session
.
send
(
new
PacketGetAllMailRsp
(
session
.
getPlayer
(),
req
.
get
Unk2700OPEHLDAGICF
()));
}
}
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUnknown2Req.java
View file @
591ca480
...
@@ -6,7 +6,7 @@ import emu.grasscutter.net.packet.PacketOpcodes;
...
@@ -6,7 +6,7 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketHomeUnknown2Rsp
;
import
emu.grasscutter.server.packet.send.PacketHomeUnknown2Rsp
;
@Opcodes
(
PacketOpcodes
.
HomeUnknown2
Req
)
@Opcodes
(
PacketOpcodes
.
Unk2700_ACILPONNGGK_Client
Req
)
public
class
HandlerHomeUnknown2Req
extends
PacketHandler
{
public
class
HandlerHomeUnknown2Req
extends
PacketHandler
{
@Override
@Override
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAllWidgetDataNotify.java
View file @
591ca480
...
@@ -9,7 +9,6 @@ import emu.grasscutter.net.proto.WidgetSlotDataOuterClass;
...
@@ -9,7 +9,6 @@ import emu.grasscutter.net.proto.WidgetSlotDataOuterClass;
import
emu.grasscutter.net.proto.WidgetSlotTagOuterClass
;
import
emu.grasscutter.net.proto.WidgetSlotTagOuterClass
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
class
PacketAllWidgetDataNotify
extends
BasePacket
{
public
class
PacketAllWidgetDataNotify
extends
BasePacket
{
...
@@ -19,35 +18,35 @@ public class PacketAllWidgetDataNotify extends BasePacket {
...
@@ -19,35 +18,35 @@ public class PacketAllWidgetDataNotify extends BasePacket {
// TODO: Implement this
// TODO: Implement this
AllWidgetDataNotify
.
Builder
proto
=
AllWidgetDataNotify
.
newBuilder
()
AllWidgetDataNotify
.
Builder
proto
=
AllWidgetDataNotify
.
newBuilder
()
// If you want to implement this, feel free to do so. :)
// If you want to implement this, feel free to do so. :)
.
setLunchBoxData
(
.
setLunchBoxData
(
LunchBoxDataOuterClass
.
LunchBoxData
.
newBuilder
().
build
()
LunchBoxDataOuterClass
.
LunchBoxData
.
newBuilder
().
build
()
)
)
// Maybe it's a little difficult, or it makes you upset :(
// Maybe it's a little difficult, or it makes you upset :(
.
addAllOneof
f
GatherPointDetectorDataList
(
List
.
of
())
.
addAllOneofGatherPointDetectorDataList
(
List
.
of
())
// So, goodbye, and hopefully sometime in the future o(* ̄▽ ̄*)ブ
// So, goodbye, and hopefully sometime in the future o(* ̄▽ ̄*)ブ
.
addAllCoolDownGroupDataList
(
List
.
of
())
.
addAllCoolDownGroupDataList
(
List
.
of
())
// I'll see your PR with a title that says (・∀・(・∀・(・∀・*)
// I'll see your PR with a title that says (・∀・(・∀・(・∀・*)
.
addAllAnchorPointList
(
List
.
of
())
.
addAllAnchorPointList
(
List
.
of
())
// "Complete implementation of widget functionality" b( ̄▽ ̄)d
// "Complete implementation of widget functionality" b( ̄▽ ̄)d
.
addAllClientCollectorDataList
(
List
.
of
())
.
addAllClientCollectorDataList
(
List
.
of
())
// Good luck, my boy.
// Good luck, my boy.
.
addAllNormalCoolDownDataList
(
List
.
of
());
.
addAllNormalCoolDownDataList
(
List
.
of
());
if
(
player
.
getWidgetId
()
==
null
)
{
if
(
player
.
getWidgetId
()
==
null
)
{
proto
.
addAllSlotList
(
List
.
of
());
proto
.
addAllSlotList
(
List
.
of
());
}
else
{
}
else
{
proto
.
addSlotList
(
proto
.
addSlotList
(
WidgetSlotDataOuterClass
.
WidgetSlotData
.
newBuilder
()
WidgetSlotDataOuterClass
.
WidgetSlotData
.
newBuilder
()
.
setIsActive
(
true
)
.
setIsActive
(
true
)
.
setMaterialId
(
player
.
getWidgetId
())
.
setMaterialId
(
player
.
getWidgetId
())
.
build
()
.
build
()
);
);
proto
.
addSlotList
(
proto
.
addSlotList
(
WidgetSlotDataOuterClass
.
WidgetSlotData
.
newBuilder
()
WidgetSlotDataOuterClass
.
WidgetSlotData
.
newBuilder
()
.
setTag
(
WidgetSlotTagOuterClass
.
WidgetSlotTag
.
WIDGET_SLOT_TAG_ATTACH_AVATAR
)
.
setTag
(
WidgetSlotTagOuterClass
.
WidgetSlotTag
.
WIDGET_SLOT_TAG_ATTACH_AVATAR
)
.
build
()
.
build
()
);
);
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetAllMailRsp.java
View file @
591ca480
...
@@ -24,9 +24,9 @@ public class PacketGetAllMailRsp extends BasePacket {
...
@@ -24,9 +24,9 @@ public class PacketGetAllMailRsp extends BasePacket {
GetAllMailRsp
.
Builder
proto
=
GetAllMailRsp
.
newBuilder
();
GetAllMailRsp
.
Builder
proto
=
GetAllMailRsp
.
newBuilder
();
if
(
isGiftMail
)
{
if
(
isGiftMail
)
{
proto
.
set
ANKKGPJCINB
(
true
);
proto
.
set
Unk2700OPEHLDAGICF
(
true
);
}
else
{
}
else
{
proto
.
set
ANKKGPJCINB
(
false
);
proto
.
set
Unk2700OPEHLDAGICF
(
false
);
if
(
player
.
getAllMail
().
size
()
!=
0
)
{
// Make sure the player has mail
if
(
player
.
getAllMail
().
size
()
!=
0
)
{
// Make sure the player has mail
List
<
MailData
>
mailDataList
=
new
ArrayList
<
MailData
>();
List
<
MailData
>
mailDataList
=
new
ArrayList
<
MailData
>();
...
@@ -61,7 +61,7 @@ public class PacketGetAllMailRsp extends BasePacket {
...
@@ -61,7 +61,7 @@ public class PacketGetAllMailRsp extends BasePacket {
mailData
.
setImportance
(
message
.
importance
);
mailData
.
setImportance
(
message
.
importance
);
mailData
.
setIsRead
(
message
.
isRead
);
mailData
.
setIsRead
(
message
.
isRead
);
mailData
.
setIsAttachmentGot
(
message
.
isAttachmentGot
);
mailData
.
setIsAttachmentGot
(
message
.
isAttachmentGot
);
mailData
.
set
BHCAHLJIKFF
Value
(
1
);
mailData
.
set
Unk2700NDPPGJKJOMH
Value
(
1
);
mailDataList
.
add
(
mailData
.
build
());
mailDataList
.
add
(
mailData
.
build
());
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketHomeUnknown1Notify.java
View file @
591ca480
...
@@ -6,13 +6,13 @@ import emu.grasscutter.net.proto.HomeUnknown1NotifyOuterClass;
...
@@ -6,13 +6,13 @@ import emu.grasscutter.net.proto.HomeUnknown1NotifyOuterClass;
public
class
PacketHomeUnknown1Notify
extends
BasePacket
{
public
class
PacketHomeUnknown1Notify
extends
BasePacket
{
public
PacketHomeUnknown1Notify
(
boolean
isEnterEditMode
)
{
public
PacketHomeUnknown1Notify
(
boolean
isEnterEditMode
)
{
super
(
PacketOpcodes
.
HomeUnknown1
Notify
);
super
(
PacketOpcodes
.
Unk2700_JDMPECKFGIG_Server
Notify
);
var
proto
=
HomeUnknown1NotifyOuterClass
.
HomeUnknown1Notify
.
newBuilder
();
var
proto
=
HomeUnknown1NotifyOuterClass
.
HomeUnknown1Notify
.
newBuilder
();
proto
.
setIsEnterEditMode
(
isEnterEditMode
);
proto
.
setIsEnterEditMode
(
isEnterEditMode
);
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketHomeUnknown2Rsp.java
View file @
591ca480
...
@@ -5,8 +5,8 @@ import emu.grasscutter.net.packet.PacketOpcodes;
...
@@ -5,8 +5,8 @@ import emu.grasscutter.net.packet.PacketOpcodes;
public
class
PacketHomeUnknown2Rsp
extends
BasePacket
{
public
class
PacketHomeUnknown2Rsp
extends
BasePacket
{
public
PacketHomeUnknown2Rsp
()
{
public
PacketHomeUnknown2Rsp
()
{
super
(
PacketOpcodes
.
HomeUnknown2
Rsp
);
super
(
PacketOpcodes
.
Unk2700_KIIOGMKFNNP_Server
Rsp
);
}
}
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketMailChangeNotify.java
View file @
591ca480
...
@@ -54,7 +54,7 @@ public class PacketMailChangeNotify extends BasePacket {
...
@@ -54,7 +54,7 @@ public class PacketMailChangeNotify extends BasePacket {
mailData
.
setImportance
(
message
.
importance
);
mailData
.
setImportance
(
message
.
importance
);
mailData
.
setIsRead
(
message
.
isRead
);
mailData
.
setIsRead
(
message
.
isRead
);
mailData
.
setIsAttachmentGot
(
message
.
isAttachmentGot
);
mailData
.
setIsAttachmentGot
(
message
.
isAttachmentGot
);
mailData
.
set
BHCAHLJIKFF
Value
(
message
.
stateValue
);
mailData
.
set
Unk2700NDPPGJKJOMH
Value
(
message
.
stateValue
);
proto
.
addMailList
(
mailData
.
build
());
proto
.
addMailList
(
mailData
.
build
());
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketQueryCodexMonsterBeKilledNumRsp.java
View file @
591ca480
...
@@ -14,10 +14,10 @@ public class PacketQueryCodexMonsterBeKilledNumRsp extends BasePacket {
...
@@ -14,10 +14,10 @@ public class PacketQueryCodexMonsterBeKilledNumRsp extends BasePacket {
QueryCodexMonsterBeKilledNumRsp
.
Builder
proto
=
QueryCodexMonsterBeKilledNumRsp
.
newBuilder
();
QueryCodexMonsterBeKilledNumRsp
.
Builder
proto
=
QueryCodexMonsterBeKilledNumRsp
.
newBuilder
();
codexList
.
forEach
(
animal
->
{
codexList
.
forEach
(
animal
->
{
if
(
player
.
getCodex
().
getUnlockedAnimal
().
containsKey
(
animal
)){
if
(
player
.
getCodex
().
getUnlockedAnimal
().
containsKey
(
animal
))
{
proto
.
addCodexIdList
(
animal
)
proto
.
addCodexIdList
(
animal
)
.
addBeKilledNumList
(
player
.
getCodex
().
getUnlockedAnimal
().
get
(
animal
))
.
addBeKilledNumList
(
player
.
getCodex
().
getUnlockedAnimal
().
get
(
animal
))
.
addCHPBKCLKPCJ
(
0
);
.
addUnk2700MKOBMGGPNMI
(
0
);
}
}
});
});
...
...
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