lua

package
v0.0.0-...-bce320a Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// I18nMetaTableName the name of the i18n metatable
	I18nMetaTableName = "i18n"

	// ExtensionMetaTableName the name of the extension metatable
	ExtensionMetaTableName = "extension"

	// OutfitMetaTableName the name of the outfit metatable
	OutfitMetaTableName = "outfit"

	// FormFileMetaTableName the name of the form file metatable
	FormFileMetaTableName = "formFile"

	// GlobalMetaTableName the name of the global metatable
	GlobalMetaTableName = "global"

	// LogMetaTableName the name of the log metatable
	LogMetaTableName = "log"

	// EnvMetaTableName the name of the env metatable
	EnvMetaTableName = "env"

	// FileMetaTableName the name of the file metatable
	FileMetaTableName = "file"

	// GoImageMetaTableName the name of the goimage metatable
	GoImageMetaTableName = "goimage"

	// ImageMetaTableName the name of the image metatable
	ImageMetaTableName = "image"

	// PayPalMetaTableName the name of the paypal metatable
	PayPalMetaTableName = "paypal"

	// EventMetaTableName the name of the current event metatable
	EventMetaTableName = "event"

	// EventsMetaTableName the name of the widget metatable
	EventsMetaTableName = "events"

	// WidgetMetaTableName the name of the widget metatable
	WidgetMetaTableName = "widgets"

	// PlayerMetaTableName the name of the player metatable
	PlayerMetaTableName = "player"

	// StorageMetaTableName the name of the storage metatable
	StorageMetaTableName = "storage"

	// JSONMetaTableName the name of the json metatable
	JSONMetaTableName = "json"

	// ReflectMetaTableName the name of the reflect metatable
	ReflectMetaTableName = "reflect"

	// TimeMetaTableName the name of the time metatable
	TimeMetaTableName = "time"

	// URLMetaTableName the name of the url metatable
	URLMetaTableName = "url"

	// DebugMetaTableName the name of the debug metatable
	DebugMetaTableName = "debug"

	// CacheMetaTableName the name of the cache metatable
	CacheMetaTableName = "cache"

	// MailMetaTableName the name of the mail metatable
	MailMetaTableName = "mail"

	// XMLMetaTableName the name of the xml metatable
	XMLMetaTableName = "xml"

	// MapMetaTableName the name of the map metatable
	MapMetaTableName = "otbm"

	// CaptchaMetaTableName the name of the captcha metatable
	CaptchaMetaTableName = "captcha"

	// CryptoMetaTableName the name of the crypto metatable
	CryptoMetaTableName = "crypto"

	// Base64MetaTableName the name of the log metatable
	Base64MetaTableName = "base64"

	// ValidatorMetaTableName the name of the validator metatable
	ValidatorMetaTableName = "validator"

	// SessionMetaTable the name of the session metatable
	SessionMetaTable = "session"

	// SessionInstanceName the field name of the session instance
	SessionInstanceName = "__s"

	// DatabaseMetaTableName the name of the database metatable
	DatabaseMetaTableName = "db"

	// DatabaseTransactionFieldName the name of the field that holds the current database transaction
	DatabaseTransactionFieldName = "__tx"

	// DatabaseTransactionStatusFieldName the name of the field that holds if a transaction started
	DatabaseTransactionStatusFieldName = "__ts"

	// ConfigMetaTableName the name of the config metatable
	ConfigMetaTableName = "config"

	// HTTPGetValuesName the field name of the list of GET values
	HTTPGetValuesName = "getValues"

	// HTTPMetaTableName the name of the http metatable
	HTTPMetaTableName = "http"

	// HTTPMetaTableMethodName the field name of the http method
	HTTPMetaTableMethodName = "method"

	// HTTPResponseWriterName the field name of the http response writer
	HTTPResponseWriterName = "__w"

	// HTTPRequestName the field name of the http request
	HTTPRequestName = "__r"

	// HTTPPostValuesName the field name of the list of POST values
	HTTPPostValuesName = "postValues"

	// HTTPCurrentSubtopic the field name of the current subtopic uri
	HTTPCurrentSubtopic = "subtopic"

	// HTTPMetaTableBodyName the field name of the http body
	HTTPMetaTableBodyName = "body"

	// SocketMetatableName the name of the socket metatable
	SocketMetatableName = "socket"
)

