raklib

package module
v0.0.0-...-b0f274e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2018 License: GPL-3.0 Imports: 2 Imported by: 0

README

Raklib

This project was archived. Because Raklib(By PMMP-Team) has license problem for me.

This is Raknet library written in Go for Medaka.

These code are rewritten in Go based on Raklib (by PocketMine-Team).

This project is not affiliated with Jenkins Software LLC nor RakNet.

License

There are these programs under the GPLv3 License.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Documentation

Index

Constants

View Source
const (
	// Version is version of the Raknet library
	Version = "v1.0.0"

	// ProtocolVersion is supported version of raknet protocol
	ProtocolVersion = 8
)
View Source
const (
	Magic = "00ffff00fefefefefdfdfdfd12345678"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NoSetBufferError

type NoSetBufferError struct {
}

func (NoSetBufferError) Error

func (e NoSetBufferError) Error() string

type Packet

type Packet interface {
	ID() byte
	New() Packet
	Encode() error
	Decode() error
}

Packet is basic Raknet packet interface

type SystemAddress

type SystemAddress struct {
	IP   net.IP
	Port uint16
}

SystemAddress is internal address for Raknet

func NewSystemAddress

func NewSystemAddress(addr string, port uint16) *SystemAddress

NewSystemAddress returns a new SystemAddress from string

func NewSystemAddressBytes

func NewSystemAddressBytes(addr []byte, port uint16) *SystemAddress

NewSystemAddress returns a new SystemAddress from bytes

func (*SystemAddress) Equal

func (addr *SystemAddress) Equal(sub *SystemAddress) bool

Equal returns whether sub is the same address

func (*SystemAddress) IsLoopback

func (addr *SystemAddress) IsLoopback() bool

IsLoopback returns whether this is loopback address

func (*SystemAddress) SetLoopback

func (addr *SystemAddress) SetLoopback()

SetLoopback sets loopback address

func (*SystemAddress) String

func (addr *SystemAddress) String() string

String returns as string Format: 192.168.11.1:8080, [fc00::]:8080

func (*SystemAddress) Version

func (addr *SystemAddress) Version() int

Version returns the ip address version (4 or 6)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL