Update packetid.go
This commit is contained in:
@ -97,7 +97,7 @@ func pingAndList(addr string, conn *mcnet.Conn) ([]byte, time.Duration, error) {
|
|||||||
//PING
|
//PING
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
err = conn.WritePacket(pk.Marshal(
|
err = conn.WritePacket(pk.Marshal(
|
||||||
packetid.StatusPing,
|
packetid.StatusPingRequest,
|
||||||
pk.Long(startTime.Unix()),
|
pk.Long(startTime.Unix()),
|
||||||
))
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -19,13 +19,13 @@ const (
|
|||||||
// Status Clientbound
|
// Status Clientbound
|
||||||
const (
|
const (
|
||||||
StatusResponse = iota
|
StatusResponse = iota
|
||||||
StatusPong
|
StatusPongResponse
|
||||||
)
|
)
|
||||||
|
|
||||||
// Game Serverbound
|
// Status Serverbound
|
||||||
const (
|
const (
|
||||||
StatusRequest = iota
|
StatusRequest = iota
|
||||||
StatusPing
|
StatusPingRequest
|
||||||
)
|
)
|
||||||
|
|
||||||
// Game Clientbound
|
// Game Clientbound
|
||||||
@ -64,16 +64,16 @@ const (
|
|||||||
ClientboundHorseScreenOpen
|
ClientboundHorseScreenOpen
|
||||||
ClientboundInitializeBorder
|
ClientboundInitializeBorder
|
||||||
ClientboundKeepAlive
|
ClientboundKeepAlive
|
||||||
ClientboundLevelChunk
|
ClientboundLevelChunkWithLight
|
||||||
ClientboundLevelEvent
|
ClientboundLevelEvent
|
||||||
ClientboundLevelParticles
|
ClientboundLevelParticles
|
||||||
ClientboundLightUpdate
|
ClientboundLightUpdate
|
||||||
ClientboundLogin
|
ClientboundLogin
|
||||||
ClientboundMapItemData
|
ClientboundMapItemData
|
||||||
ClientboundMerchantOffers
|
ClientboundMerchantOffers
|
||||||
ClientboundEntityPosition
|
ClientboundMoveEntityPos
|
||||||
ClientboundEntityPositionAndRotation
|
ClientboundMoveEntityPosRot
|
||||||
ClientboundEntityRotation
|
ClientboundMoveEntityRot
|
||||||
ClientboundMoveVehicle
|
ClientboundMoveVehicle
|
||||||
ClientboundOpenBook
|
ClientboundOpenBook
|
||||||
ClientboundOpenScreen
|
ClientboundOpenScreen
|
||||||
@ -117,7 +117,7 @@ const (
|
|||||||
ClientboundSetPassengers
|
ClientboundSetPassengers
|
||||||
ClientboundSetPlayerTeam
|
ClientboundSetPlayerTeam
|
||||||
ClientboundSetScore
|
ClientboundSetScore
|
||||||
ClientboundUpdateSimulationDistance
|
ClientboundSetSimulationDistance
|
||||||
ClientboundSetSubtitleText
|
ClientboundSetSubtitleText
|
||||||
ClientboundSetTime
|
ClientboundSetTime
|
||||||
ClientboundSetTitleText
|
ClientboundSetTitleText
|
||||||
@ -139,6 +139,7 @@ const (
|
|||||||
// Game Serverbound
|
// Game Serverbound
|
||||||
const (
|
const (
|
||||||
ServerboundAcceptTeleportation = iota
|
ServerboundAcceptTeleportation = iota
|
||||||
|
ServerboundBlockEntityTagQuery
|
||||||
ServerboundChangeDifficulty
|
ServerboundChangeDifficulty
|
||||||
ServerboundChat
|
ServerboundChat
|
||||||
ServerboundClientCommand
|
ServerboundClientCommand
|
||||||
@ -149,10 +150,15 @@ const (
|
|||||||
ServerboundContainerClose
|
ServerboundContainerClose
|
||||||
ServerboundCustomPayload
|
ServerboundCustomPayload
|
||||||
ServerboundEditBook
|
ServerboundEditBook
|
||||||
|
ServerboundEntityTagQuery
|
||||||
ServerboundInteract
|
ServerboundInteract
|
||||||
ServerboundJigsawGenerate
|
ServerboundJigsawGenerate
|
||||||
ServerboundKeepAlive
|
ServerboundKeepAlive
|
||||||
ServerboundLockDifficulty
|
ServerboundLockDifficulty
|
||||||
|
ServerboundMovePlayerPos
|
||||||
|
ServerboundMovePlayerPosRot
|
||||||
|
ServerboundMovePlayerRot
|
||||||
|
ServerboundMovePlayerStatusOnly
|
||||||
ServerboundMoveVehicle
|
ServerboundMoveVehicle
|
||||||
ServerboundPaddleBoat
|
ServerboundPaddleBoat
|
||||||
ServerboundPickItem
|
ServerboundPickItem
|
||||||
|
@ -40,7 +40,7 @@ func (s *Server) acceptListPing(conn *net.Conn) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
err = conn.WritePacket(pk.Marshal(0x00, pk.String(resp)))
|
err = conn.WritePacket(pk.Marshal(0x00, pk.String(resp)))
|
||||||
case packetid.StatusPong: //Ping
|
case packetid.StatusPongResponse: //Ping
|
||||||
err = conn.WritePacket(p)
|
err = conn.WritePacket(p)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user