Documentation ¶
Index ¶
- Constants
- Variables
- func BlendColors(c1, c2 color.RGBA) (ret color.RGBA)
- func Clamp(a, b int) int
- func CleanupName(name string) string
- func ConnectServer(ctx context.Context, address string, ClientData *login.ClientData, ...) (serverConn *minecraft.Conn, err error)
- func GetLocalIP() string
- func GetPacks(server *minecraft.Conn) (packs map[string]*resource.Pack, err error)
- func GetRealmsApi() *realms.Client
- func GetTokenSource() oauth2.TokenSource
- func IPPrivate(ip net.IP) bool
- func Img2rgba(img *image.RGBA) []color.RGBA
- func InitDNS()
- func LERP(p1, p2, alpha float64) float64
- func MarginLines(lines []string) string
- func PacketLogger(header packet.Header, payload []byte, src, dst net.Addr)
- func RegisterCommand(sub subcommands.Command)
- func ServerInput(ctx context.Context, server string) (address, name string, err error)
- func SplitExt(filename string) (name, ext string)
- func UnpackZip(r io.ReaderAt, size int64, unpack_folder string)
- func User_input(ctx context.Context, q string) (string, bool)
- func ZipFolder(filename, folder string) error
- type ConnectCallback
- type DNSServer
- type IngameCommand
- type PacketCallback
- type PacketFunc
- type ProxyContext
- func (p *ProxyContext) AddCommand(cmd IngameCommand)
- func (p *ProxyContext) CommandHandlerPacketCB(pk packet.Packet, proxy *ProxyContext, toServer bool) (packet.Packet, error)
- func (p *ProxyContext) Run(ctx context.Context, server_address string) (err error)
- func (p *ProxyContext) SendMessage(text string)
- func (p *ProxyContext) SendPopup(text string)
- type RealmListCMD
Constants ¶
View Source
const SERVER_ADDRESS_HELP = `accepted server address formats:
123.234.123.234
123.234.123.234:19132
realm:<Realmname>
realm:<Realmname>:<Id>
`
View Source
const TOKEN_FILE = "token.json"
Variables ¶
View Source
var ( G_debug bool G_preload_packs bool G_interactive bool )
View Source
var A string
View Source
var Client_addr net.Addr
View Source
var ExtraVerbose []string
View Source
var G_disconnect_reason = "Connection lost"
View Source
var G_realms_api *realms.Client
View Source
var G_token_src oauth2.TokenSource
View Source
var MutedPackets = []string{
"packet.UpdateBlock",
"packet.MoveActorAbsolute",
"packet.SetActorMotion",
"packet.SetTime",
"packet.RemoveActor",
"packet.AddActor",
"packet.UpdateAttributes",
"packet.Interact",
"packet.LevelEvent",
"packet.SetActorData",
"packet.MoveActorDelta",
"packet.MovePlayer",
"packet.BlockActorData",
"packet.PlayerAuthInput",
"packet.LevelChunk",
"packet.LevelSoundEvent",
"packet.ActorEvent",
"packet.NetworkChunkPublisherUpdate",
"packet.UpdateSubChunkBlocks",
"packet.SubChunk",
"packet.SubChunkRequest",
"packet.Animate",
"packet.NetworkStackLatency",
"packet.InventoryTransaction",
"packet.PlaySound",
}
View Source
var Pool = packet.NewPool()
View Source
var PrivateIPNetworks = []net.IPNet{ { IP: net.ParseIP("10.0.0.0"), Mask: net.CIDRMask(8, 32), }, { IP: net.ParseIP("172.16.0.0"), Mask: net.CIDRMask(12, 32), }, { IP: net.ParseIP("192.168.0.0"), Mask: net.CIDRMask(16, 32), }, }
View Source
var Updater = &selfupdate.Updater{ CurrentVersion: Version, ApiURL: updateServer, BinURL: updateServer, Dir: "update/", CmdName: "bedrocktool", }
View Source
var ValidCMDs = make(map[string]string, 0)
View Source
var Version string
Functions ¶
func ConnectServer ¶
func ConnectServer(ctx context.Context, address string, ClientData *login.ClientData, want_packs bool, packetFunc PacketFunc) (serverConn *minecraft.Conn, err error)
func GetRealmsApi ¶
func GetTokenSource ¶
func GetTokenSource() oauth2.TokenSource
func RegisterCommand ¶
func RegisterCommand(sub subcommands.Command)
func ServerInput ¶
Types ¶
type ConnectCallback ¶
type ConnectCallback func(proxy *ProxyContext)
type IngameCommand ¶
type PacketCallback ¶
type ProxyContext ¶
type ProxyContext struct { Server *minecraft.Conn Client *minecraft.Conn Listener *minecraft.Listener // called for every packet PacketFunc PacketFunc // called after game started ConnectCB ConnectCallback // called on every packet after login PacketCB PacketCallback // contains filtered or unexported fields }
func NewProxy ¶
func NewProxy(log *logrus.Logger) *ProxyContext
func (*ProxyContext) AddCommand ¶
func (p *ProxyContext) AddCommand(cmd IngameCommand)
func (*ProxyContext) CommandHandlerPacketCB ¶
func (p *ProxyContext) CommandHandlerPacketCB(pk packet.Packet, proxy *ProxyContext, toServer bool) (packet.Packet, error)
func (*ProxyContext) Run ¶
func (p *ProxyContext) Run(ctx context.Context, server_address string) (err error)
func (*ProxyContext) SendMessage ¶
func (p *ProxyContext) SendMessage(text string)
func (*ProxyContext) SendPopup ¶
func (p *ProxyContext) SendPopup(text string)
type RealmListCMD ¶
type RealmListCMD struct{}
func (*RealmListCMD) Execute ¶
func (c *RealmListCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus
func (*RealmListCMD) Name ¶
func (*RealmListCMD) Name() string
func (*RealmListCMD) SetFlags ¶
func (c *RealmListCMD) SetFlags(f *flag.FlagSet)
func (*RealmListCMD) Synopsis ¶
func (*RealmListCMD) Synopsis() string
func (*RealmListCMD) Usage ¶
func (c *RealmListCMD) Usage() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.