Variables

View Source
var (
	// WidgetList list of widget states
	WidgetList = &stateList{
		List: make(map[string][]*glua.LState),
		Type: "widget",
	}

	// CompiledPageList list of compiled subtopic states
	CompiledPageList = &compiledStateList{
		List: make(map[string]*glua.FunctionProto),
		Type: "page",
	}
)
View Source
var Config = lua.NewState()

Config holds the current lua configuration file state

View Source
var (
	// Pool saves all lua state pointers to create a sync.Pool
	Pool = &luaStatePool{
		saved: make([]*glua.LState, 0, 10),
	}
)

Functions

func BackgroundEvent

func BackgroundEvent(L *lua.LState) int

BackgroundEvent executes a background event

func Base64Decode

func Base64Decode(L *lua.LState) int

Base64Decode decodes the given string from base64

func Base64Encode

func Base64Encode(L *lua.LState) int

Base64Encode encodes the given string to base64

func BlackList

func BlackList(L *lua.LState) int

BlackList runs govalidator blacklist func

func CheckFileExists

func CheckFileExists(L *lua.LState) int

CheckFileExists checks if the given file exists

func CheckQRCode

func CheckQRCode(L *lua.LState) int

CheckQRCode checks if the given QR token is valid for the given secret key

func CompileLua

func CompileLua(filePath string) (*glua.FunctionProto, error)

CompileLua reads the passed lua file from disk and compiles it.

func CreateDirectory

func CreateDirectory(L *lua.LState) int

CreateDirectory creates the given directory

func CreatePaypalClient

func CreatePaypalClient(sandbox bool)

CreatePaypalClient creates the paypal application client

func CreatePaypalPayment

func CreatePaypalPayment(L *lua.LState) int

CreatePaypalPayment creates a paypal payment returning the payment URL

func CreateRequestClient

func CreateRequestClient(L *glua.LState) int

CreateRequestClient creates a HTTP client

func DebugValue

func DebugValue(L *lua.LState) int

DebugValue prints the given values

func DecodeURL

func DecodeURL(L *lua.LState) int

DecodeURL decodes the given string uri

func DeleteCacheValue

func DeleteCacheValue(L *lua.LState) int

DeleteCacheValue removes a key from the cache storage

func DeleteGlobalLuaValue

func DeleteGlobalLuaValue(L *lua.LState) int

DeleteGlobalLuaValue deletes the given global value

func DestroySession

func DestroySession(L *lua.LState) int

DestroySession removes the session data from the database

func DoCompiledFile

func DoCompiledFile(state *glua.LState, proto *glua.FunctionProto) error

DoCompiledFile takes a FunctionProto, as returned by CompileLua, and runs it in the LState. It is equivalent to calling DoFile on the LState with the original source file.

func EncodeMap

func EncodeMap(L *lua.LState) int

EncodeMap encodes the server map

func EncodeURL

func EncodeURL(L *lua.LState) int

EncodeURL encodes the given string

func EscapeString

func EscapeString(L *lua.LState) int

EscapeString converts the given string into a safe to-use string Usually you dont need this for queries but just in case you do some magic

func Execute

func Execute(L *lua.LState) int

Execute executes a query without returning the result

func ExecuteControllerPage

func ExecuteControllerPage(luaState *glua.LState, method string) error

ExecuteControllerPage executes the given subtopic using call by param

func ExecuteFile

func ExecuteFile(luaState *glua.LState, path string) error

ExecuteFile calls lua dofile

func ExecutePaypalPayment

func ExecutePaypalPayment(L *lua.LState) int

ExecutePaypalPayment executes the given paypal payment

func FormFileDetectContentType

func FormFileDetectContentType(L *lua.LState) int

FormFileDetectContentType returns the form file content type

func FormFileIsValidExtension

func FormFileIsValidExtension(L *lua.LState) int

FormFileIsValidExtension checks if the current form file is a valid extension

func FormFileIsValidPNG

func FormFileIsValidPNG(L *lua.LState) int

FormFileIsValidPNG checks if the current form file is a valid png file

func GenerateAuthSecretKey

func GenerateAuthSecretKey(L *lua.LState) int

GenerateAuthSecretKey generates a valid authentication secret key

func GenerateOutfit

