This repository has been archived on 2026-10-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Ananta-ps/pkg/protocol/models/world_codec.go
T

68 lines
2.1 KiB
Go

package models
import (
"encoding/json"
"sync"
)
var _ = json.RawMessage{}
var _ = sync.Mutex{}
//
// Typed factories for world/game-scene messages. The wire layout itself lives in Drmk.RpcTypes.
// Large world/profile packets are built as RpcTypes DTOs by RuntimePayloadFactory and serialized on the fly.
//
type WorldCodec struct {
}
//
// UX.Game.BattleMoveActionType — authoritative values from
// ux_rpc/ux_game_all.dump.cs:21040 (IL2CPP TypeDefIndex 32492).
// This is the moveId byte of SyncUnitPositionAndFacing, SyncUnitPositionP and
// SyncManagedLogicAgent, and of every BattleMoveDataBase subclass. The enum itself is
// an int in the client, but the wire field is a single byte.
// Unknown (0) means "no locomotion state" — a unit pushed with it slides instead of walking, which
// is why server-driven movement used to look stiff.
//
type MoveAction struct {
All []any `json:"all"`
}
const (
MoveAction_Unknown byte = 0
MoveAction_Idle byte = 1
MoveAction_WalkFront byte = 2
MoveAction_WalkBack byte = 3
MoveAction_WalkLeft byte = 4
MoveAction_WalkRight byte = 5
MoveAction_Run byte = 6
MoveAction_Min byte = MoveAction_Unknown
MoveAction_Max byte = MoveAction_Run
)
//
// UX.Game.SetPositionTypeForClient — authoritative values from
// ux_rpc/ux_game_all.dump.cs:15656 (IL2CPP TypeDefIndex 32205).
// ⚠️ Gm is NOT a prerequisite for moving the main character: the value that matters less
// than the packet. Moving the local avatar via SyncUnitPosition_P fails no matter which
// type is used (NetworkGhostModule demands NetworkRoleType.Proxy); use
// SyncUnitPositionAndFacing with the default SwitchSpirit instead — that is what
// the donor server's own teleport API does and it lands the player.
//
type SetPositionType struct {
}
const (
SetPositionType_Force byte = 0
SetPositionType_RejectSync byte = 1
SetPositionType_Revive byte = 2
SetPositionType_SwitchSpirit byte = 3
SetPositionType_SpoonNoLoading byte = 4
SetPositionType_FallGround byte = 5
SetPositionType_Teleport byte = 6
SetPositionType_Gm byte = 7
SetPositionType_Portal byte = 8
SetPositionType_OutOfStuck byte = 9
)