Skip to content

Commit

Permalink
feat : http proto change
Browse files Browse the repository at this point in the history
  • Loading branch information
taotao committed Dec 21, 2023
1 parent 74d2c3b commit 3863fee
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion editor/src/layouts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function Layout() {

if (props.isMobile) return [];
return [
<Tag>v0.3.7</Tag>,
<Tag>v0.3.8</Tag>,
<Radio.Group onChange={themeChange} value={themeValue} buttonStyle="solid" defaultValue={localStorage.theme} size={"small"}>
<Radio.Button value={ThemeType.Dark}>Dark</Radio.Button>
<Radio.Button value={ThemeType.Light}>Light</Radio.Button>
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (

const (
// Version of gobot driver
Version = "v0.3.7"
Version = "v0.3.8"

banner = `
__ __
Expand Down
14 changes: 10 additions & 4 deletions mock/http_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mock

import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"

Expand Down Expand Up @@ -92,8 +93,9 @@ func routeAccInfo(ctx echo.Context) error {
}

body = accInfoRes{
Diamond: accPtr.Diamond,
Gold: accPtr.Gold,
Diamond: accPtr.Diamond,
Gold: accPtr.Gold,
SessionID: accinfo.SessionID,
}
res.Body = body
res.Code = 200
Expand Down Expand Up @@ -130,11 +132,14 @@ func routeHeroInfo(ctx echo.Context) error {
}

res.Body = heroInfoRes{
Heros: accPtr.Heros,
Heros: accPtr.Heros,
SessionID: heroinfo.SessionID,
}
res.Code = 200

ext:
fmt.Println(err, res)

ctx.JSON(http.StatusOK, res)
return nil
}
Expand Down Expand Up @@ -167,7 +172,8 @@ func routeHeroLvup(ctx echo.Context) error {

res.Code = 200
res.Body = lvupRes{
Heros: accPtr.Heros,
SessionID: lvup.SessionID,
Heros: accPtr.Heros,
}

ext:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion script/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end

-- initialize the meta structure
meta = {
Token = "",
SessionID = "",
Err = "", -- debug log [err]
}

Expand Down
5 changes: 2 additions & 3 deletions script/module/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ func (t *TCPModule) read(L *lua.LState) int {
return 2
}

buf := make([]byte, 128) //test
// 非阻塞读取
n, err := syscall.Read(syscall.Handle(t.fd), buf)
buf := make([]byte, 1024)
n, err := t.conn.Read(buf)
// 处理读取结果
if err == syscall.EWOULDBLOCK {
L.Push(lua.LString("fail"))
Expand Down

0 comments on commit 3863fee

Please sign in to comment.