Skip to content

Commit

Permalink
support latency and resources usage check
Browse files Browse the repository at this point in the history
  • Loading branch information
XZB-1248 committed Mar 19, 2022
1 parent 6766c8f commit 8b62c89
Show file tree
Hide file tree
Showing 25 changed files with 496 additions and 243 deletions.
92 changes: 66 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Go
name: Build

on:
push:
branches: [ master ]
tags-ignore:
- '!v*.*.*'

jobs:

Expand All @@ -11,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [ 14.x ]

steps:
- uses: actions/checkout@v2
Expand All @@ -30,69 +31,108 @@ jobs:
run: |
export PATH=$PATH:~/go/bin/
go install github.com/rakyll/statik
- name: Build and embed clients
run: |
chmod +x ./build.client.sh
export GOMOD=`pwd`/go.mod
export CGO_ENABLED=0
go mod tidy
go mod download
./build.client.sh
statik -m -src="./built" -f -dest="./server/embed" -include=* -p built -ns built
- name: Build and embed static resources
run: |
cd ./web
npm install
npm run build-prod
statik -m -src="./dist" -f -dest="../server/embed" -p web -ns web
cd ..
- name: Build and embed clients
run: |
chmod +x ./build.client.sh
./build.client.sh
- name: Build server
run: |
chmod +x ./build.server.sh
export GOMOD=`pwd`/go.mod
export CGO_ENABLED=0
go mod tidy
go mod download
./build.server.sh
- name: Install zip and tar
run: |
cd ./releases
sudo apt install zip tar -y
tar -zcvf server_linux_arm.tar.gz server_linux_arm
tar -zcvf server_linux_arm64.tar.gz server_linux_arm64
tar -zcvf server_linux_i386.tar.gz server_linux_i386
tar -zcvf server_linux_amd64.tar.gz server_linux_amd64
zip -r server_windows_arm.zip server_windows_arm.exe
zip -r server_windows_arm64.zip server_windows_arm64.exe
zip -r server_windows_i386.zip server_windows_i386.exe
zip -r server_windows_amd64.zip server_windows_amd64.exe
- name: Upload binary files (server_linux_arm)
uses: actions/upload-artifact@v2
with:
name: server_linux_arm
path: releases/server_linux_arm
name: server_linux_arm.tar.gz
path: releases/server_linux_arm.tar.gz

- name: Upload binary files (server_linux_arm64)
uses: actions/upload-artifact@v2
with:
name: server_linux_arm64
path: releases/server_linux_arm64
name: server_linux_arm64.tar.gz
path: releases/server_linux_arm64.tar.gz

- name: Upload binary files (server_linux_i386)
uses: actions/upload-artifact@v2
with:
name: server_linux_i386
path: releases/server_linux_i386
name: server_linux_i386.tar.gz
path: releases/server_linux_i386.tar.gz

- name: Upload binary files (server_linux_amd64)
uses: actions/upload-artifact@v2
with:
name: server_linux_amd64
path: releases/server_linux_amd64
name: server_linux_amd64.tar.gz
path: releases/server_linux_amd64.tar.gz

- name: Upload binary files (server_windows_arm)
uses: actions/upload-artifact@v2
with:
name: server_windows_arm.exe
path: releases/server_windows_arm.exe
name: server_windows_arm.zip
path: releases/server_windows_arm.zip

- name: Upload binary files (server_windows_arm64)
uses: actions/upload-artifact@v2
with:
name: server_windows_arm64.exe
path: releases/server_windows_arm64.exe
name: server_windows_arm64.zip
path: releases/server_windows_arm64.zip

- name: Upload binary files (server_windows_i386)
uses: actions/upload-artifact@v2
with:
name: server_windows_i386.exe
path: releases/server_windows_i386.exe
name: server_windows_i386.zip
path: releases/server_windows_i386.zip

