Commit f3959c04 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Make socket status flag case-insensitive.

parent c4e4a5a0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
## [Unreleased]
### Changed
- Improve output of `nakama migrate status` command when database contains unknown migrations.
- Socket status flag is now case-insensitive.

### Fixed
- Fix an issue with the JS runtime multiUpdate function.
+0 −2
Original line number Diff line number Diff line
@@ -861,8 +861,6 @@ Libraries for GopherLua
- `gluaurl <https://github.com/cjoudrey/gluaurl>`_ : A url parser/builder module for gopher-lua
- `gluahttpscrape <https://github.com/felipejfc/gluahttpscrape>`_ : A simple HTML scraper module for gopher-lua
- `gluaxmlpath <https://github.com/ailncode/gluaxmlpath>`_ : An xmlpath module for gopher-lua
- `gluasocket <https://github.com/BixData/gluasocket>`_ : A LuaSocket library for the GopherLua VM
- `gluabit32 <https://github.com/BixData/gluabit32>`_ : A native Go implementation of bit32 for the GopherLua VM.
- `gmoonscript <https://github.com/rucuriousyet/gmoonscript>`_ : Moonscript Compiler for the Gopher Lua VM
- `loguago <https://github.com/rucuriousyet/loguago>`_ : Zerolog wrapper for Gopher-Lua
- `gluacrypto <https://github.com/tengattack/gluacrypto>`_ : A native Go implementation of crypto library for the GopherLua VM.
+73 −6
Original line number Diff line number Diff line
@@ -264,3 +264,70 @@ function test()
  m:f2()
end
test()

-- issue #292
function test()
  t0 = {}
	t0.year = 2006
	t0.month = 1
	t0.day = 2
	t0.hour = 15
	t0.min = 4
	t0.sec = 5

	t1 = {}
	t1.year = "2006"
	t1.month = "1"
	t1.day = "2"
	t1.hour = "15"
	t1.min = "4"
	t1.sec = "5"

	assert(os.time(t0) == os.time(t1))

	t2 = {}
	t2.year = "  2006"--prefix blank space
	t2.month = "1"
	t2.day = "2"
	t2.hour = "15"
	t2.min = "4"
	t2.sec = "5"
	assert(os.time(t0) == os.time(t2))

	t3 = {}
	t3.year = "  0002006"--prefix blank space and 0
	t3.month = "1"
	t3.day = "2"
	t3.hour = "15"
	t3.min = "4"
	t3.sec = "5"
	assert(os.time(t1) == os.time(t3))

	t4 = {}
	t4.year = "0002006"--prefix 0
	t4.month = "1"
	t4.day = "2"
	t4.hour = "15"
	t4.min = "4"
	t4.sec = "5"
	assert(os.time(t1) == os.time(t4))

	t5 = {}
	t5.year = "0x7d6"--prefix 0x
	t5.month = "1"
	t5.day = "2"
	t5.hour = "15"
	t5.min = "4"
	t5.sec = "5"
	assert(os.time(t1) == os.time(t5))

	t6 = {}
	t6.year = "0X7d6"--prefix 0X
	t6.month = "1"
	t6.day = "2"
	t6.hour = "15"
	t6.min = "4"
	t6.sec = "5"
	assert(os.time(t1) == os.time(t6))
end
test()
+7 −2
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ package lua
import (
	"context"
	"fmt"
	"github.com/heroiclabs/nakama/v3/internal/gopher-lua/parse"
	"io"
	"math"
	"os"
@@ -12,6 +11,8 @@ import (
	"sync"
	"sync/atomic"
	"time"

	"github.com/heroiclabs/nakama/v3/internal/gopher-lua/parse"
)

const MultRet = -1
@@ -1216,6 +1217,10 @@ func NewState(opts ...Options) *LState {
	return ls
}

func (ls *LState) IsClosed() bool {
	return ls.stack == nil
}

func (ls *LState) Close() {
	atomic.AddInt32(&ls.stop, 1)
	for _, file := range ls.G.tempFiles {
@@ -2020,7 +2025,7 @@ func (ls *LState) SetMx(mx int) {
	go func() {
		limit := uint64(mx * 1024 * 1024) //MB
		var s runtime.MemStats
		for ls.stop == 0 {
		for atomic.LoadInt32(&ls.stop) == 0 {
			runtime.ReadMemStats(&s)
			if s.Alloc >= limit {
				fmt.Println("out of memory")
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ func (ls *LState) CheckString(n int) string {
	v := ls.Get(n)
	if lv, ok := v.(LString); ok {
		return string(lv)
	} else if LVCanConvToString(v) {
		return ls.ToString(n)
	}
	ls.TypeError(n, LTString)
	return ""
Loading