]> git.lizzy.rs Git - hydra-dragonfire.git/blobdiff - auth.go
Expose supported serialize and proto versions to Lua
[hydra-dragonfire.git] / auth.go
diff --git a/auth.go b/auth.go
index 879ffcee6ecbd85060be09b88148739e71d7d435..a58aba3fc9852540d49fa5bfb31a5edc77557aca 100644 (file)
--- a/auth.go
+++ b/auth.go
@@ -3,7 +3,7 @@ package main
 import (
        "github.com/HimbeerserverDE/srp"
        "github.com/anon55555/mt"
-       "github.com/dragonfireclient/hydra/tolua"
+       "github.com/dragonfireclient/hydra-dragonfire/convert"
        "github.com/yuin/gopher-lua"
        "strings"
        "time"
@@ -57,7 +57,7 @@ func (auth *Auth) create(client *Client, l *lua.LState) {
        l.SetMetatable(auth.userdata, l.GetTypeMetatable("hydra.auth"))
 }
 
-func (auth *Auth) tolua() lua.LValue {
+func (auth *Auth) push() lua.LValue {
        return auth.userdata
 }
 
@@ -69,9 +69,9 @@ func (auth *Auth) connect() {
        go func() {
                for auth.client.state == csConnected && auth.state == asInit {
                        auth.client.conn.SendCmd(&mt.ToSrvInit{
-                               SerializeVer: 28,
-                               MinProtoVer:  39,
-                               MaxProtoVer:  39,
+                               SerializeVer: serializeVer,
+                               MinProtoVer:  protoVer,
+                               MaxProtoVer:  protoVer,
                                PlayerName:   auth.username,
                        })
                        time.Sleep(500 * time.Millisecond)
@@ -90,7 +90,7 @@ func (auth *Auth) checkState(state authState, pkt *mt.Pkt) bool {
                return true
        }
 
-       auth.fail("received " + string(tolua.PktType(pkt)) + " in invalid state")
+       auth.fail("received " + string(convert.PushPktType(pkt)) + " in invalid state")
        return false
 }