- name: Upload binary files (server_windows_amd64)
uses: actions/upload-artifact@v2
with:
name: server_windows_amd64.exe
path: releases/server_windows_amd64.exe
name: server_windows_amd64.zip
path: releases/server_windows_amd64.zip

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
releases/server_linux_arm.tar.gz
releases/server_linux_arm64.tar.gz
releases/server_linux_i386.tar.gz
releases/server_linux_amd64.tar.gz
releases/server_windows_arm.zip
releases/server_windows_arm64.zip
releases/server_windows_i386.zip
releases/server_windows_amd64.zip
env:
GITHUB_REPOSITORY: XZB-1248/TestPlace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/releases
/built
/tools
/.idea
/Config.json
dist/
node_modules/
26 changes: 13 additions & 13 deletions build.client.bat
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
set GO111MODULE=auto

mkdir .\built


set GOOS=linux

set GOARCH=arm
go build -ldflags "-s -w" -o ./built/linux_arm Spark/Client
go build -ldflags "-s -w" -o ./built/linux_arm Spark/client
set GOARCH=arm64
go build -ldflags "-s -w" -o ./built/linux_arm64 Spark/Client
go build -ldflags "-s -w" -o ./built/linux_arm64 Spark/client
set GOARCH=386
go build -ldflags "-s -w" -o ./built/linux_i386 Spark/Client
go build -ldflags "-s -w" -o ./built/linux_i386 Spark/client
set GOARCH=amd64
go build -ldflags "-s -w" -o ./built/linux_amd64 Spark/Client
go build -ldflags "-s -w" -o ./built/linux_amd64 Spark/client



set GOOS=windows

set GOARCH=arm
go build -ldflags "-s -w" -o ./built/windows_arm Spark/Client
go build -ldflags "-s -w" -o ./built/windows_arm Spark/client
set GOARCH=arm64
go build -ldflags "-s -w" -o ./built/windows_arm64 Spark/Client
go build -ldflags "-s -w" -o ./built/windows_arm64 Spark/client
set GOARCH=386
go build -ldflags "-s -w" -o ./built/windows_i386 Spark/Client
go build -ldflags "-s -w" -o ./built/windows_i386 Spark/client
set GOARCH=amd64
go build -ldflags "-s -w" -o ./built/windows_amd64 Spark/Client
go build -ldflags "-s -w" -o ./built/windows_amd64 Spark/client



Expand All @@ -34,22 +34,22 @@ go build -ldflags "-s -w" -o ./built/windows_amd64 Spark/Client
@REM set GOARCH=arm
@REM set CC=armv7a-linux-androideabi21-clang
@REM set CXX=armv7a-linux-androideabi21-clang++
@REM go build -ldflags "-s -w" -o ./built/android_armv7a Spark/Client
@REM go build -ldflags "-s -w" -o ./built/android_armv7a Spark/client

@REM set GOARCH=arm64
@REM set CC=aarch64-linux-android21-clang
@REM set CXX=aarch64-linux-android21-clang++
@REM go build -ldflags "-s -w" -o ./built/android_aarch64 Spark/Client
@REM go build -ldflags "-s -w" -o ./built/android_aarch64 Spark/client

@REM set GOARCH=386
@REM set CC=i686-linux-android21-clang
@REM set CXX=i686-linux-android21-clang++
@REM go build -ldflags "-s -w" -o ./built/android_i686 Spark/Client
@REM go build -ldflags "-s -w" -o ./built/android_i686 Spark/client

@REM set GOARCH=amd64
@REM set CC=x86_64-linux-android21-clang
@REM set CXX=x86_64-linux-android21-clang++
@REM go build -ldflags "-s -w" -o ./built/android_x86_64 Spark/Client
@REM go build -ldflags "-s -w" -o ./built/android_x86_64 Spark/client



Expand Down
26 changes: 13 additions & 13 deletions build.client.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
export GO111MODULE=auto

mkdir ./built


export GOOS=linux

