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
01b190bc
Commit
01b190bc
authored
May 07, 2022
by
Magix
Committed by
GitHub
May 07, 2022
Browse files
UPGRADE TO 1.1.0 POG
Merge `development` into `stable`
parents
6b81b888
1beddf16
Changes
497
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/Packet.java
View file @
01b190bc
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
;
public
class
Packet
extends
Genshin
Packet
{
public
class
Packet
extends
Base
Packet
{
public
Packet
()
{
super
(
PacketOpcodes
.
NONE
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAbilityChangeNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityAvatar
;
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.AbilityChangeNotifyOuterClass.AbilityChangeNotify
;
public
class
PacketAbilityChangeNotify
extends
Genshin
Packet
{
public
class
PacketAbilityChangeNotify
extends
Base
Packet
{
public
PacketAbilityChangeNotify
(
EntityAvatar
entity
)
{
super
(
PacketOpcodes
.
AbilityChangeNotify
,
true
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAbilityInvocationsNotify.java
View file @
01b190bc
...
...
@@ -2,12 +2,12 @@ package emu.grasscutter.server.packet.send;
import
java.util.List
;
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.AbilityInvocationsNotifyOuterClass.AbilityInvocationsNotify
;
import
emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry
;
public
class
PacketAbilityInvocationsNotify
extends
Genshin
Packet
{
public
class
PacketAbilityInvocationsNotify
extends
Base
Packet
{
public
PacketAbilityInvocationsNotify
(
AbilityInvokeEntry
entry
)
{
super
(
PacketOpcodes
.
AbilityInvocationsNotify
,
true
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAskAddFriendNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.friends.Friendship
;
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.AskAddFriendNotifyOuterClass.AskAddFriendNotify
;
public
class
PacketAskAddFriendNotify
extends
Genshin
Packet
{
public
class
PacketAskAddFriendNotify
extends
Base
Packet
{
public
PacketAskAddFriendNotify
(
Friendship
friendship
)
{
super
(
PacketOpcodes
.
AskAddFriendNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAskAddFriendRsp.java
View file @
01b190bc
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.AskAddFriendRspOuterClass.AskAddFriendRsp
;
public
class
PacketAskAddFriendRsp
extends
Genshin
Packet
{
public
class
PacketAskAddFriendRsp
extends
Base
Packet
{
public
PacketAskAddFriendRsp
(
int
targetUid
)
{
super
(
PacketOpcodes
.
AskAddFriendRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarAddNotify.java
View file @
01b190bc
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.AvatarAddNotifyOuterClass.AvatarAddNotify
;
public
class
PacketAvatarAddNotify
extends
Genshin
Packet
{
public
class
PacketAvatarAddNotify
extends
Base
Packet
{
public
PacketAvatarAddNotify
(
Genshin
Avatar
avatar
,
boolean
addedToTeam
)
{
public
PacketAvatarAddNotify
(
Avatar
avatar
,
boolean
addedToTeam
)
{
super
(
PacketOpcodes
.
AvatarAddNotify
);
AvatarAddNotify
proto
=
AvatarAddNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarChangeCostumeNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityAvatar
;
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.AvatarChangeCostumeNotifyOuterClass.AvatarChangeCostumeNotify
;
public
class
PacketAvatarChangeCostumeNotify
extends
Genshin
Packet
{
public
class
PacketAvatarChangeCostumeNotify
extends
Base
Packet
{
public
PacketAvatarChangeCostumeNotify
(
EntityAvatar
entity
)
{
super
(
PacketOpcodes
.
AvatarChangeCostumeNotify
);
AvatarChangeCostumeNotify
proto
=
AvatarChangeCostumeNotify
.
newBuilder
()
.
setEntity
(
entity
.
toProto
())
.
setEntity
Info
(
entity
.
toProto
())
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarChangeCostumeRsp.java
View file @
01b190bc
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.AvatarChangeCostumeRspOuterClass.AvatarChangeCostumeRsp
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
public
class
PacketAvatarChangeCostumeRsp
extends
Genshin
Packet
{
public
class
PacketAvatarChangeCostumeRsp
extends
Base
Packet
{
public
PacketAvatarChangeCostumeRsp
(
long
avatarGuid
,
int
costumeId
)
{
super
(
PacketOpcodes
.
AvatarChangeCostumeRsp
);
...
...
@@ -21,7 +22,7 @@ public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
super
(
PacketOpcodes
.
AvatarChangeCostumeRsp
);
AvatarChangeCostumeRsp
proto
=
AvatarChangeCostumeRsp
.
newBuilder
()
.
setRetcode
(
1
)
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
)
.
build
();
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDataNotify.java
View file @
01b190bc
...
...
@@ -2,17 +2,17 @@ package emu.grasscutter.server.packet.send;
import
java.util.Map.Entry
;
import
emu.grasscutter.game.
GenshinPlaye
r
;
import
emu.grasscutter.game.
TeamInfo
;
import
emu.grasscutter.game.
avatar.GenshinAvatar
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.game.
avatar.Avata
r
;
import
emu.grasscutter.game.
player.Player
;
import
emu.grasscutter.game.
player.TeamInfo
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarDataNotifyOuterClass.AvatarDataNotify
;
import
emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam
;
public
class
PacketAvatarDataNotify
extends
Genshin
Packet
{
public
class
PacketAvatarDataNotify
extends
Base
Packet
{
public
PacketAvatarDataNotify
(
Genshin
Player
player
)
{
public
PacketAvatarDataNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarDataNotify
,
2
);
AvatarDataNotify
.
Builder
proto
=
AvatarDataNotify
.
newBuilder
()
...
...
@@ -21,7 +21,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
.
addAllOwnedFlycloakList
(
player
.
getFlyCloakList
())
.
addAllOwnedCostumeList
(
player
.
getCostumeList
());
for
(
Genshin
Avatar
avatar
:
player
.
getAvatars
())
{
for
(
Avatar
avatar
:
player
.
getAvatars
())
{
proto
.
addAvatarList
(
avatar
.
toProto
());
}
...
...
@@ -31,7 +31,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
.
setTeamName
(
teamInfo
.
getName
());
for
(
int
i
=
0
;
i
<
teamInfo
.
getAvatars
().
size
();
i
++)
{
Genshin
Avatar
avatar
=
player
.
getAvatars
().
getAvatarById
(
teamInfo
.
getAvatars
().
get
(
i
));
Avatar
avatar
=
player
.
getAvatars
().
getAvatarById
(
teamInfo
.
getAvatars
().
get
(
i
));
avatarTeam
.
addAvatarGuidList
(
avatar
.
getGuid
());
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDieAnimationEndRsp.java
View file @
01b190bc
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.AvatarDieAnimationEndRspOuterClass.AvatarDieAnimationEndRsp
;
public
class
PacketAvatarDieAnimationEndRsp
extends
Genshin
Packet
{
public
class
PacketAvatarDieAnimationEndRsp
extends
Base
Packet
{
public
PacketAvatarDieAnimationEndRsp
(
long
dieGuid
,
int
skillId
)
{
super
(
PacketOpcodes
.
AvatarDieAnimationEndRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarEquipChangeNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.inventory.EquipType
;
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.AvatarEquipChangeNotifyOuterClass.AvatarEquipChangeNotify
;
public
class
PacketAvatarEquipChangeNotify
extends
Genshin
Packet
{
public
class
PacketAvatarEquipChangeNotify
extends
Base
Packet
{
public
PacketAvatarEquipChangeNotify
(
Genshin
Avatar
avatar
,
G
enshin
Item
item
)
{
public
PacketAvatarEquipChangeNotify
(
Avatar
avatar
,
G
ame
Item
item
)
{
super
(
PacketOpcodes
.
AvatarEquipChangeNotify
);
AvatarEquipChangeNotify
.
Builder
proto
=
AvatarEquipChangeNotify
.
newBuilder
()
...
...
@@ -27,7 +27,7 @@ public class PacketAvatarEquipChangeNotify extends GenshinPacket {
this
.
setData
(
proto
);
}
public
PacketAvatarEquipChangeNotify
(
Genshin
Avatar
avatar
,
EquipType
slot
)
{
public
PacketAvatarEquipChangeNotify
(
Avatar
avatar
,
EquipType
slot
)
{
super
(
PacketOpcodes
.
AvatarEquipChangeNotify
);
AvatarEquipChangeNotify
.
Builder
proto
=
AvatarEquipChangeNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionAllDataRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.expedition.ExpeditionInfo
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarExpeditionAllDataRspOuterClass.AvatarExpeditionAllDataRsp
;
import
emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo
;
import
java.util.*
;
public
class
PacketAvatarExpeditionAllDataRsp
extends
BasePacket
{
public
PacketAvatarExpeditionAllDataRsp
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarExpeditionAllDataRsp
);
List
<
Integer
>
openExpeditionList
=
new
ArrayList
<>(
List
.
of
(
306
,
305
,
304
,
303
,
302
,
301
,
206
,
105
,
204
,
104
,
203
,
103
,
202
,
101
,
102
,
201
,
106
,
205
));
Map
<
Long
,
AvatarExpeditionInfo
>
avatarExpeditionInfoList
=
new
HashMap
<
Long
,
AvatarExpeditionInfo
>();
var
expeditionInfo
=
player
.
getExpeditionInfo
();
for
(
Long
key
:
player
.
getExpeditionInfo
().
keySet
())
{
ExpeditionInfo
e
=
expeditionInfo
.
get
(
key
);
avatarExpeditionInfoList
.
put
(
key
,
AvatarExpeditionInfo
.
newBuilder
().
setStateValue
(
e
.
getState
()).
setExpId
(
e
.
getExpId
()).
setHourTime
(
e
.
getHourTime
()).
setStartTime
(
e
.
getStartTime
()).
build
());
};
AvatarExpeditionAllDataRsp
.
Builder
proto
=
AvatarExpeditionAllDataRsp
.
newBuilder
()
.
addAllOpenExpeditionList
(
openExpeditionList
)
.
setExpeditionCountLimit
(
5
)
.
putAllExpeditionInfoMap
(
avatarExpeditionInfoList
);
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionCallBackRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.expedition.ExpeditionInfo
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarExpeditionCallBackRspOuterClass.AvatarExpeditionCallBackRsp
;
import
emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo
;
public
class
PacketAvatarExpeditionCallBackRsp
extends
BasePacket
{
public
PacketAvatarExpeditionCallBackRsp
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarExpeditionCallBackRsp
);
AvatarExpeditionCallBackRsp
.
Builder
proto
=
AvatarExpeditionCallBackRsp
.
newBuilder
();
var
expeditionInfo
=
player
.
getExpeditionInfo
();
for
(
Long
key
:
player
.
getExpeditionInfo
().
keySet
())
{
ExpeditionInfo
e
=
expeditionInfo
.
get
(
key
);
proto
.
putExpeditionInfoMap
(
key
,
AvatarExpeditionInfo
.
newBuilder
().
setStateValue
(
e
.
getState
()).
setExpId
(
e
.
getExpId
()).
setHourTime
(
e
.
getHourTime
()).
setStartTime
(
e
.
getStartTime
()).
build
());
};
this
.
setData
(
proto
.
build
());
}
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionDataNotify.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.expedition.ExpeditionInfo
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarExpeditionDataNotifyOuterClass.AvatarExpeditionDataNotify
;
import
emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo
;
import
java.util.*
;
public
class
PacketAvatarExpeditionDataNotify
extends
BasePacket
{
public
PacketAvatarExpeditionDataNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarExpeditionDataNotify
);
Map
<
Long
,
AvatarExpeditionInfo
>
avatarExpeditionInfoList
=
new
HashMap
<
Long
,
AvatarExpeditionInfo
>();
var
expeditionInfo
=
player
.
getExpeditionInfo
();
for
(
Long
key
:
player
.
getExpeditionInfo
().
keySet
())
{
ExpeditionInfo
e
=
expeditionInfo
.
get
(
key
);
avatarExpeditionInfoList
.
put
(
key
,
AvatarExpeditionInfo
.
newBuilder
().
setStateValue
(
e
.
getState
()).
setExpId
(
e
.
getExpId
()).
setHourTime
(
e
.
getHourTime
()).
setStartTime
(
e
.
getStartTime
()).
build
());
};
AvatarExpeditionDataNotify
.
Builder
proto
=
AvatarExpeditionDataNotify
.
newBuilder
()
.
putAllExpeditionInfoMap
(
avatarExpeditionInfoList
);
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionGetRewardRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.expedition.ExpeditionInfo
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarExpeditionGetRewardRspOuterClass.AvatarExpeditionGetRewardRsp
;
import
emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo
;
import
java.util.Collection
;
public
class
PacketAvatarExpeditionGetRewardRsp
extends
BasePacket
{
public
PacketAvatarExpeditionGetRewardRsp
(
Player
player
,
Collection
<
GameItem
>
items
)
{
super
(
PacketOpcodes
.
AvatarExpeditionGetRewardRsp
);
AvatarExpeditionGetRewardRsp
.
Builder
proto
=
AvatarExpeditionGetRewardRsp
.
newBuilder
();
var
expeditionInfo
=
player
.
getExpeditionInfo
();
for
(
Long
key
:
player
.
getExpeditionInfo
().
keySet
())
{
ExpeditionInfo
e
=
expeditionInfo
.
get
(
key
);
proto
.
putExpeditionInfoMap
(
key
,
AvatarExpeditionInfo
.
newBuilder
().
setStateValue
(
e
.
getState
()).
setExpId
(
e
.
getExpId
()).
setHourTime
(
e
.
getHourTime
()).
setStartTime
(
e
.
getStartTime
()).
build
());
};
for
(
GameItem
item
:
items
)
{
proto
.
addItemList
(
item
.
toItemParam
());
}
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionStartRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.expedition.ExpeditionInfo
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo
;
import
emu.grasscutter.net.proto.AvatarExpeditionStartRspOuterClass.AvatarExpeditionStartRsp
;
public
class
PacketAvatarExpeditionStartRsp
extends
BasePacket
{
public
PacketAvatarExpeditionStartRsp
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarExpeditionStartRsp
);
AvatarExpeditionStartRsp
.
Builder
proto
=
AvatarExpeditionStartRsp
.
newBuilder
();
var
expeditionInfo
=
player
.
getExpeditionInfo
();
for
(
Long
key
:
player
.
getExpeditionInfo
().
keySet
())
{
ExpeditionInfo
e
=
expeditionInfo
.
get
(
key
);
proto
.
putExpeditionInfoMap
(
key
,
AvatarExpeditionInfo
.
newBuilder
().
setStateValue
(
e
.
getState
()).
setExpId
(
e
.
getExpId
()).
setHourTime
(
e
.
getHourTime
()).
setStartTime
(
e
.
getStartTime
()).
build
());
};
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFetterDataNotify.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.props.FetterState
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarFetterDataNotifyOuterClass.AvatarFetterDataNotify
;
import
emu.grasscutter.net.proto.AvatarFetterInfoOuterClass.AvatarFetterInfo
;
import
emu.grasscutter.net.proto.FetterDataOuterClass.FetterData
;
public
class
PacketAvatarFetterDataNotify
extends
BasePacket
{
public
PacketAvatarFetterDataNotify
(
Avatar
avatar
)
{
super
(
PacketOpcodes
.
AvatarFetterDataNotify
);
int
fetterLevel
=
avatar
.
getFetterLevel
();
AvatarFetterInfo
.
Builder
avatarFetter
=
AvatarFetterInfo
.
newBuilder
()
.
setExpLevel
(
avatar
.
getFetterLevel
());
if
(
fetterLevel
!=
10
)
{
avatarFetter
.
setExpNumber
(
avatar
.
getFetterExp
());
}
if
(
avatar
.
getFetterList
()
!=
null
)
{
for
(
int
i
=
0
;
i
<
avatar
.
getFetterList
().
size
();
i
++)
{
avatarFetter
.
addFetterList
(
FetterData
.
newBuilder
()
.
setFetterId
(
avatar
.
getFetterList
().
get
(
i
))
.
setFetterState
(
FetterState
.
FINISH
.
getValue
())
);
}
}
int
cardId
=
avatar
.
getNameCardId
();
if
(
avatar
.
getPlayer
().
getNameCardList
().
contains
(
cardId
))
{
avatarFetter
.
addRewardedFetterLevelList
(
10
);
}
AvatarFetterInfo
avatarFetterInfo
=
avatarFetter
.
build
();
AvatarFetterDataNotify
proto
=
AvatarFetterDataNotify
.
newBuilder
()
.
putFetterInfoMap
(
avatar
.
getGuid
(),
avatarFetterInfo
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFetterLevelRewardRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.AvatarFetterLevelRewardRspOuterClass.AvatarFetterLevelRewardRsp
;
public
class
PacketAvatarFetterLevelRewardRsp
extends
BasePacket
{
public
PacketAvatarFetterLevelRewardRsp
(
long
guid
,
int
fetterLevel
,
int
rewardId
)
{
super
(
PacketOpcodes
.
AvatarFetterLevelRewardRsp
);
AvatarFetterLevelRewardRsp
proto
=
AvatarFetterLevelRewardRsp
.
newBuilder
()
.
setAvatarGuid
(
guid
)
.
setFetterLevel
(
fetterLevel
)
.
setRetcode
(
0
)
.
setRewardId
(
rewardId
)
.
build
();
this
.
setData
(
proto
);
}
public
PacketAvatarFetterLevelRewardRsp
(
long
guid
,
int
fetterLevel
)
{
super
(
PacketOpcodes
.
AvatarFetterLevelRewardRsp
);
AvatarFetterLevelRewardRsp
proto
=
AvatarFetterLevelRewardRsp
.
newBuilder
()
.
setAvatarGuid
(
guid
)
.
setFetterLevel
(
fetterLevel
)
.
setRetcode
(
1
)
.
setRewardId
(
0
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFightPropNotify.java
View file @
01b190bc
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.AvatarFightPropNotifyOuterClass.AvatarFightPropNotify
;
public
class
PacketAvatarFightPropNotify
extends
Genshin
Packet
{
public
class
PacketAvatarFightPropNotify
extends
Base
Packet
{
public
PacketAvatarFightPropNotify
(
Genshin
Avatar
avatar
)
{
public
PacketAvatarFightPropNotify
(
Avatar
avatar
)
{
super
(
PacketOpcodes
.
AvatarFightPropNotify
);
AvatarFightPropNotify
proto
=
AvatarFightPropNotify
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFightPropUpdateNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.props.FightProperty
;
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.AvatarFightPropUpdateNotifyOuterClass.AvatarFightPropUpdateNotify
;
public
class
PacketAvatarFightPropUpdateNotify
extends
Genshin
Packet
{
public
class
PacketAvatarFightPropUpdateNotify
extends
Base
Packet
{
public
PacketAvatarFightPropUpdateNotify
(
Genshin
Avatar
avatar
,
FightProperty
prop
)
{
public
PacketAvatarFightPropUpdateNotify
(
Avatar
avatar
,
FightProperty
prop
)
{
super
(
PacketOpcodes
.
AvatarFightPropUpdateNotify
);
AvatarFightPropUpdateNotify
proto
=
AvatarFightPropUpdateNotify
.
newBuilder
()
...
...
Prev
1
…
12
13
14
15
16
17
18
19
20
…
25
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