import (
"errors"
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/dragonfireclient/hydra-dragonfire/convert"
"github.com/yuin/gopher-lua"
"net"
import (
"github.com/HimbeerserverDE/srp"
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/dragonfireclient/hydra-dragonfire/convert"
"github.com/yuin/gopher-lua"
"strings"
package main
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
)
package main
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/dragonfireclient/hydra-dragonfire/convert"
"github.com/yuin/gopher-lua"
"sync"
package convert
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
)
return tbl
}
+func PushHUDStyleFlags(l *lua.LState, val mt.HUDStyleFlags) lua.LValue {
+ tbl := l.NewTable()
+ l.SetField(tbl, "bold", lua.LBool(val&mt.StyleBold != 0))
+ l.SetField(tbl, "italic", lua.LBool(val&mt.StyleItalic != 0))
+ l.SetField(tbl, "mono", lua.LBool(val&mt.StyleMono != 0))
+ return tbl
+}
+
func PushMapBlkFlags(l *lua.LState, val mt.MapBlkFlags) lua.LValue {
tbl := l.NewTable()
l.SetField(tbl, "is_underground", lua.LBool(val&mt.BlkIsUnderground != 0))
l.SetField(tbl, "pos", PushVec2(l, [2]lua.LNumber{lua.LNumber(val.Pos[0]), lua.LNumber(val.Pos[1])}))
l.SetField(tbl, "scale", PushVec2(l, [2]lua.LNumber{lua.LNumber(val.Scale[0]), lua.LNumber(val.Scale[1])}))
l.SetField(tbl, "size", PushVec2(l, [2]lua.LNumber{lua.LNumber(val.Size[0]), lua.LNumber(val.Size[1])}))
+ l.SetField(tbl, "style", PushHUDStyleFlags(l, val.Style))
l.SetField(tbl, "text", lua.LString(string(val.Text)))
l.SetField(tbl, "text_2", lua.LString(string(val.Text2)))
l.SetField(tbl, "type", PushHUDType(l, val.Type))
if val.Field == mt.HUDSize {
l.SetField(tbl, "size", PushVec2(l, [2]lua.LNumber{lua.LNumber(val.Size[0]), lua.LNumber(val.Size[1])}))
}
+ if val.Field == mt.HUDStyle {
+ l.SetField(tbl, "style", PushHUDStyleFlags(l, val.Style))
+ }
if val.Field == mt.HUDText {
l.SetField(tbl, "text", lua.LString(string(val.Text)))
}
l.SetField(tbl, "walk", PushBox1(l, [2]lua.LNumber{lua.LNumber(val.Walk[0]), lua.LNumber(val.Walk[1])}))
l.SetField(tbl, "walk_dig", PushBox1(l, [2]lua.LNumber{lua.LNumber(val.WalkDig[0]), lua.LNumber(val.WalkDig[1])}))
case *mt.ToCltMediaPush:
- l.SetField(tbl, "data", lua.LString(string(val.Data)))
+ l.SetField(tbl, "callback_token", lua.LNumber(val.CallbackToken))
l.SetField(tbl, "filename", lua.LString(string(val.Filename)))
- l.SetField(tbl, "sha1", lua.LString(string(val.SHA1[:])))
+ l.SetField(tbl, "raw_hash", lua.LString(string(val.RawHash)))
l.SetField(tbl, "should_cache", lua.LBool(val.ShouldCache))
case *mt.ToCltModChanMsg:
l.SetField(tbl, "channel", lua.LString(string(val.Channel)))
local tolua = {
string = "lua.LString(string(VAL))",
- fixed_string = "lua.LString(string(VAL[:]))",
boolean = "lua.LBool(VAL)",
number = "lua.LNumber(VAL)",
vec2 = "PushVec2(l, [2]lua.LNumber{lua.LNumber(VAL[0]), lua.LNumber(VAL[1])})",
package convert
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
)
package convert
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
"image/color"
)
package convert
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
"math"
)
package convert
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
"math"
)
package convert
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/yuin/gopher-lua"
)
hud_flags HUDFlags
hud_type HUDType
hud_field HUDField
+hud_style_flags HUDStyleFlags
first_srp FirstSRP
csm_restriction_flags CSMRestrictionFlags
srp_bytes_salt_b SRPBytesSaltB
day_night_diff
light_expired
not_generated
+hud_style_flags
+ prefix Style
+ bold
+ italic
+ mono
add_player_vel
vec3 vel
media_push
- fixed_string sha1
+ string raw_hash
string filename
+ number callback_token
boolean should_cache
- string data
chat_msg
chat_msg_type type
string sender
{size} val.Field == mt.HUDSize
{z_index} val.Field == mt.HUDZIndex
{text_2} val.Field == mt.HUDText2
+ {style} val.Field == mt.HUDStyle
vec2 pos
string name
string text
vec2 size
number z_index
string text_2
+ hud_style_flags style
hud_flags
hud_flags flags
hud_flags mask
vec2 size
number z_index
string text_2
+ hud_style_flags style
map_blk
map_blk_flags flags
number lit_from
require (
github.com/HimbeerserverDE/srp v0.0.0
- github.com/anon55555/mt v0.0.0-20210919124550-bcc58cb3048f
+ github.com/dragonfireclient/mt v0.0.1
github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64
)
-require github.com/beefsack/go-astar v0.0.0-20200827232313-4ecf9e304482 // indirect
+require (
+ github.com/beefsack/go-astar v0.0.0-20200827232313-4ecf9e304482
+ github.com/klauspost/compress v1.15.5 // indirect
+)
github.com/HimbeerserverDE/srp v0.0.0 h1:Iy2GIF7DJphXXO9NjncLEBO6VsZd8Yhrlxl/qTr09eE=
github.com/HimbeerserverDE/srp v0.0.0/go.mod h1:pxNH8S2nh4n2DWE0ToX5GnnDr/uEAuaAhJsCpkDLIWw=
-github.com/anon55555/mt v0.0.0-20210919124550-bcc58cb3048f h1:tZU8VPYLyRrG3Lj9zBZvTVF5tUGciC/2aUIgTcU4WaM=
-github.com/anon55555/mt v0.0.0-20210919124550-bcc58cb3048f/go.mod h1:jH4ER+ahjl7H6TczzK+q4V9sXY++U2Geh6/vt3r4Xvs=
github.com/beefsack/go-astar v0.0.0-20200827232313-4ecf9e304482 h1:p4g4uok3+r6Tg6fxXEQUAcMAX/WdK6WhkQW9s0jaT7k=
github.com/beefsack/go-astar v0.0.0-20200827232313-4ecf9e304482/go.mod h1:Cu3t5VeqE8kXjUBeNXWQprfuaP5UCIc5ggGjgMx9KFc=
+github.com/dragonfireclient/mt v0.0.1 h1:iX6pW8L20orCrAYQTa+ADdm6OdNvIyP7Mev6VadQ1z8=
+github.com/dragonfireclient/mt v0.0.1/go.mod h1:3oHbcSQytW21mTF7ozw3Il3UzdOAG30gPzO2XUAqvGs=
+github.com/klauspost/compress v1.15.5 h1:qyCLMz2JCrKADihKOh9FxnW3houKeNsp2h5OEz0QSEA=
+github.com/klauspost/compress v1.15.5/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ=
github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
var lastTime = time.Now()
var signalChannel chan os.Signal
-var serializeVer uint8 = 28
-var protoVer uint16 = 39
+var serializeVer uint8 = 29
+var protoVer uint16 = 40
//go:embed builtin/luax/init.lua
var builtinLuaX string
package main
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/dragonfireclient/hydra-dragonfire/convert"
"github.com/yuin/gopher-lua"
"sync"
package main
import (
- "github.com/anon55555/mt"
+ "github.com/dragonfireclient/mt"
"github.com/beefsack/go-astar"
"github.com/dragonfireclient/hydra-dragonfire/convert"
"github.com/yuin/gopher-lua"