Skip to content

Commit

Permalink
Merge branch 'LNSSPsd:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
chfwd committed Dec 19, 2022
1 parent d987766 commit a0bcb8f
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 17 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:
- name: Setup LLVM dependencies
run: |
sudo apt install libedit2 libxml2 libncursesw6 binutils elfutils
wget -q http://ftp.debian.org/debian/pool/main/libf/libffi/libffi8_3.4.2-4_amd64.deb
sudo dpkg -i libffi8_3.4.2-4_amd64.deb
wget -q http://ftp.debian.org/debian/pool/main/libf/libffi/libffi8_3.4.4-1_amd64.deb
sudo dpkg -i libffi8_3.4.4-1_amd64.deb
- name: Cache LLVM
id: cache-llvm
Expand Down Expand Up @@ -203,7 +203,23 @@ jobs:
run: |
export THEOS=~/theos
make package
# - name: Build GUI applications
# run: |
# export THEOS=~/theos
# cd fyne-gui/android_wrapper
# go build
# cd ..
# make all
# #node simpleappend.js
# rename s/phoenixbuilder/phoenixbuilder-gui/ build/phoenixbuilder*
# ls -lh build/>release.txt
# mv release.txt build/release-list-gui.txt
# cp version build/version-gui.txt
# rm -f build/phoenixbuilder-macos-arm64 build/phoenixbuilder-macos-x86_64
# mv build ../build/gui
# cd ..

- name: Archive binaries
run: |
mv release/*.deb build/
Expand Down Expand Up @@ -246,3 +262,24 @@ jobs:
# git commit -m "Auto update" -a
# git push
# cd ..
#
#- name: Load Key
# env:
# FBKEY: ${{ secrets.FBKEY }}
# if: ${{ env.FBKEY != '' }}
# run: |
# echo "$FBKEY">~/fbkey
# mkdir -p ~/.ssh
# printf "StrictHostKeyChecking no\nUserKnownHostsFile /dev/null">~/.ssh/config
# chmod 0600 ~/fbkey
#
#- name: Upload binaries and publish
# env:
# FBUSER: ${{ secrets.FBUSER }}
# FBIP: ${{ secrets.FBIP }}
# if: ${{ env.FBUSER != '' && env.FBIP != '' }}
# run: |
# echo "put fb-upload.tar.gz">~/a
# sftp -P 8964 -i ~/fbkey -b ~/a $FBUSER@$FBIP
# ssh -i ~/fbkey $FBUSER@$FBIP -p 8964 "mkdir -p fbbinaries;mv fb-upload.tar.gz fbbinaries/;cd fbbinaries;tar -xzf *.tar.gz;rm *.tar.gz;mv build/* ./;rmdir build;rm -rf /var/www/storage/*;mv * /var/www/storage/;cd ..;rmdir fbbinaries"

70 changes: 56 additions & 14 deletions io/special_tasks/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
package special_tasks

import (
"io"
"fmt"
"time"
"math"
"bytes"
"phoenixbuilder/fastbuilder/bdump"
"phoenixbuilder/fastbuilder/configuration"
"phoenixbuilder/fastbuilder/environment"
Expand Down Expand Up @@ -45,6 +48,35 @@ type SolidRet struct {

var ExportWaiter chan map[string]interface{}

type byteAndNormalReader interface {
io.Reader
io.ByteReader
}

func readNBTString(reader byteAndNormalReader) (string, error) {
// Code mainly from gophertunnel
var length uint32
for i:=uint(0);i<35;i+=7 {
b, err:=reader.ReadByte()
if(err!=nil) {
return "", fmt.Errorf("Early EOF")
}
length|=uint32(b&0x7f)<<i
if b&0x80==0 {
break
}
}
if length>math.MaxInt16 {
return "", fmt.Errorf("Invalid string length")
}
buf:=make([]byte, length)
_, err:=io.ReadAtLeast(reader, buf, int(length))
if err!=nil {
return "", fmt.Errorf("Early EOF")
}
return string(buf), nil
}

func CreateExportTask(commandLine string, env *environment.PBEnvironment) *task.Task {
cmdsender:=env.CommandSender
// WIP
Expand Down Expand Up @@ -197,7 +229,7 @@ func CreateExportTask(commandLine string, env *environment.PBEnvironment) *task.
=========
Types for command blocks are checked by their names
Whether a command block is conditional is checked through its data value.
THEY ARE NOT INCLUDED IN NBT DATA.
SINCE IT IS NOT INCLUDED IN NBT DATA.
normal
\x01\x00\x00\x00\x00\x01\x00\x00\x00\bsay test\"\x00\x00\x00\x00\x01\xfa\xcd\x03\x00\x00
Expand Down Expand Up @@ -230,24 +262,34 @@ func CreateExportTask(commandLine string, env *environment.PBEnvironment) *task.
}else if(block=="chain_command_block"||block=="minecraft:chain_command_block"){
mode=packet.CommandBlockChain
}
tagContent:=bytes.NewBuffer(__tag)
tagContent.Next(9)
len_tag:=len(__tag)
tickdelay:=int32(__tag[len_tag-2])/2
exeft:=__tag[len_tag-1]
aut:=__tag[4]
trackoutput:=__tag[len_tag-6]
cmdlen:=__tag[9]
cmd:=string(__tag[10:10+cmdlen])
//cmd:=item["Command"].(string)
cusname_len:=__tag[10+cmdlen+2]
cusname:=string(__tag[10+cmdlen+2+1:10+cmdlen+2+1+cusname_len])
//cusname:=item["CustomName"].(string)
lo_len:=__tag[10+cmdlen+2+1+cusname_len]
lo:=string(__tag[10+cmdlen+2+1+cusname_len+1:10+cmdlen+2+1+cusname_len+1+lo_len])
//exeft:=item["ExecuteOnFirstTick"].(uint8)
//tickdelay:=item["TickDelay"].(int32)
//aut:=item["auto"].(uint8)
//trackoutput:=item["TrackOutput"].(uint8)
//lo:=item["LastOutput"].(string)
//cmdlen:=__tag[9]
//cmd:=string(__tag[10:10+cmdlen])
//fmt.Printf("%s\n",cmd)
cmd, err:=readNBTString(tagContent)
if err!=nil {
panic(err)
}
//fmt.Printf("%s\n",cmd)
tagContent.Next(2)
cusname, err:=readNBTString(tagContent)
//cusname_len:=__tag[10+cmdlen+2]
//cusname:=string(__tag[10+cmdlen+2+1:10+cmdlen+2+1+cusname_len])
if err!=nil {
panic(err)
}
lo, err:=readNBTString(tagContent)
//lo_len:=__tag[10+cmdlen+2+1+cusname_len]
//lo:=string(__tag[10+cmdlen+2+1+cusname_len+1:10+cmdlen+2+1+cusname_len+1+lo_len])
if err!=nil {
panic(err)
}
conb_bit:=static_item["conditional_bit"].(uint8)
conb:=false
if conb_bit==1 {
Expand Down

0 comments on commit a0bcb8f

Please sign in to comment.