func SetChatMessageCallback(cb func(string, *Room, interface{})) {
	if !serverStarted {
		chatMessageCallback = cb
		chatMessageCallbackSet = true
	}
}
SetChatMessageCallback sets the callback function for when a *User sends a chat message to a *Room.
The function passed must have the same parameter types as the following example:

func onChatMessage(userName string, room *core.Room, message interface{}) {
//code...
}
package core
import (
	"errors"
	"github.com/gorilla/websocket"
	"github.com/hewiefreeman/GopherGameServer/helpers"
)
const (
	MessageTypeChat = iota
	MessageTypeServer
)
const (
	ServerMessageGame = iota
	ServerMessageNotice
	ServerMessageImportant
)
var (
	privateMessageCallback    func(*User, *User, interface{})
	privateMessageCallbackSet bool
	chatMessageCallback       func(string, *Room, interface{})
	chatMessageCallbackSet    bool
	serverMessageCallback     func(*Room, int, interface{})
	serverMessageCallbackSet  bool
)
func (u *User) PrivateMessage(userName string, message interface{}) {
	user, userErr := GetUser(userName)
	if userErr != nil {
		return
	}
	theMessage := map[string]map[string]interface{}{
		helpers.ServerActionPrivateMessage: {
			"f": u.name,     
			"t": user.name,  
			"m": message,
		},
	}
	user.mux.Lock()
	for _, conn := range user.conns {
		(*conn).socket.WriteJSON(theMessage)
	}
	user.mux.Unlock()
	u.mux.Lock()
	for _, conn := range u.conns {
		(*conn).socket.WriteJSON(theMessage)
	}
	u.mux.Unlock()
	if privateMessageCallbackSet {
		privateMessageCallback(u, user, message)
	}
	return
}
func (u *User) DataMessage(data interface{}, connID string) {
	message := map[string]interface{}{
		helpers.ServerActionDataMessage: data,
	}
	u.mux.Lock()
	if connID == "" {
		for _, conn := range u.conns {
			(*conn).socket.WriteJSON(message)
		}
	} else {
		if conn, ok := u.conns[connID]; ok {
			(*conn).socket.WriteJSON(message)
		}
	}
	u.mux.Unlock()
}
func (r *Room) ServerMessage(message interface{}, messageType int, recipients []string) error {
	if message == nil {
		return errors.New("*Room.ServerMessage() requires a message")
	}
	if serverMessageCallbackSet {
		serverMessageCallback(r, messageType, message)
	}
	return r.sendMessage(MessageTypeServer, messageType, recipients, "", message)
}
func (r *Room) ChatMessage(author string, message interface{}) error {
	if len(author) == 0 {
		return errors.New("*Room.ChatMessage() requires an author")
	} else if message == nil {
		return errors.New("*Room.ChatMessage() requires a message")
	}
	if chatMessageCallbackSet {
		chatMessageCallback(author, r, message)
	}
	return r.sendMessage(MessageTypeChat, 0, nil, author, message)
}
func (r *Room) DataMessage(message interface{}, recipients []string) error {
	userMap, err := r.GetUserMap()
	if err != nil {
		return err
	}
	theMessage := map[string]interface{}{
		helpers.ServerActionDataMessage: message,
	}
	if recipients == nil || len(recipients) == 0 {
		for _, u := range userMap {
			u.mux.Lock()
			for _, conn := range u.conns {
				conn.socket.WriteJSON(theMessage)
			}
			u.mux.Unlock()
		}
	} else {
		for i := 0; i < len(recipients); i++ {
			if u, ok := userMap[recipients[i]]; ok {
				u.mux.Lock()
				for _, conn := range u.conns {
					conn.socket.WriteJSON(theMessage)
				}
				u.mux.Unlock()
			}
		}
	}
	return nil
}
func (r *Room) sendMessage(mt int, st int, rec []string, a string, m interface{}) error {
	userMap, err := r.GetUserMap()
	if err != nil {
		return err
	}
	message := map[string]map[string]interface{}{
		helpers.ServerActionRoomMessage: make(map[string]interface{}),
	}
	if mt == MessageTypeServer {
		message[helpers.ServerActionRoomMessage]["s"] = st
	}
	if len(a) > 0 && mt != MessageTypeServer {
		message[helpers.ServerActionRoomMessage]["a"] = a
	}
	message[helpers.ServerActionRoomMessage]["m"] = m
	if rec == nil || len(rec) == 0 {
		for _, u := range userMap {
			u.mux.Lock()
			for _, conn := range u.conns {
				conn.socket.WriteJSON(message)
			}
			u.mux.Unlock()
		}
	} else {
		for i := 0; i < len(rec); i++ {
			if u, ok := userMap[rec[i]]; ok {
				u.mux.Lock()
				for _, conn := range u.conns {
					conn.socket.WriteJSON(message)
				}
				u.mux.Unlock()
			}
		}
	}
	return nil
}
func (r *Room) VoiceStream(userName string, userSocket *websocket.Conn, stream interface{}) {
	userMap, err := r.GetUserMap()
	if err != nil {
		return
	}
	theMessage := map[string]map[string]interface{}{
		helpers.ServerActionVoiceStream: {
			"u": userName,
			"d": stream,
		},
	}
	delete(userMap, userName)  
	for _, u := range userMap {
		for _, conn := range u.conns {
			(*conn).socket.WriteJSON(theMessage)
		}
	}
	pingMessage := map[string]interface{}{
		helpers.ServerActionVoicePing: nil,
	}
	userSocket.WriteJSON(pingMessage)
	return
}
func SetPrivateMessageCallback(cb func(*User, *User, interface{})) {
	if !serverStarted {
		privateMessageCallback = cb
		privateMessageCallbackSet = true
	}
}