func GenerateOutfit(L *lua.LState) int

GenerateOutfit generates an outfit

func GenerateQRCode

func GenerateQRCode(L *lua.LState) int

GenerateQRCode generates a QR code for the given string and returns a base64 encoded image

func GetApplicationState

func GetApplicationState(luaState *glua.LState)

GetApplicationState returns a page configured lua state

func GetCacheValue

func GetCacheValue(L *lua.LState) int

GetCacheValue retrieves a value from the application cache

func GetConfigLuaValue

func GetConfigLuaValue(L *lua.LState) int

GetConfigLuaValue gets a value from the config struct using reflect

func GetCookie

func GetCookie(L *glua.LState) int

GetCookie returns the given HTTP cookie by its name

func GetDirectories

func GetDirectories(L *lua.LState) int

GetDirectories gets any directories in the provided path

func GetEnvVariable

func GetEnvVariable(L *lua.LState) int

GetEnvVariable gets the given environment variable

func GetFileModTime

func GetFileModTime(L *lua.LState) int

GetFileModTime gets the file unix timestamp

func GetFiles

func GetFiles(L *lua.LState) int

GetFiles gets a list of files for the given directory

func GetFlash

func GetFlash(L *lua.LState) int

GetFlash gets a flash value from the user session

func GetFormFile

func GetFormFile(L *glua.LState) int

GetFormFile retrieves a file input from a form

func GetFormFileByteArray

func GetFormFileByteArray(L *lua.LState) int

GetFormFileByteArray returns the form file byte array as a lua string

func GetGlobal

func GetGlobal(L *lua.LState) int

GetGlobal retrieves a global lua value from other script

func GetGlobalLuaValue

func GetGlobalLuaValue(L *lua.LState) int

GetGlobalLuaValue gets the given value from the global database table

func GetGoImageAsString

func GetGoImageAsString(L *lua.LState) int

GetGoImageAsString returns the underlying go image as a byte array string

func GetGuildLeader

func GetGuildLeader(L *lua.LState) int

GetGuildLeader retrieves the guild leader

func GetGuildMembers

func GetGuildMembers(L *lua.LState) int

GetGuildMembers retrieves guild members

func GetGuildOwner

func GetGuildOwner(L *lua.LState) int

GetGuildOwner retrieves a guild owner

func GetHeader

func GetHeader(L *glua.LState) int

GetHeader returns the given request header

func GetLanguageIndex

func GetLanguageIndex(L *lua.LState) int

GetLanguageIndex retrieves the given language index

func GetLoggedAccount

func GetLoggedAccount(L *lua.LState) int

GetLoggedAccount gets the user account if any

func GetPaypalPayment

func GetPaypalPayment(L *lua.LState) int

GetPaypalPayment gets a paypal approved payment

func GetPlayerAccountID

func GetPlayerAccountID(L *lua.LState) int

GetPlayerAccountID gets a player account ID

func GetPlayerBankBalance

func GetPlayerBankBalance(L *lua.LState) int

GetPlayerBankBalance gets a player bank balance

func GetPlayerCapacity

func GetPlayerCapacity(L *lua.LState) int

GetPlayerCapacity gets the player capacity

func GetPlayerCustomField

func GetPlayerCustomField(L *lua.LState) int

GetPlayerCustomField retrieves a field from the player table as string

func GetPlayerExperience

func GetPlayerExperience(L *lua.LState) int

GetPlayerExperience gets the player experience

func GetPlayerGender

func GetPlayerGender(L *lua.LState) int

GetPlayerGender gets the player gender

func GetPlayerGuild

func GetPlayerGuild(L *lua.LState) int

GetPlayerGuild gets a player guild

func GetPlayerLevel

func GetPlayerLevel(L *lua.LState) int

GetPlayerLevel gets the player level

func GetPlayerName

func GetPlayerName(L *lua.LState) int

GetPlayerName gets the player name

func GetPlayerPremiumDays

func GetPlayerPremiumDays(L *lua.LState) int

GetPlayerPremiumDays gets the player number of premium days

func GetPlayerPremiumEndsAt

func GetPlayerPremiumEndsAt(L *lua.LState) int

GetPlayerPremiumEndsAt gets the player premium ends at

func GetPlayerPremiumTime

