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
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerSocialDetailRsp.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.GetPlayerSocialDetailRspOuterClass.GetPlayerSocialDetailRsp
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail
;
public
class
PacketGetPlayerSocialDetailRsp
extends
Genshin
Packet
{
public
class
PacketGetPlayerSocialDetailRsp
extends
Base
Packet
{
public
PacketGetPlayerSocialDetailRsp
(
SocialDetail
.
Builder
detail
)
{
super
(
PacketOpcodes
.
GetPlayerSocialDetailRsp
);
...
...
@@ -15,7 +16,7 @@ public class PacketGetPlayerSocialDetailRsp extends GenshinPacket {
if
(
detail
!=
null
)
{
proto
.
setDetailData
(
detail
);
}
else
{
proto
.
setRetcode
(
1
);
proto
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
);
}
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerTokenRsp.java
View file @
01b190bc
...
...
@@ -2,13 +2,13 @@ package emu.grasscutter.server.packet.send;
import
com.google.protobuf.ByteString
;
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.GetPlayerTokenRspOuterClass.GetPlayerTokenRsp
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.utils.Crypto
;
public
class
PacketGetPlayerTokenRsp
extends
Genshin
Packet
{
public
class
PacketGetPlayerTokenRsp
extends
Base
Packet
{
public
PacketGetPlayerTokenRsp
(
GameSession
session
,
boolean
doesPlayerExist
)
{
super
(
PacketOpcodes
.
GetPlayerTokenRsp
,
true
);
...
...
@@ -16,18 +16,18 @@ public class PacketGetPlayerTokenRsp extends GenshinPacket {
this
.
setUseDispatchKey
(
true
);
GetPlayerTokenRsp
p
=
GetPlayerTokenRsp
.
newBuilder
()
.
set
Player
Uid
(
session
.
getAccount
().
getPlayerUid
())
.
set
Account
Token
(
session
.
getAccount
().
getToken
())
.
setUid
(
session
.
getAccount
().
getPlayerUid
())
.
setToken
(
session
.
getAccount
().
getToken
())
.
setAccountType
(
1
)
.
setIsProficientPlayer
(
doesPlayerExist
)
// Not sure where this goes
.
setSecretKey
(
Crypto
.
ENCRYPT_SEED
)
.
setSec
retKey
Buffer
(
ByteString
.
copyFrom
(
Crypto
.
ENCRYPT_SEED_BUFFER
))
.
setSecretKey
Seed
(
Crypto
.
ENCRYPT_SEED
)
.
setSec
urityCmd
Buffer
(
ByteString
.
copyFrom
(
Crypto
.
ENCRYPT_SEED_BUFFER
))
.
setPlatformType
(
3
)
.
setChannelId
(
1
)
.
setCountryCode
(
"US"
)
.
set
Unk1
(
"c25-314dd05b0b5f"
)
.
set
Unk3
(
3
)
.
setClientIp
(
session
.
getAddress
().
getAddress
().
getHostAddress
())
.
set
ClientVersionRandomKey
(
"c25-314dd05b0b5f"
)
.
set
RegPlatform
(
3
)
.
setClientIp
Str
(
session
.
getAddress
().
getAddress
().
getHostAddress
())
.
build
();
this
.
setData
(
p
.
toByteArray
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetSceneAreaRsp.java
View file @
01b190bc
...
...
@@ -3,12 +3,12 @@ package emu.grasscutter.server.packet.send;
import
java.util.Arrays
;
import
java.util.stream.Collectors
;
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.CityInfoOuterClass.CityInfo
;
import
emu.grasscutter.net.proto.GetSceneAreaRspOuterClass.GetSceneAreaRsp
;
public
class
PacketGetSceneAreaRsp
extends
Genshin
Packet
{
public
class
PacketGetSceneAreaRsp
extends
Base
Packet
{
public
PacketGetSceneAreaRsp
(
int
sceneId
)
{
super
(
PacketOpcodes
.
GetSceneAreaRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetScenePointRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetScenePointRspOuterClass.GetScenePointRsp
;
public
class
PacketGetScenePointRsp
extends
Genshin
Packet
{
public
class
PacketGetScenePointRsp
extends
Base
Packet
{
public
PacketGetScenePointRsp
(
int
sceneId
)
{
super
(
PacketOpcodes
.
GetScenePointRsp
);
...
...
@@ -12,8 +13,12 @@ public class PacketGetScenePointRsp extends GenshinPacket {
GetScenePointRsp
.
Builder
p
=
GetScenePointRsp
.
newBuilder
()
.
setSceneId
(
sceneId
);
for
(
int
i
=
1
;
i
<
1000
;
i
++)
{
p
.
addUnlockedPointList
(
i
);
if
(
GameData
.
getScenePointIdList
().
size
()
==
0
)
{
for
(
int
i
=
1
;
i
<
1000
;
i
++)
{
p
.
addUnlockedPointList
(
i
);
}
}
else
{
p
.
addAllUnlockedPointList
(
GameData
.
getScenePointIdList
());
}
for
(
int
i
=
1
;
i
<
9
;
i
++)
{
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketGetShopRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.shop.ShopInfo
;
import
emu.grasscutter.game.shop.ShopLimit
;
import
emu.grasscutter.game.shop.ShopManager
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.GetShopRspOuterClass.GetShopRsp
;
import
emu.grasscutter.net.proto.GetShopRspOuterClass
;
import
emu.grasscutter.net.proto.ItemParamOuterClass
;
import
emu.grasscutter.net.proto.ShopGoodsOuterClass.ShopGoods
;
import
emu.grasscutter.net.proto.ShopOuterClass.Shop
;
import
emu.grasscutter.utils.Utils
;
public
class
PacketGetShopRsp
extends
GenshinPacket
{
public
PacketGetShopRsp
(
int
shopType
)
{
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
PacketGetShopRsp
extends
BasePacket
{
public
PacketGetShopRsp
(
Player
inv
,
int
shopType
)
{
super
(
PacketOpcodes
.
GetShopRsp
);
GetShopRsp
proto
=
GetShopRsp
.
newBuilder
()
.
setShop
(
Shop
.
newBuilder
().
setShopType
(
shopType
))
.
build
();
this
.
setData
(
proto
);
// TODO: CityReputationLevel
Shop
.
Builder
shop
=
Shop
.
newBuilder
()
.
setShopType
(
shopType
)
.
setCityId
(
1
)
//mock
.
setCityReputationLevel
(
10
);
//mock
ShopManager
manager
=
Grasscutter
.
getGameServer
().
getShopManager
();
if
(
manager
.
getShopData
().
get
(
shopType
)
!=
null
)
{
List
<
ShopInfo
>
list
=
manager
.
getShopData
().
get
(
shopType
);
List
<
ShopGoods
>
goodsList
=
new
ArrayList
<>();
for
(
ShopInfo
info
:
list
)
{
ShopGoods
.
Builder
goods
=
ShopGoods
.
newBuilder
()
.
setGoodsId
(
info
.
getGoodsId
())
.
setGoodsItem
(
ItemParamOuterClass
.
ItemParam
.
newBuilder
().
setItemId
(
info
.
getGoodsItem
().
getId
()).
setCount
(
info
.
getGoodsItem
().
getCount
()).
build
())
.
setScoin
(
info
.
getScoin
())
.
setHcoin
(
info
.
getHcoin
())
.
setBuyLimit
(
info
.
getBuyLimit
())
.
setBeginTime
(
info
.
getBeginTime
())
.
setEndTime
(
info
.
getEndTime
())
.
setMinLevel
(
info
.
getMinLevel
())
.
setMaxLevel
(
info
.
getMaxLevel
())
.
setMcoin
(
info
.
getMcoin
())
.
setDisableType
(
info
.
getDisableType
())
.
setSecondarySheetId
(
info
.
getSecondarySheetId
());
if
(
info
.
getCostItemList
()
!=
null
)
{
goods
.
addAllCostItemList
(
info
.
getCostItemList
().
stream
().
map
(
x
->
ItemParamOuterClass
.
ItemParam
.
newBuilder
().
setItemId
(
x
.
getId
()).
setCount
(
x
.
getCount
()).
build
()).
collect
(
Collectors
.
toList
()));
}
if
(
info
.
getPreGoodsIdList
()
!=
null
)
{
goods
.
addAllPreGoodsIdList
(
info
.
getPreGoodsIdList
());
}
int
currentTs
=
Utils
.
getCurrentSeconds
();
ShopLimit
currentShopLimit
=
inv
.
getGoodsLimit
(
info
.
getGoodsId
());
int
nextRefreshTime
=
ShopManager
.
getShopNextRefreshTime
(
info
);
if
(
currentShopLimit
!=
null
)
{
if
(
currentShopLimit
.
getNextRefreshTime
()
<
currentTs
)
{
// second game day
currentShopLimit
.
setHasBoughtInPeriod
(
0
);
currentShopLimit
.
setNextRefreshTime
(
nextRefreshTime
);
}
goods
.
setBoughtNum
(
currentShopLimit
.
getHasBoughtInPeriod
());
goods
.
setNextRefreshTime
(
currentShopLimit
.
getNextRefreshTime
());
}
else
{
inv
.
addShopLimit
(
goods
.
getGoodsId
(),
0
,
nextRefreshTime
);
// save generated refresh time
goods
.
setNextRefreshTime
(
nextRefreshTime
);
}
goodsList
.
add
(
goods
.
build
());
}
shop
.
addAllGoodsList
(
goodsList
);
}
inv
.
save
();
this
.
setData
(
GetShopRspOuterClass
.
GetShopRsp
.
newBuilder
().
setShop
(
shop
).
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketGetShopmallDataRsp.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.GetShopmallDataRspOuterClass.GetShopmallDataRsp
;
public
class
PacketGetShopmallDataRsp
extends
GenshinPacket
{
import
java.util.List
;
public
class
PacketGetShopmallDataRsp
extends
BasePacket
{
public
PacketGetShopmallDataRsp
()
{
super
(
PacketOpcodes
.
GetShopmallDataRsp
);
GetShopmallDataRsp
proto
=
GetShopmallDataRsp
.
newBuilder
().
build
();
List
<
Integer
>
shop_malls
=
List
.
of
(
900
,
1052
,
902
,
1001
,
903
);
GetShopmallDataRsp
proto
=
GetShopmallDataRsp
.
newBuilder
()
.
addAllShopTypeList
(
shop_malls
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketGetWorldMpInfoRsp.java
View file @
01b190bc
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.GetWorldMpInfoRspOuterClass.GetWorldMpInfoRsp
;
public
class
PacketGetWorldMpInfoRsp
extends
Genshin
Packet
{
public
class
PacketGetWorldMpInfoRsp
extends
Base
Packet
{
public
PacketGetWorldMpInfoRsp
(
World
world
)
{
super
(
PacketOpcodes
.
GetWorldMpInfoRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketH5ActivityIdsNotify.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.H5ActivityIdsNotifyOuterClass.H5ActivityIdsNotify
;
public
class
PacketH5ActivityIdsNotify
extends
Genshin
Packet
{
public
class
PacketH5ActivityIdsNotify
extends
Base
Packet
{
public
PacketH5ActivityIdsNotify
()
{
super
(
PacketOpcodes
.
H5ActivityIdsNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketHostPlayerNotify.java
View file @
01b190bc
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.HostPlayerNotifyOuterClass.HostPlayerNotify
;
public
class
PacketHostPlayerNotify
extends
Genshin
Packet
{
public
class
PacketHostPlayerNotify
extends
Base
Packet
{
public
PacketHostPlayerNotify
(
World
world
)
{
super
(
PacketOpcodes
.
HostPlayerNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketItemAddHintNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
java.util.Collection
;
import
java.util.List
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.game.props.ActionReason
;
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.ItemAddHintNotifyOuterClass.ItemAddHintNotify
;
public
class
PacketItemAddHintNotify
extends
Genshin
Packet
{
public
class
PacketItemAddHintNotify
extends
Base
Packet
{
public
PacketItemAddHintNotify
(
G
enshin
Item
item
,
ActionReason
reason
)
{
public
PacketItemAddHintNotify
(
G
ame
Item
item
,
ActionReason
reason
)
{
super
(
PacketOpcodes
.
ItemAddHintNotify
);
ItemAddHintNotify
proto
=
ItemAddHintNotify
.
newBuilder
()
...
...
@@ -21,13 +22,13 @@ public class PacketItemAddHintNotify extends GenshinPacket {
this
.
setData
(
proto
);
}
public
PacketItemAddHintNotify
(
List
<
Genshin
Item
>
items
,
ActionReason
reason
)
{
public
PacketItemAddHintNotify
(
Collection
<
Game
Item
>
items
,
ActionReason
reason
)
{
super
(
PacketOpcodes
.
ItemAddHintNotify
);
ItemAddHintNotify
.
Builder
proto
=
ItemAddHintNotify
.
newBuilder
()
.
setReason
(
reason
.
getValue
());
for
(
G
enshin
Item
item
:
items
)
{
for
(
G
ame
Item
item
:
items
)
{
proto
.
addItemList
(
item
.
toItemHintProto
());
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketLifeStateChangeNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.GenshinEntity
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.entity.GameEntity
;
import
emu.grasscutter.game.props.LifeState
;
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.LifeStateChangeNotifyOuterClass.LifeStateChangeNotify
;
import
emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType
;
import
emu.grasscutter.net.proto.ServerBuffOuterClass.ServerBuff
;
public
class
PacketLifeStateChangeNotify
extends
GenshinPacket
{
public
PacketLifeStateChangeNotify
(
GenshinEntity
attacker
,
GenshinEntity
target
,
LifeState
lifeState
)
{
import
java.util.ArrayList
;
public
class
PacketLifeStateChangeNotify
extends
BasePacket
{
public
PacketLifeStateChangeNotify
(
GameEntity
attacker
,
GameEntity
target
,
LifeState
lifeState
)
{
super
(
PacketOpcodes
.
LifeStateChangeNotify
);
LifeStateChangeNotify
proto
=
LifeStateChangeNotify
.
newBuilder
()
...
...
@@ -18,7 +23,7 @@ public class PacketLifeStateChangeNotify extends GenshinPacket {
this
.
setData
(
proto
);
}
public
PacketLifeStateChangeNotify
(
int
attackerId
,
G
enshin
Entity
target
,
LifeState
lifeState
)
{
public
PacketLifeStateChangeNotify
(
int
attackerId
,
G
ame
Entity
target
,
LifeState
lifeState
)
{
super
(
PacketOpcodes
.
LifeStateChangeNotify
);
LifeStateChangeNotify
proto
=
LifeStateChangeNotify
.
newBuilder
()
...
...
@@ -26,7 +31,29 @@ public class PacketLifeStateChangeNotify extends GenshinPacket {
.
setLifeState
(
lifeState
.
getValue
())
.
setSourceEntityId
(
attackerId
)
.
build
();
this
.
setData
(
proto
);
}
public
PacketLifeStateChangeNotify
(
GameEntity
entity
,
LifeState
lifeState
,
PlayerDieType
dieType
)
{
this
(
entity
,
lifeState
,
null
,
""
,
dieType
);
}
public
PacketLifeStateChangeNotify
(
GameEntity
entity
,
LifeState
lifeState
,
GameEntity
sourceEntity
,
String
attackTag
,
PlayerDieType
dieType
)
{
super
(
PacketOpcodes
.
LifeStateChangeNotify
);
LifeStateChangeNotify
.
Builder
proto
=
LifeStateChangeNotify
.
newBuilder
();
proto
.
setEntityId
(
entity
.
getId
());
proto
.
setLifeState
(
lifeState
.
getValue
());
if
(
sourceEntity
!=
null
)
{
proto
.
setSourceEntityId
(
sourceEntity
.
getId
());
}
proto
.
setAttackTag
(
attackTag
);
proto
.
setDieType
(
dieType
);
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketMailChangeNotify.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.mail.Mail
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.*
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
PacketMailChangeNotify
extends
BasePacket
{
public
PacketMailChangeNotify
(
Player
player
,
Mail
message
)
{
this
(
player
,
new
ArrayList
<
Mail
>(){{
add
(
message
);}});
}
public
PacketMailChangeNotify
(
Player
player
,
List
<
Mail
>
mailList
)
{
this
(
player
,
mailList
,
null
);
}
public
PacketMailChangeNotify
(
Player
player
,
List
<
Mail
>
mailList
,
List
<
Integer
>
delMailIdList
)
{
super
(
PacketOpcodes
.
MailChangeNotify
);
MailChangeNotifyOuterClass
.
MailChangeNotify
.
Builder
proto
=
MailChangeNotifyOuterClass
.
MailChangeNotify
.
newBuilder
();
if
(
mailList
!=
null
)
{
for
(
Mail
message
:
mailList
)
{
MailTextContentOuterClass
.
MailTextContent
.
Builder
mailTextContent
=
MailTextContentOuterClass
.
MailTextContent
.
newBuilder
();
mailTextContent
.
setTitle
(
message
.
mailContent
.
title
);
mailTextContent
.
setContent
(
message
.
mailContent
.
content
);
mailTextContent
.
setSender
(
message
.
mailContent
.
sender
);
List
<
MailItemOuterClass
.
MailItem
>
mailItems
=
new
ArrayList
<
MailItemOuterClass
.
MailItem
>();
for
(
Mail
.
MailItem
item
:
message
.
itemList
)
{
MailItemOuterClass
.
MailItem
.
Builder
mailItem
=
MailItemOuterClass
.
MailItem
.
newBuilder
();
ItemParamOuterClass
.
ItemParam
.
Builder
itemParam
=
ItemParamOuterClass
.
ItemParam
.
newBuilder
();
itemParam
.
setItemId
(
item
.
itemId
);
itemParam
.
setCount
(
item
.
itemCount
);
mailItem
.
setItemParam
(
itemParam
.
build
());
mailItems
.
add
(
mailItem
.
build
());
}
MailDataOuterClass
.
MailData
.
Builder
mailData
=
MailDataOuterClass
.
MailData
.
newBuilder
();
mailData
.
setMailId
(
player
.
getMailId
(
message
));
mailData
.
setMailTextContent
(
mailTextContent
.
build
());
mailData
.
addAllItemList
(
mailItems
);
mailData
.
setSendTime
((
int
)
message
.
sendTime
);
mailData
.
setExpireTime
((
int
)
message
.
expireTime
);
mailData
.
setImportance
(
message
.
importance
);
mailData
.
setIsRead
(
message
.
isRead
);
mailData
.
setIsAttachmentGot
(
message
.
isAttachmentGot
);
mailData
.
setStateValue
(
message
.
stateValue
);
proto
.
addMailList
(
mailData
.
build
());
}
}
if
(
delMailIdList
!=
null
)
{
proto
.
addAllDelMailIdList
(
delMailIdList
);
}
this
.
setData
(
proto
.
build
());
}
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/send/PacketMarkMapRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.managers.MapMarkManager.MapMark
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.*
;
import
java.util.*
;
public
class
PacketMarkMapRsp
extends
BasePacket
{
public
PacketMarkMapRsp
(
Player
player
,
HashMap
<
String
,
MapMark
>
mapMarks
)
{
super
(
PacketOpcodes
.
MarkMapRsp
);
MarkMapRspOuterClass
.
MarkMapRsp
.
Builder
proto
=
MarkMapRspOuterClass
.
MarkMapRsp
.
newBuilder
();
proto
.
setRetcode
(
0
);
if
(
mapMarks
!=
null
)
{
for
(
MapMark
mapMark:
mapMarks
.
values
())
{
MapMarkPointOuterClass
.
MapMarkPoint
.
Builder
markPoint
=
MapMarkPointOuterClass
.
MapMarkPoint
.
newBuilder
();
markPoint
.
setSceneId
(
mapMark
.
getSceneId
());
markPoint
.
setName
(
mapMark
.
getName
());
VectorOuterClass
.
Vector
.
Builder
positionVector
=
VectorOuterClass
.
Vector
.
newBuilder
();
positionVector
.
setX
(
mapMark
.
getPosition
().
getX
());
positionVector
.
setY
(
mapMark
.
getPosition
().
getY
());
positionVector
.
setZ
(
mapMark
.
getPosition
().
getZ
());
markPoint
.
setPos
(
positionVector
.
build
());
markPoint
.
setPointType
(
mapMark
.
getMapMarkPointType
());
markPoint
.
setFromType
(
mapMark
.
getMapMarkFromType
());
markPoint
.
setMonsterId
(
mapMark
.
getMonsterId
());
markPoint
.
setQuestId
(
mapMark
.
getQuestId
());
proto
.
addMarkList
(
markPoint
.
build
());
}
}
MarkMapRspOuterClass
.
MarkMapRsp
data
=
proto
.
build
();
this
.
setData
(
data
);
}
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/send/PacketMarkNewNotify.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.*
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
PacketMarkNewNotify
extends
BasePacket
{
public
PacketMarkNewNotify
(
Player
player
,
int
markNewType
,
ArrayList
<
Integer
>
idList
)
{
super
(
PacketOpcodes
.
MarkNewNotify
);
MarkNewNotifyOuterClass
.
MarkNewNotify
.
Builder
proto
=
MarkNewNotifyOuterClass
.
MarkNewNotify
.
newBuilder
();
proto
.
setMarkNewType
(
markNewType
);
for
(
Integer
id:
idList
)
{
proto
.
addIdList
(
id
);
}
MarkNewNotifyOuterClass
.
MarkNewNotify
data
=
proto
.
build
();
this
.
setData
(
data
);
}
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/send/PacketMcoinExchangeHcoinRsp.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.McoinExchangeHcoinRspOuterClass
;
public
class
PacketMcoinExchangeHcoinRsp
extends
BasePacket
{
public
PacketMcoinExchangeHcoinRsp
(
int
retCode
)
{
super
(
PacketOpcodes
.
McoinExchangeHcoinRsp
);
McoinExchangeHcoinRspOuterClass
.
McoinExchangeHcoinRsp
proto
=
McoinExchangeHcoinRspOuterClass
.
McoinExchangeHcoinRsp
.
newBuilder
()
.
setRetcode
(
retCode
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketNpcTalkRsp.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.NpcTalkRspOuterClass.NpcTalkRsp
;
public
class
PacketNpcTalkRsp
extends
Genshin
Packet
{
public
class
PacketNpcTalkRsp
extends
Base
Packet
{
public
PacketNpcTalkRsp
(
int
npcEntityId
,
int
curTalkId
,
int
entityId
)
{
super
(
PacketOpcodes
.
NpcTalkRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketOpenStateUpdateNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.props.OpenState
;
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.OpenStateUpdateNotifyOuterClass.OpenStateUpdateNotify
;
public
class
PacketOpenStateUpdateNotify
extends
Genshin
Packet
{
public
class
PacketOpenStateUpdateNotify
extends
Base
Packet
{
public
PacketOpenStateUpdateNotify
()
{
super
(
PacketOpcodes
.
OpenStateUpdateNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPathfindingEnterSceneRsp.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
PacketPathfindingEnterSceneRsp
extends
Genshin
Packet
{
public
class
PacketPathfindingEnterSceneRsp
extends
Base
Packet
{
public
PacketPathfindingEnterSceneRsp
(
int
clientSequence
)
{
super
(
PacketOpcodes
.
PathfindingEnterSceneRsp
);
this
.
buildHeader
(
clientSequence
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPersonalSceneJumpRsp.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.PersonalSceneJumpRspOuterClass.PersonalSceneJumpRsp
;
import
emu.grasscutter.utils.Position
;
public
class
PacketPersonalSceneJumpRsp
extends
BasePacket
{
public
PacketPersonalSceneJumpRsp
(
int
sceneId
,
Position
pos
)
{
super
(
PacketOpcodes
.
PersonalSceneJumpRsp
);
PersonalSceneJumpRsp
proto
=
PersonalSceneJumpRsp
.
newBuilder
()
.
setDestSceneId
(
sceneId
)
.
setDestPos
(
pos
.
toProto
())
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPingRsp.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.PingRspOuterClass.PingRsp
;
public
class
PacketPingRsp
extends
Genshin
Packet
{
public
class
PacketPingRsp
extends
Base
Packet
{
public
PacketPingRsp
(
int
clientSeq
,
int
time
)
{
super
(
PacketOpcodes
.
PingRsp
,
clientSeq
);
...
...
Prev
1
…
16
17
18
19
20
21
22
23
24
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