export GOARCH=arm
go build -ldflags "-s -w" -o ./built/linux_arm Spark/Client
go build -ldflags "-s -w" -o ./built/linux_arm Spark/client
export GOARCH=arm64
go build -ldflags "-s -w" -o ./built/linux_arm64 Spark/Client
go build -ldflags "-s -w" -o ./built/linux_arm64 Spark/client
export GOARCH=386
go build -ldflags "-s -w" -o ./built/linux_i386 Spark/Client
go build -ldflags "-s -w" -o ./built/linux_i386 Spark/client
export GOARCH=amd64
go build -ldflags "-s -w" -o ./built/linux_amd64 Spark/Client
go build -ldflags "-s -w" -o ./built/linux_amd64 Spark/client



export GOOS=windows

export GOARCH=arm
go build -ldflags "-s -w" -o ./built/windows_arm Spark/Client
go build -ldflags "-s -w" -o ./built/windows_arm Spark/client
export GOARCH=arm64
go build -ldflags "-s -w" -o ./built/windows_arm64 Spark/Client
go build -ldflags "-s -w" -o ./built/windows_arm64 Spark/client
export GOARCH=386
go build -ldflags "-s -w" -o ./built/windows_i386 Spark/Client
go build -ldflags "-s -w" -o ./built/windows_i386 Spark/client
export GOARCH=amd64
go build -ldflags "-s -w" -o ./built/windows_amd64 Spark/Client
go build -ldflags "-s -w" -o ./built/windows_amd64 Spark/client



Expand All @@ -34,22 +34,22 @@ go build -ldflags "-s -w" -o ./built/windows_amd64 Spark/Client
# export GOARCH=arm
# export CC=armv7a-linux-androideabi21-clang
# export CXX=armv7a-linux-androideabi21-clang++
# go build -ldflags "-s -w" -o ./built/android_armv7a Spark/Client
# go build -ldflags "-s -w" -o ./built/android_armv7a Spark/client

# export GOARCH=arm64
# export CC=aarch64-linux-android21-clang
# export CXX=aarch64-linux-android21-clang++
# go build -ldflags "-s -w" -o ./built/android_aarch64 Spark/Client
# go build -ldflags "-s -w" -o ./built/android_aarch64 Spark/client

# export GOARCH=386
# export CC=i686-linux-android21-clang
# export CXX=i686-linux-android21-clang++
# go build -ldflags "-s -w" -o ./built/android_i686 Spark/Client
# go build -ldflags "-s -w" -o ./built/android_i686 Spark/client

# export GOARCH=amd64
# export CC=x86_64-linux-android21-clang
# export CXX=x86_64-linux-android21-clang++
# go build -ldflags "-s -w" -o ./built/android_x86_64 Spark/Client
# go build -ldflags "-s -w" -o ./built/android_x86_64 Spark/client



Expand Down
17 changes: 9 additions & 8 deletions build.server.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
statik -m -src="./web/dist" -f -dest="./server/embed" -p web -ns web
mkdir ./releases



export GOOS=linux

export GOARCH=arm
go build -ldflags "-s -w" -o ./releases/server_linux_arm Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_linux_arm Spark/server
export GOARCH=arm64
go build -ldflags "-s -w" -o ./releases/server_linux_arm64 Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_linux_arm64 Spark/server
export GOARCH=386
go build -ldflags "-s -w" -o ./releases/server_linux_i386 Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_linux_i386 Spark/server
export GOARCH=amd64
go build -ldflags "-s -w" -o ./releases/server_linux_amd64 Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_linux_amd64 Spark/server



export GOOS=windows

export GOARCH=arm
go build -ldflags "-s -w" -o ./releases/server_windows_arm Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_windows_arm.exe Spark/server
export GOARCH=arm64
go build -ldflags "-s -w" -o ./releases/server_windows_arm64 Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_windows_arm64.exe Spark/server
export GOARCH=386
go build -ldflags "-s -w" -o ./releases/server_windows_i386 Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_windows_i386.exe Spark/server
export GOARCH=amd64
go build -ldflags "-s -w" -o ./releases/server_windows_amd64 Spark/Server
go build -ldflags "-s -w" -tags=jsoniter -o ./releases/server_windows_amd64.exe Spark/server
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
)

