From ef1fabe9c55e4ea5fb161a12fffd9c30cef80307 Mon Sep 17 00:00:00 2001 From: Tnze Date: Fri, 10 Dec 2021 19:53:42 +0800 Subject: [PATCH] Update packetid.go --- bot/pinglist.go | 2 +- data/packetid/packetid.go | 22 ++++++++++++++-------- server/ping.go | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/bot/pinglist.go b/bot/pinglist.go index a212160..0314090 100644 --- a/bot/pinglist.go +++ b/bot/pinglist.go @@ -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 { diff --git a/data/packetid/packetid.go b/data/packetid/packetid.go index 3ed7a71..116d9bb 100644 --- a/data/packetid/packetid.go +++ b/data/packetid/packetid.go @@ -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 diff --git a/server/ping.go b/server/ping.go index 3128f14..576f192 100644 --- a/server/ping.go +++ b/server/ping.go @@ -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 {