env not properly applied
This commit is contained in:
parent
c94d7038e9
commit
c5e7237273
|
@ -17,6 +17,7 @@ __debug_bin
|
|||
keys.db
|
||||
/skins/
|
||||
/worlds/
|
||||
/packs/
|
||||
/dist/
|
||||
/builds/
|
||||
/updates/
|
||||
|
|
2
build.py
2
build.py
|
@ -110,7 +110,7 @@ for (platform_name, archs, ext) in PLATFORMS:
|
|||
]
|
||||
args.append("./cmd/bedrocktool")
|
||||
print(args)
|
||||
out = subprocess.run(args)
|
||||
out = subprocess.run(args, env=env)
|
||||
out.check_returncode()
|
||||
|
||||
for arch in archs:
|
||||
|
|
|
@ -35,7 +35,7 @@ func (c *CLI) Init() bool {
|
|||
func (c *CLI) Start(ctx context.Context, cancel context.CancelFunc) error {
|
||||
flag.Parse()
|
||||
utils.InitDNS()
|
||||
utils.InitExtraDebug()
|
||||
utils.InitExtraDebug(ctx)
|
||||
subcommands.Execute(ctx)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ func (g *GUI) Start(ctx context.Context, cancel context.CancelFunc) error {
|
|||
}
|
||||
|
||||
utils.InitDNS()
|
||||
utils.InitExtraDebug()
|
||||
utils.InitExtraDebug(ctx)
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
|
|
|
@ -78,7 +78,7 @@ func (c *InteractiveCLI) Start(ctx context.Context, cancel context.CancelFunc) e
|
|||
flag.Parse()
|
||||
|
||||
InitDNS()
|
||||
InitExtraDebug()
|
||||
InitExtraDebug(ctx)
|
||||
|
||||
subcommands.Execute(ctx)
|
||||
|
||||
|
|
|
@ -116,6 +116,10 @@ func PacketLogger(header packet.Header, payload []byte, src, dst net.Addr) {
|
|||
pk = &packet.Unknown{PacketID: header.PacketID}
|
||||
}
|
||||
|
||||
if pk.ID() == packet.IDRequestNetworkSettings {
|
||||
ClientAddr = src
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if recoveredErr := recover(); recoveredErr != nil {
|
||||
logrus.Errorf("%T: %w", pk, recoveredErr)
|
||||
|
|
|
@ -198,7 +198,7 @@ func CfbDecrypt(data []byte, key []byte) ([]byte, error) {
|
|||
return data, nil
|
||||
}
|
||||
|
||||
func InitExtraDebug() {
|
||||
func InitExtraDebug(ctx context.Context) {
|
||||
if !Options.ExtraDebug {
|
||||
return
|
||||
}
|
||||
|
@ -211,7 +211,10 @@ func InitExtraDebug() {
|
|||
if err != nil {
|
||||
logrus.Error(err)
|
||||
} else {
|
||||
defer logPlain.Close()
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
logPlain.Close()
|
||||
}()
|
||||
}
|
||||
|
||||
// open gpg log
|
||||
|
@ -219,13 +222,19 @@ func InitExtraDebug() {
|
|||
if err != nil {
|
||||
logrus.Error(err)
|
||||
} else {
|
||||
defer logCrypt.Close()
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
logCrypt.Close()
|
||||
}()
|
||||
// encrypter for the log
|
||||
logCryptEnc, err = crypt.Encer("packets.log", logCrypt)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
} else {
|
||||
defer logCryptEnc.Close()
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
logCryptEnc.Close()
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue