Documentation ¶
Index ¶
- Variables
- type Error
- type Realms
- func (r *Realms) Address(s Server) (string, error)
- func (r *Realms) Available() (ok bool, err error)
- func (r *Realms) Backups(s Server) ([]int, error)
- func (r *Realms) Compatible() (string, error)
- func (r *Realms) Invite(s Server, name, uuid string) error
- func (r *Realms) Ops(s Server) (ops []string, err error)
- func (r *Realms) Server(ID int) (s Server, err error)
- func (r *Realms) SubscriptionLife(s Server) (startDate int64, daysLeft int, Type string, err error)
- func (r *Realms) TOS() error
- func (r *Realms) Worlds() ([]Server, error)
- type Server
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Domain = "https://pc.realms.minecraft.net"
Domain is the URL of Realms API server Panic if it cannot be parsed by url.Parse().
Functions ¶
This section is empty.
Types ¶
type Realms ¶
type Realms struct {
// contains filtered or unexported fields
}
Example ¶
var r *Realms r = New( "1.14.4", "Name", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", ) fmt.Println(r.Available()) fmt.Println(r.Compatible()) servers, err := r.Worlds() if err != nil { panic(err) } for _, v := range servers { fmt.Println(v.Name, v.ID) } time.Sleep(time.Second * 5) if err := r.TOS(); err != nil { panic(err) } time.Sleep(time.Second * 5) fmt.Println(r.Address(servers[0]))
Output:
func (*Realms) Address ¶
Address used to get the IP address for a server. Call TOS before you call this function.
func (*Realms) Available ¶
Available returns whether the user can access the Minecraft Realms service
func (*Realms) Compatible ¶
Compatible returns whether the clients version is up-to-date with Realms.
if the client is outdated, it returns OUTDATED, if the client is running a snapshot, it returns OTHER, else it returns COMPATIBLE.
func (*Realms) Ops ¶
Ops returns a list of operators for this server. You must own this server to view this.
func (*Realms) Server ¶
Server returns a single server listing about a server. you must be the owner of the server.
func (*Realms) SubscriptionLife ¶
SubscriptionLife returns the current life of a server subscription.
type Server ¶
type Server struct { ID int RemoteSubscriptionID string Owner string OwnerUUID string Name string MOTD string State string DaysLeft int Expired bool ExpiredTrial bool WorldType string Players []string MaxPlayers int MiniGameName *string MiniGameID *int MinigameImage *string ActiveSlot int // Slots interface{} Member bool }
Click to show internal directories.
Click to hide internal directories.