func AddHandler(name string, h HandlerFunc) {
	if _, ok := Handlers[name]; ok {
		log.Warning.Printf("Attempted to bind a handler to handlers '%v' which is already handled elsewhere.  Ignoring bind.\n", name)
		return
	}
	Handlers[name] = h
}
AddHandler Adds and assigns the packethandler to the handlers with the specified name.
package world
import (
	"github.com/BurntSushi/toml"
	"github.com/spkaeros/rscgo/pkg/config"
	"github.com/spkaeros/rscgo/pkg/game/net"
	"github.com/spkaeros/rscgo/pkg/log"
)
type HandlerFunc = func(*Player, *net.Packet)
var Handlers = make(map[string]HandlerFunc)
var pDefinitions packetList
type packetDefinition struct {
	Opcode int    `toml:"opcode"`
	Name   string `toml:"name"`
}
type packetList struct {
	Set []packetDefinition `toml:"packets"`
}
func init() {
}
func UnmarshalPackets() {
	if _, err := toml.DecodeFile(config.PacketHandlers(), &pDefinitions); err != nil {
		log.Error.Fatalln("Could not open handlers handler pDefinitions data file:", err)
		return
	}
}
func Handler(opcode byte) HandlerFunc {
	for _, h := range pDefinitions.Set {
		if byte(h.Opcode) == opcode {
			return Handlers[h.Name]
		}
	}
	return nil
}