-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from cnlh/dev
fix version v0.25.4
- Loading branch information
Showing
5 changed files
with
125 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,36 @@ | |
#fyne-cross --targets=linux/amd64,windows/amd64,darwin/amd64 gui/npc/npc.go | ||
|
||
cd /go | ||
go get -u fyne.io/fyne fyne.io/fyne/cmd/fyne | ||
|
||
apt-get install libegl1-mesa-dev libgles2-mesa-dev libx11-dev -y | ||
#go get -u fyne.io/fyne/cmd/fyne fyne.io/fyne | ||
mkdir -p /go/src/fyne.io | ||
cd src/fyne.io | ||
git clone https://github.com/fyne-io/fyne.git | ||
cd fyne | ||
git checkout v1.2.0 | ||
go install -v ./cmd/fyne | ||
#fyne package -os android fyne.io/fyne/cmd/hello | ||
echo "fyne install success" | ||
mkdir -p /go/src/github.com/cnlh/nps | ||
cp -R /app/* /go/src/github.com/cnlh/nps | ||
cd /go/src/github.com/cnlh/nps | ||
#go get -u fyne.io/fyne fyne.io/fyne/cmd/fyne | ||
rm cmd/npc/sdk.go | ||
#go get -u ./... | ||
#go mod tidy | ||
#rm -rf /go/src/golang.org/x/mobile | ||
echo "tidy success" | ||
cd /go/src/github.com/cnlh/nps | ||
go mod vendor | ||
cd vendor | ||
cp -R * /go/src | ||
cd .. | ||
rm -rf vendor | ||
#rm -rf ~/.cache/* | ||
echo "vendor success" | ||
cd gui/npc | ||
#rm -rf /go/src/golang.org/x/mobile | ||
#go get -u fyne.io/fyne/cmd/[email protected] | ||
#export ANDROID_NDK_HOME=/usr/local/android_sdk/ndk-bundle | ||
fyne package -appID org.nps.client -os android -icon ../../docs/logo.png | ||
mv npc.apk /app/android_client.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// +build !windows | ||
|
||
package mux | ||
|
||
import ( | ||
"errors" | ||
"github.com/xtaci/kcp-go" | ||
"net" | ||
"os" | ||
"syscall" | ||
) | ||
|
||
func sysGetSock(fd *os.File) (bufferSize int, err error) { | ||
if fd != nil { | ||
return syscall.GetsockoptInt(int(fd.Fd()), syscall.SOL_SOCKET, syscall.SO_RCVBUF) | ||
} else { | ||
return 1400 * 320, nil | ||
} | ||
} | ||
|
||
func getConnFd(c net.Conn) (fd *os.File, err error) { | ||
switch c.(type) { | ||
case *net.TCPConn: | ||
fd, err = c.(*net.TCPConn).File() | ||
if err != nil { | ||
return | ||
} | ||
return | ||
case *net.UDPConn: | ||
fd, err = c.(*net.UDPConn).File() | ||
if err != nil { | ||
return | ||
} | ||
return | ||
case *kcp.UDPSession: | ||
//fd, err = (*net.UDPConn)(unsafe.Pointer(c.(*kcp.UDPSession))).File() | ||
//if err != nil { | ||
// return | ||
//} | ||
// Todo | ||
return | ||
default: | ||
err = errors.New("mux:unknown conn type, only tcp or kcp") | ||
return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// +build windows | ||
|
||
package mux | ||
|
||
import ( | ||
"errors" | ||
"github.com/xtaci/kcp-go" | ||
"net" | ||
"os" | ||
) | ||
|
||
func sysGetSock(fd *os.File) (bufferSize int, err error) { | ||
// https://github.com/golang/sys/blob/master/windows/syscall_windows.go#L1184 | ||
// not support, WTF??? | ||
// Todo | ||
// return syscall.GetsockoptInt((syscall.Handle)(unsafe.Pointer(fd.Fd())), syscall.SOL_SOCKET, syscall.SO_RCVBUF) | ||
bufferSize = 10 * 1024 * 1024 | ||
return | ||
} | ||
|
||
func getConnFd(c net.Conn) (fd *os.File, err error) { | ||
switch c.(type) { | ||
case *net.TCPConn: | ||
//fd, err = c.(*net.TCPConn).File() | ||
//if err != nil { | ||
// return | ||
//} | ||
return | ||
case *net.UDPConn: | ||
//fd, err = c.(*net.UDPConn).File() | ||
//if err != nil { | ||
// return | ||
//} | ||
return | ||
case *kcp.UDPSession: | ||
//fd, err = (*net.UDPConn)(unsafe.Pointer(c.(*kcp.UDPSession))).File() | ||
//if err != nil { | ||
// return | ||
//} | ||
// Todo | ||
return | ||
default: | ||
err = errors.New("mux:unknown conn type, only tcp or kcp") | ||
return | ||
} | ||
} |