Update packetid.go

This commit is contained in:
Tnze
2021-12-10 19:53:42 +08:00
parent 40151f803b
commit ef1fabe9c5
3 changed files with 16 additions and 10 deletions

View File

@ -97,7 +97,7 @@ func pingAndList(addr string, conn *mcnet.Conn) ([]byte, time.Duration, error) {
//PING
startTime := time.Now()
err = conn.WritePacket(pk.Marshal(
packetid.StatusPing,
packetid.StatusPingRequest,
pk.Long(startTime.Unix()),
))
if err != nil {

View File

@ -19,13 +19,13 @@ const (
// Status Clientbound
const (
StatusResponse = iota
StatusPong
StatusPongResponse
)
// Game Serverbound
// Status Serverbound
const (
StatusRequest = iota
StatusPing
StatusPingRequest
)
// Game Clientbound
@ -64,16 +64,16 @@ const (
ClientboundHorseScreenOpen
ClientboundInitializeBorder
ClientboundKeepAlive
ClientboundLevelChunk
ClientboundLevelChunkWithLight
ClientboundLevelEvent
ClientboundLevelParticles
ClientboundLightUpdate
ClientboundLogin
ClientboundMapItemData
ClientboundMerchantOffers
ClientboundEntityPosition
ClientboundEntityPositionAndRotation
ClientboundEntityRotation
ClientboundMoveEntityPos
ClientboundMoveEntityPosRot
ClientboundMoveEntityRot
ClientboundMoveVehicle
ClientboundOpenBook
ClientboundOpenScreen
@ -117,7 +117,7 @@ const (
ClientboundSetPassengers
ClientboundSetPlayerTeam
ClientboundSetScore
ClientboundUpdateSimulationDistance
ClientboundSetSimulationDistance
ClientboundSetSubtitleText
ClientboundSetTime
ClientboundSetTitleText
@ -139,6 +139,7 @@ const (
// Game Serverbound
const (
ServerboundAcceptTeleportation = iota
ServerboundBlockEntityTagQuery
ServerboundChangeDifficulty
ServerboundChat
ServerboundClientCommand
@ -149,10 +150,15 @@ const (
ServerboundContainerClose
ServerboundCustomPayload
ServerboundEditBook
ServerboundEntityTagQuery
ServerboundInteract
ServerboundJigsawGenerate
ServerboundKeepAlive
ServerboundLockDifficulty
ServerboundMovePlayerPos
ServerboundMovePlayerPosRot
ServerboundMovePlayerRot
ServerboundMovePlayerStatusOnly
ServerboundMoveVehicle
ServerboundPaddleBoat
ServerboundPickItem

View File

@ -40,7 +40,7 @@ func (s *Server) acceptListPing(conn *net.Conn) {
break
}
err = conn.WritePacket(pk.Marshal(0x00, pk.String(resp)))
case packetid.StatusPong: //Ping
case packetid.StatusPongResponse: //Ping
err = conn.WritePacket(p)
}
if err != nil {