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/PacketTowerTeamSelectRsp.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.TowerTeamSelectRspOuterClass.TowerTeamSelectRsp
;
public
class
PacketTowerTeamSelectRsp
extends
BasePacket
{
public
PacketTowerTeamSelectRsp
()
{
super
(
PacketOpcodes
.
TowerTeamSelectRsp
);
TowerTeamSelectRsp
proto
=
TowerTeamSelectRsp
.
newBuilder
()
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketUnlockAvatarTalentRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.UnlockAvatarTalentRspOuterClass.UnlockAvatarTalentRsp
;
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
);
super
(
PacketOpcodes
.
UnlockAvatarTalentRsp
);
UnlockAvatarTalentRsp
proto
=
UnlockAvatarTalentRsp
.
newBuilder
()
UnlockAvatarTalentRsp
proto
=
UnlockAvatarTalentRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketUnlockNameCardNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
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.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.UnlockNameCardNotifyOuterClass.UnlockNameCardNotify
;
import
emu.grasscutter.net.proto.UnlockNameCardNotifyOuterClass.UnlockNameCardNotify
;
public
class
PacketUnlockNameCardNotify
extends
Genshin
Packet
{
public
class
PacketUnlockNameCardNotify
extends
Base
Packet
{
public
PacketUnlockNameCardNotify
(
int
nameCard
)
{
public
PacketUnlockNameCardNotify
(
int
nameCard
)
{
super
(
PacketOpcodes
.
UnlockNameCardNotify
);
super
(
PacketOpcodes
.
UnlockNameCardNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowAvatarListRsp.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.UpdatePlayerShowAvatarListRspOuterClass.UpdatePlayerShowAvatarListRsp
;
import
java.util.List
;
public
class
PacketUpdatePlayerShowAvatarListRsp
extends
BasePacket
{
public
PacketUpdatePlayerShowAvatarListRsp
(
boolean
isShowAvatar
,
List
<
Integer
>
avatarIds
)
{
super
(
PacketOpcodes
.
UpdatePlayerShowAvatarListRsp
);
UpdatePlayerShowAvatarListRsp
proto
=
UpdatePlayerShowAvatarListRsp
.
newBuilder
()
.
setIsShowAvatar
(
isShowAvatar
)
.
addAllShowAvatarIdList
(
avatarIds
)
.
setRetcode
(
0
)
.
build
();
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketUseItemRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
import
emu.grasscutter.net.proto.UseItemRspOuterClass.UseItemRsp
;
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
);
super
(
PacketOpcodes
.
UseItemRsp
);
UseItemRsp
proto
=
UseItemRsp
.
newBuilder
()
UseItemRsp
proto
=
UseItemRsp
.
newBuilder
()
...
@@ -22,7 +23,7 @@ public class PacketUseItemRsp extends GenshinPacket {
...
@@ -22,7 +23,7 @@ public class PacketUseItemRsp extends GenshinPacket {
public
PacketUseItemRsp
()
{
public
PacketUseItemRsp
()
{
super
(
PacketOpcodes
.
UseItemRsp
);
super
(
PacketOpcodes
.
UseItemRsp
);
UseItemRsp
proto
=
UseItemRsp
.
newBuilder
().
setRetcode
(
1
).
build
();
UseItemRsp
proto
=
UseItemRsp
.
newBuilder
().
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SVR_ERROR_VALUE
).
build
();
this
.
setData
(
proto
);
this
.
setData
(
proto
);
}
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketVehicleInteractRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.entity.EntityVehicle
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.entity.GameEntity
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.VehicleInteractTypeOuterClass.VehicleInteractType
;
import
emu.grasscutter.net.proto.VehicleInteractRspOuterClass.VehicleInteractRsp
;
import
emu.grasscutter.net.proto.VehicleMemberOuterClass.VehicleMember
;
public
class
PacketVehicleInteractRsp
extends
BasePacket
{
public
PacketVehicleInteractRsp
(
Player
player
,
int
entityId
,
VehicleInteractType
interactType
)
{
super
(
PacketOpcodes
.
VehicleInteractRsp
);
VehicleInteractRsp
.
Builder
proto
=
VehicleInteractRsp
.
newBuilder
();
GameEntity
vehicle
=
player
.
getScene
().
getEntityById
(
entityId
);
if
(
vehicle
instanceof
EntityVehicle
)
{
proto
.
setEntityId
(
vehicle
.
getId
());
VehicleMember
vehicleMember
=
VehicleMember
.
newBuilder
()
.
setUid
(
player
.
getUid
())
.
setAvatarGuid
(
player
.
getTeamManager
().
getCurrentCharacterGuid
())
.
build
();
proto
.
setInteractType
(
interactType
);
proto
.
setMember
(
vehicleMember
);
switch
(
interactType
){
case
VEHICLE_INTERACT_IN
->
{
((
EntityVehicle
)
vehicle
).
getVehicleMembers
().
add
(
vehicleMember
);
}
case
VEHICLE_INTERACT_OUT
->
{
((
EntityVehicle
)
vehicle
).
getVehicleMembers
().
remove
(
vehicleMember
);
}
default
->
{}
}
}
this
.
setData
(
proto
.
build
());
}
public
PacketVehicleInteractRsp
(
EntityVehicle
vehicle
,
VehicleMember
vehicleMember
,
VehicleInteractType
interactType
)
{
super
(
PacketOpcodes
.
VehicleInteractRsp
);
VehicleInteractRsp
.
Builder
proto
=
VehicleInteractRsp
.
newBuilder
();
if
(
vehicle
!=
null
)
{
proto
.
setEntityId
(
vehicle
.
getId
());
proto
.
setInteractType
(
interactType
);
proto
.
setMember
(
vehicleMember
);
switch
(
interactType
){
case
VEHICLE_INTERACT_IN
->
{
vehicle
.
getVehicleMembers
().
add
(
vehicleMember
);
}
case
VEHICLE_INTERACT_OUT
->
{
vehicle
.
getVehicleMembers
().
remove
(
vehicleMember
);
}
default
->
{}
}
}
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketVehicleSpawnRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.entity.EntityVehicle
;
import
emu.grasscutter.game.props.FightProperty
;
import
emu.grasscutter.game.entity.GameEntity
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.VehicleMemberOuterClass.VehicleMember
;
import
emu.grasscutter.net.proto.VehicleSpawnRspOuterClass.VehicleSpawnRsp
;
import
emu.grasscutter.utils.Position
;
import
java.util.List
;
import
static
emu
.
grasscutter
.
net
.
proto
.
VehicleInteractTypeOuterClass
.
VehicleInteractType
.
VEHICLE_INTERACT_OUT
;
public
class
PacketVehicleSpawnRsp
extends
BasePacket
{
public
PacketVehicleSpawnRsp
(
Player
player
,
int
vehicleId
,
int
pointId
,
Position
pos
,
Position
rot
)
{
super
(
PacketOpcodes
.
VehicleSpawnRsp
);
VehicleSpawnRsp
.
Builder
proto
=
VehicleSpawnRsp
.
newBuilder
();
// Eject vehicle members and Kill previous vehicles if there are any
List
<
GameEntity
>
previousVehicles
=
player
.
getScene
().
getEntities
().
values
().
stream
()
.
filter
(
entity
->
entity
instanceof
EntityVehicle
&&
((
EntityVehicle
)
entity
).
getGadgetId
()
==
vehicleId
&&
((
EntityVehicle
)
entity
).
getOwner
().
equals
(
player
))
.
toList
();
previousVehicles
.
stream
().
forEach
(
entity
->
{
List
<
VehicleMember
>
vehicleMembers
=
((
EntityVehicle
)
entity
).
getVehicleMembers
().
stream
().
toList
();
vehicleMembers
.
stream
().
forEach
(
vehicleMember
->
{
player
.
getScene
().
broadcastPacket
(
new
PacketVehicleInteractRsp
(((
EntityVehicle
)
entity
),
vehicleMember
,
VEHICLE_INTERACT_OUT
));
});
player
.
getScene
().
killEntity
(
entity
,
0
);
});
EntityVehicle
vehicle
=
new
EntityVehicle
(
player
.
getScene
(),
player
,
vehicleId
,
pointId
,
pos
,
rot
);
switch
(
vehicleId
)
{
// TODO: Not hardcode this. Waverider (skiff)
case
45001001
,
45001002
->
{
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_BASE_HP
,
10000
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_BASE_ATTACK
,
100
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_ATTACK
,
100
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_HP
,
10000
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_DEFENSE
,
0
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_CUR_SPEED
,
0
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_CHARGE_EFFICIENCY
,
0
);
vehicle
.
addFightProperty
(
FightProperty
.
FIGHT_PROP_MAX_HP
,
10000
);
}
default
->
{}
}
player
.
getScene
().
addEntity
(
vehicle
);
proto
.
setVehicleId
(
vehicleId
);
proto
.
setEntityId
(
vehicle
.
getId
());
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketWeaponAwakenRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.avatar.
Genshin
Avatar
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WeaponAwakenRspOuterClass.WeaponAwakenRsp
;
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
);
super
(
PacketOpcodes
.
WeaponAwakenRsp
);
WeaponAwakenRsp
.
Builder
proto
=
WeaponAwakenRsp
.
newBuilder
()
WeaponAwakenRsp
.
Builder
proto
=
WeaponAwakenRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWeaponPromoteRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WeaponPromoteRspOuterClass.WeaponPromoteRsp
;
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
);
super
(
PacketOpcodes
.
WeaponPromoteRsp
);
WeaponPromoteRsp
proto
=
WeaponPromoteRsp
.
newBuilder
()
WeaponPromoteRsp
proto
=
WeaponPromoteRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWeaponUpgradeRsp.java
View file @
01b190bc
...
@@ -2,15 +2,15 @@ package emu.grasscutter.server.packet.send;
...
@@ -2,15 +2,15 @@ package emu.grasscutter.server.packet.send;
import
java.util.List
;
import
java.util.List
;
import
emu.grasscutter.game.inventory.G
enshin
Item
;
import
emu.grasscutter.game.inventory.G
ame
Item
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam
;
import
emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam
;
import
emu.grasscutter.net.proto.WeaponUpgradeRspOuterClass.WeaponUpgradeRsp
;
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
);
super
(
PacketOpcodes
.
WeaponUpgradeRsp
);
WeaponUpgradeRsp
proto
=
WeaponUpgradeRsp
.
newBuilder
()
WeaponUpgradeRsp
proto
=
WeaponUpgradeRsp
.
newBuilder
()
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWearEquipRsp.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
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.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WearEquipRspOuterClass.WearEquipRsp
;
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
)
{
public
PacketWearEquipRsp
(
long
avatarGuid
,
long
equipGuid
)
{
super
(
PacketOpcodes
.
WearEquipRsp
);
super
(
PacketOpcodes
.
WearEquipRsp
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorktopOptionNotify.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityGadget
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorktopOptionNotifyOuterClass.WorktopOptionNotify
;
public
class
PacketWorktopOptionNotify
extends
BasePacket
{
public
PacketWorktopOptionNotify
(
EntityGadget
gadget
)
{
super
(
PacketOpcodes
.
WorktopOptionNotify
);
WorktopOptionNotify
.
Builder
proto
=
WorktopOptionNotify
.
newBuilder
()
.
setGadgetEntityId
(
gadget
.
getId
());
if
(
gadget
.
getWorktopOptions
()
!=
null
)
{
proto
.
addAllOptionList
(
gadget
.
getWorktopOptions
());
}
this
.
setData
(
proto
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketWorldDataNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PropValueOuterClass.PropValue
;
import
emu.grasscutter.net.proto.PropValueOuterClass.PropValue
;
import
emu.grasscutter.net.proto.WorldDataNotifyOuterClass.WorldDataNotify
;
import
emu.grasscutter.net.proto.WorldDataNotifyOuterClass.WorldDataNotify
;
public
class
PacketWorldDataNotify
extends
Genshin
Packet
{
public
class
PacketWorldDataNotify
extends
Base
Packet
{
public
PacketWorldDataNotify
(
World
world
)
{
public
PacketWorldDataNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldDataNotify
);
super
(
PacketOpcodes
.
WorldDataNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerDieNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
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.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType
;
import
emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType
;
import
emu.grasscutter.net.proto.WorldPlayerDieNotifyOuterClass.WorldPlayerDieNotify
;
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
)
{
public
PacketWorldPlayerDieNotify
(
PlayerDieType
playerDieType
,
int
killerId
)
{
super
(
PacketOpcodes
.
WorldPlayerDieNotify
);
super
(
PacketOpcodes
.
WorldPlayerDieNotify
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerInfoNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify
;
import
emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify
;
public
class
PacketWorldPlayerInfoNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerInfoNotify
extends
Base
Packet
{
public
PacketWorldPlayerInfoNotify
(
World
world
)
{
public
PacketWorldPlayerInfoNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldPlayerInfoNotify
);
super
(
PacketOpcodes
.
WorldPlayerInfoNotify
);
...
@@ -14,7 +14,7 @@ public class PacketWorldPlayerInfoNotify extends GenshinPacket {
...
@@ -14,7 +14,7 @@ public class PacketWorldPlayerInfoNotify extends GenshinPacket {
WorldPlayerInfoNotify
.
Builder
proto
=
WorldPlayerInfoNotify
.
newBuilder
();
WorldPlayerInfoNotify
.
Builder
proto
=
WorldPlayerInfoNotify
.
newBuilder
();
for
(
int
i
=
0
;
i
<
world
.
getPlayers
().
size
();
i
++)
{
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
.
addPlayerInfoList
(
p
.
getOnlinePlayerInfo
());
proto
.
addPlayerUidList
(
p
.
getUid
());
proto
.
addPlayerUidList
(
p
.
getUid
());
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerLocationNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorldPlayerLocationNotifyOuterClass.WorldPlayerLocationNotify
;
import
emu.grasscutter.net.proto.WorldPlayerLocationNotifyOuterClass.WorldPlayerLocationNotify
;
public
class
PacketWorldPlayerLocationNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerLocationNotify
extends
Base
Packet
{
public
PacketWorldPlayerLocationNotify
(
World
world
)
{
public
PacketWorldPlayerLocationNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldPlayerLocationNotify
);
super
(
PacketOpcodes
.
WorldPlayerLocationNotify
);
WorldPlayerLocationNotify
.
Builder
proto
=
WorldPlayerLocationNotify
.
newBuilder
();
WorldPlayerLocationNotify
.
Builder
proto
=
WorldPlayerLocationNotify
.
newBuilder
();
for
(
Genshin
Player
p
:
world
.
getPlayers
())
{
for
(
Player
p
:
world
.
getPlayers
())
{
proto
.
addPlayerLocList
(
p
.
getWorldPlayerLocationInfo
());
proto
.
addPlayer
World
LocList
(
p
.
getWorldPlayerLocationInfo
());
}
}
this
.
setData
(
proto
);
this
.
setData
(
proto
);
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerRTTNotify.java
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.game.World
;
import
emu.grasscutter.game.
world.
World
;
import
emu.grasscutter.net.packet.
Genshin
Packet
;
import
emu.grasscutter.net.packet.
Base
Packet
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PlayerRTTInfoOuterClass.PlayerRTTInfo
;
import
emu.grasscutter.net.proto.PlayerRTTInfoOuterClass.PlayerRTTInfo
;
import
emu.grasscutter.net.proto.WorldPlayerRTTNotifyOuterClass.WorldPlayerRTTNotify
;
import
emu.grasscutter.net.proto.WorldPlayerRTTNotifyOuterClass.WorldPlayerRTTNotify
;
public
class
PacketWorldPlayerRTTNotify
extends
Genshin
Packet
{
public
class
PacketWorldPlayerRTTNotify
extends
Base
Packet
{
public
PacketWorldPlayerRTTNotify
(
World
world
)
{
public
PacketWorldPlayerRTTNotify
(
World
world
)
{
super
(
PacketOpcodes
.
WorldPlayerRTTNotify
);
super
(
PacketOpcodes
.
WorldPlayerRTTNotify
);
WorldPlayerRTTNotify
.
Builder
proto
=
WorldPlayerRTTNotify
.
newBuilder
();
WorldPlayerRTTNotify
.
Builder
proto
=
WorldPlayerRTTNotify
.
newBuilder
();
for
(
Genshin
Player
player
:
world
.
getPlayers
())
{
for
(
Player
player
:
world
.
getPlayers
())
{
proto
.
addPlayerRttList
(
proto
.
addPlayerRttList
(
PlayerRTTInfo
.
newBuilder
()
PlayerRTTInfo
.
newBuilder
()
.
setUid
(
player
.
getUid
())
.
setUid
(
player
.
getUid
())
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketWorldPlayerReviveRsp.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.player.Player
;
import
emu.grasscutter.game.world.World
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.WorldPlayerReviveRspOuterClass.WorldPlayerReviveRsp
;
public
class
PacketWorldPlayerReviveRsp
extends
BasePacket
{
public
PacketWorldPlayerReviveRsp
()
{
super
(
PacketOpcodes
.
WorldPlayerReviveRsp
);
WorldPlayerReviveRsp
.
Builder
proto
=
WorldPlayerReviveRsp
.
newBuilder
();
this
.
setData
(
proto
.
build
());
}
}
src/main/java/emu/grasscutter/task/Task.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.task
;
import
org.quartz.JobDataMap
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
/*
* So what is cron expression?
The format of a Cron expression is as follows.
Second Minute Hour Day Month Week Year
Seconds: 0-59
Minute: 0-59
hour: 0-23
Day: 1-31
Month: 1-12
Week: 1-7 (0-6 sometimes)
Year: Specify your own
If you want to express every second or every minute or something like that, use the * symbol in that position;
if you want to express more than one such as every 15 minutes and every 30 minutes, you can write:`15, 30`.
For the rest of the wildcard characters, please Google them yourself
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Task
{
String
taskName
()
default
"NO_NAME"
;
String
taskCronExpression
()
default
"0 0 0 0 0 ?"
;
String
triggerName
()
default
"NO_NAME"
;
boolean
executeImmediatelyAfterReset
()
default
false
;
boolean
executeImmediately
()
default
false
;
}
src/main/java/emu/grasscutter/task/TaskHandler.java
0 → 100644
View file @
01b190bc
package
emu.grasscutter.task
;
import
org.quartz.*
;
@PersistJobDataAfterExecution
public
abstract
class
TaskHandler
implements
Job
{
public
void
restartExecute
()
throws
JobExecutionException
{
execute
(
null
);
}
public
abstract
void
onEnable
();
public
abstract
void
onDisable
();
}
Prev
1
…
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