func GetPlayerPremiumTime(L *lua.LState) int

GetPlayerPremiumTime gets the player remaining premium time

func GetPlayerStorageValue

func GetPlayerStorageValue(L *lua.LState) int

GetPlayerStorageValue gets a player storage value by the given key

func GetPlayerTown

func GetPlayerTown(L *lua.LState) int

GetPlayerTown gets the player town

func GetPlayerVocation

func GetPlayerVocation(L *lua.LState) int

GetPlayerVocation gets the player vocation

func GetRelativeURL

func GetRelativeURL(L *glua.LState) int

GetRelativeURL returns the relative request URL

func GetRemoteAddress

func GetRemoteAddress(L *glua.LState) int

GetRemoteAddress returns the request remote address

func GetRequest

func GetRequest(L *glua.LState) int

GetRequest performs a HTTP GET request

func GetSessionData

func GetSessionData(L *lua.LState) int

GetSessionData retrieves an element from the session map

func GetSocket

func GetSocket(L *glua.LState) int

GetSocket opens a socket to the given address and returns the response

func GetStorageValue

func GetStorageValue(L *lua.LState) int

GetStorageValue gets a storage value from the given player

func GetTownByID

func GetTownByID(L *lua.LState) int

GetTownByID grabs a town by the given ID

func GetTownByName

func GetTownByName(L *lua.LState) int

GetTownByName grabs a town by the given name

func GetVocationByID

func GetVocationByID(L *lua.LState) int

GetVocationByID gets a vocation by the given id

func GetVocationByName

func GetVocationByName(L *lua.LState) int

GetVocationByName gets a vocation by the given name

func GuildConstructor

func GuildConstructor(L *lua.LState) int

GuildConstructor returns a new guild metatable for the given ID or name

func HmacSha256

func HmacSha256(L *lua.LState) int

HmacSha256 returns the hmac-sha256 for the given message + secret

func HouseList

func HouseList(L *lua.LState) int

HouseList returns the server house list as a lua table

func IsAdmin

func IsAdmin(L *lua.LState) int

IsAdmin checks if the logged account is admin

func IsEnabled

func IsEnabled(L *lua.LState) int

IsEnabled checks if the captcha service is enabled

func IsLogged

func IsLogged(L *lua.LState) int

IsLogged checks if the current user is logged in

func IsPlayerOnline

func IsPlayerOnline(L *lua.LState) int

IsPlayerOnline checks if the given player is online

func LoadConfig

func LoadConfig(path string) error

LoadConfig loads the lua configuration file using lua vm to get the global variables

func LogError

func LogError(L *lua.LState) int

LogError logs a message with the error level

func LogFatal

func LogFatal(L *lua.LState) int

LogFatal logs a message with the fatal level

func LogInfo

func LogInfo(L *lua.LState) int

LogInfo logs a message with the info level

func MapToTable

func MapToTable(m map[string]interface{}) *lua.LTable

MapToTable converts a Go map to a lua table

func MarshalJSON

func MarshalJSON(L *lua.LState) int

MarshalJSON marshals the given lua table

func MarshalXML

func MarshalXML(L *lua.LState) int

MarshalXML marshals the given lua table

func Md5Hash

func Md5Hash(L *lua.LState) int

Md5Hash returns the md5 hash of the given string

func MergeTableFields

func MergeTableFields(src *lua.LTable, dest *lua.LTable)

MergeTableFields merges two tables into one

func MonsterByName

func MonsterByName(L *lua.LState) int

MonsterByName retrieves a monster by name

func MonsterList

func MonsterList(L *lua.LState) int

MonsterList retrieves the monster list as a lua table

func NewDuration

func NewDuration(L *lua.LState) int

NewDuration creates a time duration from the given number

func NewGoImage

func NewGoImage(L *lua.LState) int

NewGoImage creates and returns a new goimage image

func NewState

func NewState() *glua.LState

NewState creates and returns a new lua state

func OverwriteConfigFile

func OverwriteConfigFile() error

OverwriteConfigFile gathers all external config file and pushes globals

func ParseDate

func ParseDate(L *lua.LState) int

ParseDate parses the given date string with the given layout

func ParseDurationString

func ParseDurationString(L *lua.LState) int

ParseDurationString parses the given duration string to return the time in seconds

func ParseMultiPartForm

