Skip to content

Commit

Permalink
Fix Conan Exiles response for another request error #6
Browse files Browse the repository at this point in the history
  • Loading branch information
outdead committed Jul 10, 2020
1 parent 93e58f4 commit acf64b9
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build.sh
vendor/
Gopkg.lock
release/
logs/
*.log
rcon-temp.yaml
temp/
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [v0.6.0] - 2020-07-10
### Fixed
- Fix `Conan Exiles "response for another request" error` bug #6

## [v0.5.0] - 2020-06-18
### Fixed
- Correction of text after AutoCorrect
Expand Down Expand Up @@ -43,7 +47,8 @@ than entry in configuration file.
### Added
- Initial implementation.

[Unreleased]: https://github.com/gorcon/rcon-cli/compare/v0.5.0...HEAD
[Unreleased]: https://github.com/gorcon/rcon-cli/compare/v0.6.0...HEAD
[v0.5.0]: https://github.com/gorcon/rcon-cli/compare/v0.5.0...v0.6.0
[v0.5.0]: https://github.com/gorcon/rcon-cli/compare/v0.4.0...v0.5.0
[v0.4.0]: https://github.com/gorcon/rcon-cli/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/gorcon/rcon-cli/compare/v0.2.0...v0.3.0
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Pavel Korotkiy
Copyright (c) 2020 Pavel Korotkiy (outdead)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.13

require (
github.com/go-yaml/yaml v2.1.0+incompatible
github.com/gorcon/rcon v1.1.2
github.com/gorcon/rcon v1.2.0
github.com/stretchr/testify v1.6.1
github.com/urfave/cli v1.22.4
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/gorcon/rcon v1.1.2 h1:rXuVvExPoIFSFbqdci/VTluOuksYY0HRxmuzVMV6aLw=
github.com/gorcon/rcon v1.1.2/go.mod h1:PETQ9mPvdT1SSRoX3d4zBpTZdpDZ2m6672czgylgchc=
github.com/gorcon/rcon v1.2.0 h1:g4JOGxZZRab4xtwWnJKErsY3s/V1OR5BfnZ22o0fl88=
github.com/gorcon/rcon v1.2.0/go.mod h1:PETQ9mPvdT1SSRoX3d4zBpTZdpDZ2m6672czgylgchc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
Expand All @@ -19,7 +19,9 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
24 changes: 13 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const LogRecordFormat = "[%s] %s: %s\n%s\n\n"
// If not specified, no logging will be performed.
var LogFileName string

// Version displays service version in semantic versioning (http://semver.org/).
// Can be replaced while compiling with flag `-ldflags "-X main.Version=${VERSION}"`
var Version = "develop"

// Config allows to take a remote server address and password from
// the configuration file. This enables not to specify these flags when
// running the CLI.
Expand All @@ -63,14 +67,14 @@ func main() {
}
}

// NewApp creates a new cli Application
// NewApp creates a new cli Application.
func NewApp(r io.Reader, w io.Writer) *cli.App {
app := cli.NewApp()
app.Usage = "CLI for executing queries on a remote server"
app.Description = "Can be run in two modes - in the mode of a single query" +
"\n and in the mode of reading the input stream"
app.Version = "0.4.2"
app.Copyright = "Copyright (c) 2019 Pavel Korotkiy (outdead)"
app.Version = Version
app.Copyright = "Copyright (c) 2020 Pavel Korotkiy (outdead)"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "a, address",
Expand Down Expand Up @@ -112,14 +116,12 @@ func NewApp(r io.Reader, w io.Writer) *cli.App {
return Interactive(r, w, address, password)
}

if address == "" || password == "" {
if address == "" {
return errors.New("address is not set: to set address add -a host:port")
}
if address == "" {
return errors.New("address is not set: to set address add -a host:port")
}

if password == "" {
return errors.New("password is not set: to set password add -p password")
}
if password == "" {
return errors.New("password is not set: to set password add -p password")
}

return Execute(w, address, password, command)
Expand Down Expand Up @@ -173,7 +175,7 @@ func Interactive(r io.Reader, w io.Writer, address string, password string) erro
}

scanner := bufio.NewScanner(r)
fmt.Fprintf(w, "Waiting commands for %s\n> ", address)
fmt.Fprintf(w, "Waiting commands for %s (or type %s to exit)\n> ", address, CommandQuit)
for scanner.Scan() {
command := scanner.Text()
if command != "" {
Expand Down
43 changes: 24 additions & 19 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env bash

VER="0.5.0"
VERSION="$1"

if [ -z "${VERSION}" ]; then
echo "VERSION is not set. Use ./release.sh 0.0.0" >&2
exit 1
fi

rm -fr release
mkdir release
Expand All @@ -16,33 +21,33 @@ function make_release() {
fi
local ext="$4"

local dir=release/$release_name
local dir="release/${release_name}"

mkdir -p $dir
env GOARCH=$arch GOOS=$os go build -ldflags "-s -w" -o $dir/rcon$ext
#upx-ucl --best $dir/rcon$ext -o $dir/rcon-upx$ext
mkdir -p "${dir}"
env GOARCH="${arch}" GOOS="${os}" go build -ldflags "-s -w -X main.Version=${VERSION}" -o "${dir}/rcon${ext}"
#upx-ucl --best "${dir}/rcon${ext}" -o "${dir}/rcon-upx${ext}"

cp LICENSE $dir
cp README.md $dir
cp CHANGELOG.md $dir
cp rcon.yaml $dir
cp LICENSE "${dir}"
cp README.md "${dir}"
cp CHANGELOG.md "${dir}"
cp rcon.yaml "${dir}"

cd release/
case $os in
case "${os}" in
linux)
tar -zcvf $release_name.tar.gz $release_name
md5sum $release_name.tar.gz >> checksum.txt
tar -zcvf "${release_name}.tar.gz" "${release_name}"
md5sum "${release_name}.tar.gz" >> checksum.txt
;;
windows)
zip -r $release_name.zip $release_name
md5sum $release_name.zip >> checksum.txt
zip -r "${release_name}.zip" "${release_name}"
md5sum "${release_name}.zip" >> checksum.txt
;;
esac
rm -r $release_name
rm -r "${release_name}"
cd ../
}

make_release 386 linux rcon-$VER-i386_linux
make_release amd64 linux rcon-$VER-amd64_linux
make_release 386 windows rcon-$VER-win32 .exe
make_release amd64 windows rcon-$VER-win64 .exe
make_release 386 linux "rcon-${VERSION}-i386_linux"
make_release amd64 linux "rcon-${VERSION}-amd64_linux"
make_release 386 windows "rcon-${VERSION}-win32" .exe
make_release amd64 windows "rcon-${VERSION}-win64" .exe

0 comments on commit acf64b9

Please sign in to comment.