// localhost
var cfgBuffer = "\x00\xcd\x90\x50\x43\xfc\x3d\x36\x56\x6d\xf6\x01\xd1\xcd\x81\xc3\x1b\x80\xc9\x61\xd8\xdf\x5b\x76\x48\x88\xc5\xb1\x74\x22\x23\xab\x3b\xfc\x8b\xbe\x98\x27\xed\x05\xec\xbb\x40\x4f\xe9\xe7\xe5\xe0\x84\xaa\xb7\xfd\x4a\x30\x71\x08\x6c\x02\x50\xe9\xc5\x22\xcf\xcb\x89\x16\x0a\x89\x08\xd4\x26\xdc\x5c\xc1\xc9\xbf\xc4\xac\x0d\x92\x2f\x34\x7f\x45\xeb\x55\xa0\x6d\xf6\x64\xbc\xd5\x15\x40\x96\x43\x64\xe0\x24\x51\xfb\xe8\xc9\x7f\x48\x60\xcd\x30\x5e\x5e\x78\xba\xb6\x6f\x07\x64\xe8\x59\x81\x0b\x91\x13\x92\x1a\xdd\x49\x8f\x28\xe7\x74\xea\xff\x5b\x45\x0e\x4a\x2d\x60\x4e\xc9\xde\x9c\xbe\x50\xc6\x12\xc7\x45\xa2\x15\xa0\x58\x62\x45\x86\x74\x9f\xa5\x14\x5c\x17\x8a\xcc\x56\x73\xa7\x75\xb7\xf6\x6d\x52\x0f\xb8\xc1\xff\x9c\x39\x39\x00\x74\xe1\x4d\x65\x73\x9c\x02\x57\x8b\xcf\xdf\x0a\x20\x4c\xed\xe2\x25\xea\x01\x36\x12\x37\x12\x2e\x1a\x03\x41\x19\x2e\xc9\xdd\x71\xac\x73\x90\xfa\x5e\x60\x08\x43\x35\xef\x61\x45\xf9\xe3\xba\xcb\xb1\xc5\x7c\xf0\x11\xcd\x47\x57\x53\xdc\x35\x6b\x9f\xac\xad\x43\x4a\xc7\x54\x20\xb8\xd0\xf8\xb5\x0c\x45\x76\x57\xb9\xee\x4a\x3f\xd2\xda\xf7\x94\x54\x74\xf3\x91\xf3\x4d\x49\x98\xc6\xf8\x60\x80\xad\x84\x04\xef\x35\xca\x3a\xcf\xd3\x7e\x74\xc2\x4b\xb8\xb3\x9f\xb2\x83\xb8\xbd\x29\x13\x9f\x2b\xaa\x60\x47\x24\x7e\x20\xb2\x85\xdc\x47\xfe\x8f\x68\xb6\xc3\x43\xad\x61\x3d\x9b\x35\x60\x2e\x6c\x44\xf0\xaf\xb2\xf3\xdb\xe2\x1b\x8a\xec\x0a\x48\x5e\x43\xa9\xb3\x3a\x5e\xb6\x90\xa9\x3d\xee\x4f\xa1\x57\x7c\x94\xf4\xb1\x36\xda\x04\xa8\x5e\x48\x2a\xc3\xa1\xf0\x97\xf0\xe0\x10\x46\x32\x10\xe5\xd8\x36\x5a\x56\xa5\xbb\x37\x3c\x9f\xbd\xef\xf5\x2f"
//var cfgBuffer = "\x00\xcd\x90\x50\x43\xfc\x3d\x36\x56\x6d\xf6\x01\xd1\xcd\x81\xc3\x1b\x80\xc9\x61\xd8\xdf\x5b\x76\x48\x88\xc5\xb1\x74\x22\x23\xab\x3b\xfc\x8b\xbe\x98\x27\xed\x05\xec\xbb\x40\x4f\xe9\xe7\xe5\xe0\x84\xaa\xb7\xfd\x4a\x30\x71\x08\x6c\x02\x50\xe9\xc5\x22\xcf\xcb\x89\x16\x0a\x89\x08\xd4\x26\xdc\x5c\xc1\xc9\xbf\xc4\xac\x0d\x92\x2f\x34\x7f\x45\xeb\x55\xa0\x6d\xf6\x64\xbc\xd5\x15\x40\x96\x43\x64\xe0\x24\x51\xfb\xe8\xc9\x7f\x48\x60\xcd\x30\x5e\x5e\x78\xba\xb6\x6f\x07\x64\xe8\x59\x81\x0b\x91\x13\x92\x1a\xdd\x49\x8f\x28\xe7\x74\xea\xff\x5b\x45\x0e\x4a\x2d\x60\x4e\xc9\xde\x9c\xbe\x50\xc6\x12\xc7\x45\xa2\x15\xa0\x58\x62\x45\x86\x74\x9f\xa5\x14\x5c\x17\x8a\xcc\x56\x73\xa7\x75\xb7\xf6\x6d\x52\x0f\xb8\xc1\xff\x9c\x39\x39\x00\x74\xe1\x4d\x65\x73\x9c\x02\x57\x8b\xcf\xdf\x0a\x20\x4c\xed\xe2\x25\xea\x01\x36\x12\x37\x12\x2e\x1a\x03\x41\x19\x2e\xc9\xdd\x71\xac\x73\x90\xfa\x5e\x60\x08\x43\x35\xef\x61\x45\xf9\xe3\xba\xcb\xb1\xc5\x7c\xf0\x11\xcd\x47\x57\x53\xdc\x35\x6b\x9f\xac\xad\x43\x4a\xc7\x54\x20\xb8\xd0\xf8\xb5\x0c\x45\x76\x57\xb9\xee\x4a\x3f\xd2\xda\xf7\x94\x54\x74\xf3\x91\xf3\x4d\x49\x98\xc6\xf8\x60\x80\xad\x84\x04\xef\x35\xca\x3a\xcf\xd3\x7e\x74\xc2\x4b\xb8\xb3\x9f\xb2\x83\xb8\xbd\x29\x13\x9f\x2b\xaa\x60\x47\x24\x7e\x20\xb2\x85\xdc\x47\xfe\x8f\x68\xb6\xc3\x43\xad\x61\x3d\x9b\x35\x60\x2e\x6c\x44\xf0\xaf\xb2\xf3\xdb\xe2\x1b\x8a\xec\x0a\x48\x5e\x43\xa9\xb3\x3a\x5e\xb6\x90\xa9\x3d\xee\x4f\xa1\x57\x7c\x94\xf4\xb1\x36\xda\x04\xa8\x5e\x48\x2a\xc3\xa1\xf0\x97\xf0\xe0\x10\x46\x32\x10\xe5\xd8\x36\x5a\x56\xa5\xbb\x37\x3c\x9f\xbd\xef\xf5\x2f"

// none
//var cfgBuffer = "\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19"
var cfgBuffer = "\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19"

func init() {
golog.SetTimeFormat(`2006/01/02 15:04:05`)
Expand Down
13 changes: 2 additions & 11 deletions client/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,8 @@ func SendPack(pack interface{}, wsConn *Conn) error {
}

func SendCb(pack, prev modules.Packet, wsConn *Conn) error {
if prev.Data != nil {
trigger, ok := prev.Data[`event`]
if ok {
if pack.Data == nil {
pack.Data = map[string]interface{}{
`callback`: trigger,
}
} else {
pack.Data[`callback`] = trigger
}
}
if len(prev.Event) > 0 {
pack.Event = prev.Event
}
return SendPack(pack, wsConn)
}
Loading

0 comments on commit 8b62c89

Please sign in to comment.