func ParseMultiPartForm(L *glua.LState) int

ParseMultiPartForm parses a multi-part form encoded

func ParseUnixTimestamp

func ParseUnixTimestamp(L *lua.LState) int

ParseUnixTimestamp returns a date object for the given timestamp

func PlayerConstructor

func PlayerConstructor(L *lua.LState) int

PlayerConstructor returns a new player metatable for the given ID or name

func PostFormRequest

func PostFormRequest(L *glua.LState) int

PostFormRequest performs a HTTP POST request

func Query

func Query(L *lua.LState) int

Query executes an ad-hoc query

func RandomString

func RandomString(L *lua.LState) int

RandomString generates a random string with the given length

func Redirect

func Redirect(L *glua.LState) int

Redirect redirects the user to the given location with a header

func ReloadExtensions

func ReloadExtensions(L *lua.LState) int

ReloadExtensions reloads all extensions

func RenderTemplate

func RenderTemplate(L *glua.LState) int

RenderTemplate renders the given template with the given data as a LUA table

func RenderWidgetTemplate

func RenderWidgetTemplate(L *lua.LState) int

RenderWidgetTemplate renders the given widget template

func SaveFormFile

func SaveFormFile(L *lua.LState) int

SaveFormFile saves the current form file to the given destination

func SaveFormFileAsJPEG

func SaveFormFileAsJPEG(L *lua.LState) int

SaveFormFileAsJPEG saves the current form file as a jpeg with resizing optional

func SaveFormFileAsPNG

func SaveFormFileAsPNG(L *lua.LState) int

SaveFormFileAsPNG saves the current form file as a png with resizing optional

func SaveGoImage

func SaveGoImage(L *lua.LState) int

SaveGoImage saves the given goimage

func SendMail

func SendMail(L *lua.LState) int

SendMail sends a mail to the given direction

func ServeFile

func ServeFile(L *glua.LState) int

ServeFile serves the given file

func SetBackgroundGoImage

func SetBackgroundGoImage(L *lua.LState) int

SetBackgroundGoImage sets the background of a goimage

func SetBase64MetaTable

func SetBase64MetaTable(luaState *lua.LState)

SetBase64MetaTable sets the base64 metatable for the given state

func SetCacheMetaTable

func SetCacheMetaTable(luaState *lua.LState)

SetCacheMetaTable sets the cache metatable of the given state

func SetCacheValue

func SetCacheValue(L *lua.LState) int

SetCacheValue sets a cache value with the given key and the given duration string

func SetCaptchaMetaTable

func SetCaptchaMetaTable(luaState *lua.LState)

SetCaptchaMetaTable sets the captcha metatable of the given state

func SetConfigCustomValue

func SetConfigCustomValue(L *lua.LState) int

SetConfigCustomValue sets the a config custom value

func SetConfigGlobal

func SetConfigGlobal(L *glua.LState)

SetConfigGlobal sets the config global value

func SetConfigMetaTable

func SetConfigMetaTable(luaState *lua.LState)

SetConfigMetaTable sets the config metatable of the given state

func SetCookie

func SetCookie(L *glua.LState) int

SetCookie sets the given HTTP cookie by its name

func SetCryptoMetaTable

func SetCryptoMetaTable(luaState *lua.LState)

SetCryptoMetaTable sets the crypto metatable of the given state

func SetDatabaseMetaTable

func SetDatabaseMetaTable(luaState *lua.LState)

SetDatabaseMetaTable sets the database metatable of the given state

func SetDebugMetaTable

func SetDebugMetaTable(luaState *lua.LState)

SetDebugMetaTable sets the debug metatable of the given state

func SetEnvMetaTable

func SetEnvMetaTable(luaState *lua.LState)

SetEnvMetaTable sets the env metatable on the given lua state

func SetEnvVariable

func SetEnvVariable(L *lua.LState) int

SetEnvVariable sets the given environment variable

func SetEventsMetaTable

func SetEventsMetaTable(luaState *lua.LState)

SetEventsMetaTable sets the event metatable of the given state

func SetExtensionMetaTable

func SetExtensionMetaTable(luaState *lua.LState)

SetExtensionMetaTable sets the extension metatable for the given state

func SetFileMetaTable

func SetFileMetaTable(luaState *lua.LState)

