]> git.lizzy.rs Git - hydra-dragonfire.git/commitdiff
Use dragonfire fork of mt
authorElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 8 Jun 2022 22:20:27 +0000 (00:20 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 8 Jun 2022 22:20:27 +0000 (00:20 +0200)
19 files changed:
client.go
comp_auth.go
comp_map.go
comp_pkts.go
convert/push_auto.go
convert/push_mkauto.lua
convert/push_static.go
convert/read_auto.go
convert/read_mkauto.lua
convert/read_static.go
convert/spec/casemap
convert/spec/client/flag
convert/spec/client/pkt
convert/spec/client/struct
go.mod
go.sum
hydra.go
map.go
path.go

index 2e475887629b76eb339c3bd6fcbd3e7e9f5d00e6..889da387f9d0d1e7676b3ade111da26d29cbd18a 100644 (file)
--- a/client.go
+++ b/client.go
@@ -2,7 +2,7 @@ package main
 
 import (
        "errors"
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/dragonfireclient/hydra-dragonfire/convert"
        "github.com/yuin/gopher-lua"
        "net"
index 5d3f838e1664a09572e44d133b6ef38a7cc287f6..a017cc7159268f9279765443151fcb4b001492c0 100644 (file)
@@ -2,7 +2,7 @@ package main
 
 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"
index eed5039352aef08c631c5e36af9f467e523917ff..fda248eb85cab663c7bd984f697549fed6980365 100644 (file)
@@ -1,7 +1,7 @@
 package main
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
 )
 
index 37e228454eee892264efa8461bf807b4dc27ebde..f135e6b9614c66f23d85ccdc39342ee49c78f989 100644 (file)
@@ -1,7 +1,7 @@
 package main
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/dragonfireclient/hydra-dragonfire/convert"
        "github.com/yuin/gopher-lua"
        "sync"
index bcd0948d61a95ab27b55ae007e254e5988558e54..7b04a85758ceb79b3ae079a7f3a81500aefe4724 100644 (file)
@@ -2,7 +2,7 @@
 package convert
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
 )
 
@@ -207,6 +207,14 @@ func PushHUDFlags(l *lua.LState, val mt.HUDFlags) lua.LValue {
        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))
@@ -227,6 +235,7 @@ func PushHUD(l *lua.LState, val mt.HUD) lua.LValue {
        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))
@@ -474,6 +483,9 @@ func PushPkt(l *lua.LState, pkt *mt.Pkt) lua.LValue {
                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)))
                }
@@ -556,9 +568,9 @@ func PushPkt(l *lua.LState, pkt *mt.Pkt) lua.LValue {
                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)))
index 3e1f290f6ccffd254b5d21990aa0d3a28988eb72..96bef40ce0c650cec314d06ede5f5fecc6ced76c 100755 (executable)
@@ -28,7 +28,6 @@ end
 
 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])})",
@@ -102,7 +101,7 @@ f:write([[
 package convert
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
 )
 
index 75001a7f75e67a2f0203c5e946a969ae7e9e6042..9069e9971133fc472eaa70a68b95e50eaf8da84c 100644 (file)
@@ -1,7 +1,7 @@
 package convert
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
        "image/color"
 )
index efb3d623eb793975845f98cb8ace6d8bf5c05806..d978bc1fb1e7081dcac4d37a761be47f412b9ae0 100644 (file)
@@ -2,7 +2,7 @@
 package convert
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
        "math"
 )
index 7ef82dd5c1db538066fa0eeefa67ccfc132c6e11..35322147ff3dbca914c590981b5cdda37f0c1c53 100755 (executable)
@@ -187,7 +187,7 @@ f:write([[
 package convert
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
        "math"
 )
index 3be41e1068ba911ca4f61acef3ea6a730fd4eaf6..13d80f48eed22e493db50914fee0d212f3130cb3 100644 (file)
@@ -1,7 +1,7 @@
 package convert
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/yuin/gopher-lua"
 )
 
index ab4c10a74faf8a2fe7360c08df31cb057e4010da..861e08c2bd19c23d2577e01bfeabe7871ec4fabc 100644 (file)
@@ -15,6 +15,7 @@ change_hud ChangeHUD
 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
index 17a8c7ac76984efb439df2b940446f85e1e2be9e..fa51797ce43eddaff90bf5e00f685de6b52e6134 100644 (file)
@@ -23,3 +23,8 @@ map_blk_flags
        day_night_diff
        light_expired
        not_generated
+hud_style_flags
+       prefix Style
+       bold
+       italic
+       mono
index 0a150021ab55896595e616c01143aa291827c263..2b7b424e80bc6e2f20cbdc7de12f867edd711147 100644 (file)
@@ -37,10 +37,10 @@ csm_restriction_flags
 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
@@ -166,6 +166,7 @@ change_hud
        {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
@@ -178,6 +179,7 @@ change_hud
        vec2 size
        number z_index
        string text_2
+       hud_style_flags style
 hud_flags
        hud_flags flags
        hud_flags mask
index f3bbd10ad1cdef7de133561fd3fd4c52c3ac3af1..048d9cb46003d367dc1d9623ce28790ff89b9ffc 100644 (file)
@@ -22,6 +22,7 @@ hud
        vec2 size
        number z_index
        string text_2
+       hud_style_flags style
 map_blk
        map_blk_flags flags
        number lit_from
diff --git a/go.mod b/go.mod
index 5793149cedcb743ee625cd7a98a10f1a68ccc881..9ff1da7e814c3b9fa83bd342d69b0961f9b4d611 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -4,8 +4,11 @@ go 1.18
 
 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
+)
diff --git a/go.sum b/go.sum
index 9fcc5426fe6c4dc38008f510bd58165021a09bda..8b4c4ca8f445f808bed85ff557a378556e7813e7 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1,8 +1,10 @@
 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=
index 6caff4cb48040c1cf79238ed7f2afabe2dcab3d8..5b29a7516fde0f972c55a9039f2a4adf9b9fbf34 100644 (file)
--- a/hydra.go
+++ b/hydra.go
@@ -12,8 +12,8 @@ import (
 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
diff --git a/map.go b/map.go
index 3d4faee8ae8878d0716ffd65ad8b61b642cd31d4..ad3cebf8b0946874a1cb3585213bffd096e91d0e 100644 (file)
--- a/map.go
+++ b/map.go
@@ -1,7 +1,7 @@
 package main
 
 import (
-       "github.com/anon55555/mt"
+       "github.com/dragonfireclient/mt"
        "github.com/dragonfireclient/hydra-dragonfire/convert"
        "github.com/yuin/gopher-lua"
        "sync"
diff --git a/path.go b/path.go
index d8d9a0b3d1c2169ef66158b59d553ea0e1f64bce..bcdd910a9a4e894778148217480dca197c1bbc39 100644 (file)
--- a/path.go
+++ b/path.go
@@ -1,7 +1,7 @@
 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"