SetFileMetaTable sets the file metatable of the given state

func SetFlash

func SetFlash(L *lua.LState) int

SetFlash sets a flash value to the user session

func SetGlobalLuaValue

func SetGlobalLuaValue(L *lua.LState) int

SetGlobalLuaValue saves the given value into the global database table

func SetGlobalMetaTable

func SetGlobalMetaTable(luaState *lua.LState)

SetGlobalMetaTable sets the file metatable of the given state

func SetHTTPMetaTable

func SetHTTPMetaTable(luaState *glua.LState)

SetHTTPMetaTable sets the http metatable on the given lua state

func SetHTTPUserData

func SetHTTPUserData(luaState *glua.LState, w http.ResponseWriter, r *http.Request)

SetHTTPUserData sets the http metatable user data

func SetHeader

func SetHeader(L *glua.LState) int

SetHeader sets the given http header to the response writer

func SetI18nMetaTable

func SetI18nMetaTable(luaState *lua.LState)

SetI18nMetaTable sets the i18n metatable of the given state

func SetI18nUserData

func SetI18nUserData(luaState *lua.LState, lang []string)

SetI18nUserData sets the i18n language value

func SetImageMetaTable

func SetImageMetaTable(luaState *lua.LState)

SetImageMetaTable sets the image metatable of the given state

func SetJSONMetaTable

func SetJSONMetaTable(luaState *lua.LState)

SetJSONMetaTable sets the json metatable of the given state

func SetLogMetaTable

func SetLogMetaTable(luaState *lua.LState)

SetLogMetaTable sets the log metatable for the given state

func SetMailMetaTable

func SetMailMetaTable(luaState *lua.LState)

SetMailMetaTable sets the mail metatable of the given state

func SetMapMetaTable

func SetMapMetaTable(luaState *lua.LState)

SetMapMetaTable sets a map metatable for the given state

func SetOutfitMetaTable

func SetOutfitMetaTable(luaState *lua.LState)

SetOutfitMetaTable sets the outfit metatable of the given state

func SetPayPalMetaTable

func SetPayPalMetaTable(luaState *lua.LState)

SetPayPalMetaTable sets the paypal metatable of the given state

func SetPlayerBankBalance

func SetPlayerBankBalance(L *lua.LState) int

SetPlayerBankBalance sets a player bank balance

func SetPlayerCustomField

func SetPlayerCustomField(L *lua.LState) int

SetPlayerCustomField sets a fie from the player table

func SetPlayerStorageValue

func SetPlayerStorageValue(L *lua.LState) int

SetPlayerStorageValue sets a player storage value with the given key

func SetReflectMetaTable

func SetReflectMetaTable(luaState *lua.LState)

SetReflectMetaTable sets the reflect metatable of the given state

func SetRegularHTTPMetaTable

func SetRegularHTTPMetaTable(luaState *glua.LState)

SetRegularHTTPMetaTable sets the event http metatable removing some http methods

func SetSessionData

func SetSessionData(L *lua.LState) int

SetSessionData saves an item to the session map

func SetSessionMetaTable

func SetSessionMetaTable(luaState *lua.LState)

SetSessionMetaTable sets the session metatable on the given lua state

func SetSessionMetaTableUserData

func SetSessionMetaTableUserData(luaState *lua.LState, sessionData map[string]interface{})

SetSessionMetaTableUserData sets the session metatable user data

func SetSocketMetaTable

func SetSocketMetaTable(luaState *glua.LState)

SetSocketProtocolMetaTable sets the socket metatable on the given lua state

func SetStorageMetaTable

func SetStorageMetaTable(luaState *lua.LState)

SetStorageMetaTable sets the storage metatable of the given state

func SetStorageValue

func SetStorageValue(L *lua.LState) int

SetStorageValue sets a storage value for the given player

func SetTimeMetaTable

func SetTimeMetaTable(luaState *lua.LState)

SetTimeMetaTable sets the time metatable of the given state

func SetURLMetaTable

func SetURLMetaTable(luaState *lua.LState)

SetURLMetaTable sets the url metatable of the given state

func SetValidatorMetaTable

func SetValidatorMetaTable(luaState *lua.LState)

SetValidatorMetaTable sets the validator metatable of the given state

func SetWidgetHTTPMetaTable

func SetWidgetHTTPMetaTable(luaState *glua.LState)

SetWidgetHTTPMetaTable sets the widget http metatable on the given lua state

func SetXMLMetaTable

func SetXMLMetaTable(luaState *lua.LState)

SetXMLMetaTable sets the xml metatable of the given lua state

func Sha1Hash

func Sha1Hash(L *lua.LState) int

Sha1Hash returns the sha1 hash of the given string

func Sha256Hash

func Sha256Hash(L *lua.LState) int

Sha256Hash returns the sha256 hash of the given string

func SingleQuery

func SingleQuery(L *lua.LState) int

SingleQuery performs and ad-hoc query returning the first result as a table

func StringSliceToTable

func StringSliceToTable(m []string) *lua.LTable

StringSliceToTable converts a []string to a lua table

func StructToTable

func StructToTable(s interface{}) *lua.LTable

StructToTable converts a go struct pointer to a lua table

func TableToMap

func TableToMap(table *lua.LTable) map[string]interface{}

TableToMap converts a LUA table to a Go map[string]interface{}

func TableToStruct

func TableToStruct(table *lua.LTable, dst interface{})

TableToStruct populates the given struct pointer with the contents of a lua table

func TableToURLValues

func TableToURLValues(t *lua.LTable) url.Values

TableToURLValues converts a lua table to a map[string][]string

func Ternary

func Ternary(L *lua.LState) int

Ternary creates a ternary operator short-hand

func ThreadSleep

func ThreadSleep(L *lua.LState) int

ThreadSleep sleeps the current running lua state

func TownList

func TownList(L *lua.LState) int

TownList returns the server town list as a lua table

func TryCatch

func TryCatch(L *lua.LState) int

TryCatch implements a try-catch block for lua

func URLValuesToTable

func URLValuesToTable(m url.Values) *lua.LTable

URLValuesToTable converts a map[string][]string to a lua table

func UnmarshalJSON

func UnmarshalJSON(L *lua.LState) int

UnmarshalJSON unmarshals the given string to a lua table

func UnmarshalJSONFile

func UnmarshalJSONFile(L *lua.LState) int

UnmarshalJSONFile unmarshals the given file to a lua table

func UnmarshalXML

func UnmarshalXML(L *lua.LState) int

UnmarshalXML unmarshals the given string to a lua table

func UnmarshalXMLFile

func UnmarshalXMLFile(L *lua.LState) int

UnmarshalXMLFile unmarshals the given fle

func UnzipFile

func UnzipFile(L *lua.LState) int

Unzip will decompress a zip archive, moving all files and folders within the zip file to the given directory

func ValidGender

func ValidGender(L *lua.LState) int

ValidGender checks if the given gender is valid

func ValidGuildName

func ValidGuildName(L *lua.LState) int

ValidGuildName checks if the given guild name is valid

func ValidGuildRank

func ValidGuildRank(L *lua.LState) int

ValidGuildRank checks if the given rank is valid

func ValidTown

func ValidTown(L *lua.LState) int

ValidTown checks if the given town exists

func ValidUsername

func ValidUsername(L *lua.LState) int

ValidUsername checks if the given username contains only letters and spaces

func ValidVocation

func ValidVocation(L *lua.LState) int

ValidVocation checks if the given vocation exists

func Validate

func Validate(L *lua.LState) int

Validate executes the given govalidator func and returns its output

func ValueToGo

func ValueToGo(lv lua.LValue) interface{}

ValueToGo converts a lua value to a go type

func VerifyCaptcha

func VerifyCaptcha(L *lua.LState) int

VerifyCaptcha checks if the given captcha response is valid

func VocationList

func VocationList(L *lua.LState) int

VocationList returns the server vocations xml file

func WriteGoImageText

func WriteGoImageText(L *lua.LState) int

WriteGoImageText writes text to the given goimage

func WriteResponse

func WriteResponse(L *glua.LState) int

WriteResponse writes string to the response writer

Types

type Date

type Date struct {
	Year   int
	Month  int
	Day    int
	Hour   int
	Minute int
	Second int
	Result string
}

Date lua object date converted from go

type StorageValue

type StorageValue struct {
	PlayerID int
	Key      int
	Value    int
}

StorageValue struct for storage values

Jump to

Keyboard shortcuts

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