Compare commits

...

70 Commits

Author SHA1 Message Date
Icedream a6481c8847
Remove old hashes. 2024-05-05 08:15:30 +02:00
Icedream e3fb41f2b1
Merge remote-tracking branch 'origin/renovate/github.com-alecthomas-kingpin-v2-2.x' into develop 2024-05-05 08:15:19 +02:00
Icedream 5cb0ecfc00
Merge remote-tracking branch 'origin/renovate/actions-setup-go-5.x' into develop 2024-05-05 08:15:15 +02:00
Icedream 2f881a0a80
Merge remote-tracking branch 'origin/renovate/golang-1.x' into develop 2024-05-05 08:15:04 +02:00
renovate[bot] 0ed007f423
Update golang Docker tag to v1.22 2024-02-07 07:13:12 +00:00
renovate[bot] 324c0d703d
Update alpine Docker tag to v3.19 2023-12-08 04:16:32 +00:00
renovate[bot] 0ea473d7ea
Update actions/setup-go action to v5 2023-12-06 17:33:32 +00:00
renovate[bot] d1144ee37a
Update module github.com/alecthomas/kingpin/v2 to v2.4.0 2023-11-16 03:42:00 +00:00
Icedream 9bbf1f78fd
Merge remote-tracking branch 'origin/renovate/docker-setup-qemu-action-3.x' into develop 2023-10-02 21:03:42 +02:00
Icedream 07dd58b086
Merge remote-tracking branch 'origin/renovate/docker-setup-buildx-action-3.x' into develop 2023-10-02 21:03:38 +02:00
Icedream 09530afe91
Merge remote-tracking branch 'origin/renovate/docker-metadata-action-5.x' into develop 2023-10-02 21:03:35 +02:00
Icedream e305e0107b
Merge remote-tracking branch 'origin/renovate/docker-login-action-3.x' into develop 2023-10-02 21:03:32 +02:00
Icedream f5e4a2e150
Merge remote-tracking branch 'origin/renovate/docker-build-push-action-5.x' into develop 2023-10-02 21:03:27 +02:00
Icedream 7387bb9f96
Merge remote-tracking branch 'origin/renovate/actions-setup-go-4.x' into develop 2023-10-02 21:03:10 +02:00
renovate[bot] dbd578561d
Update docker/setup-qemu-action action to v3 2023-10-02 19:02:31 +00:00
renovate[bot] 028cf027ac
Update docker/setup-buildx-action action to v3 2023-10-02 19:02:28 +00:00
renovate[bot] b114b440d3
Update docker/metadata-action action to v5 2023-10-02 19:02:24 +00:00
renovate[bot] 19b906da47
Update docker/login-action action to v3 2023-10-02 19:02:20 +00:00
renovate[bot] 45f22fed96
Update docker/build-push-action action to v5 2023-10-02 19:02:16 +00:00
renovate[bot] d2ceedf2b9
Update actions/setup-go action to v4 2023-10-02 19:01:29 +00:00
renovate[bot] 13cbce865a
Update actions/checkout action to v4 2023-10-02 19:01:25 +00:00
renovate[bot] 905790d645
Add renovate.json 2023-10-02 18:59:29 +00:00
Icedream 0c17a8c35a
Update readme. 2023-10-02 20:56:03 +02:00
Icedream f375a025ea
Update kingpin v2 references. 2023-10-02 20:53:52 +02:00
Icedream d84c18c997
Update go & alpine version. 2023-10-02 20:51:56 +02:00
Icedream 4f960bb81e
Update copyright year. 2023-10-02 20:50:10 +02:00
Icedream 0e788c4b73
Add reference to FiveM post. 2022-04-10 03:42:56 +02:00
Icedream 5f38517277
Disable stale workflow for now. 2022-04-10 03:33:06 +02:00
Icedream e327325b27
Fix CVE-2019-11254 by upgrading yaml.v2.
See https://github.com/icedream/icecon/security/dependabot/1.
2022-04-09 16:43:08 +02:00
Icedream ec97251317
Remove Jenkins badge.
We no longer use Jenkins to continuously build and release this app.
2022-04-09 16:40:36 +02:00
Icedream b905774d9d
Update maintenance year. 2022-04-09 16:39:28 +02:00
Icedream 0c690d86c2
Add Docker GitHub workflow. 2022-04-09 16:35:03 +02:00
Icedream 028041236e
Add Docker image files. 2022-04-09 16:27:29 +02:00
Icedream bd8f873d02
Update to Go 1.18. 2022-04-09 16:25:04 +02:00
Icedream 07693583fe
Update go modules. 2022-04-09 16:17:03 +02:00
Icedream 678ba5fc50
Remove submodules. 2022-04-09 16:12:12 +02:00
Icedream 0fa211594f
Add Go module files.
gitea/icedream/icecon/develop There was a failure building this commit Details
2019-09-13 22:53:01 +02:00
Icedream 8984196fd1
Fix stupidity.
gitea/icedream/icecon/develop There was a failure building this commit Details
2019-09-13 22:47:22 +02:00
Icedream 2669400bb1
Integrate GitHub Actions.
gitea/icedream/icecon/develop There was a failure building this commit Details
- Automatically build with Go 1.12.
- Check for stale issues.
2019-09-13 22:41:43 +02:00
Icedream 3b676092d8
Update links in README. 2019-09-13 22:41:37 +02:00
Icedream 57d2cb92da
Merge branch 'master' into develop
gitea/icedream/icecon/develop There was a failure building this commit Details
2019-08-19 16:40:29 +02:00
Icedream 9e86bae2d9
Enable closing of stale issues. 2019-08-19 16:39:53 +02:00
Icedream 38c158778a
Update maintenance badge.
gitea/icedream/icecon/develop There was a failure building this commit Details
2018-10-05 11:12:20 +02:00
Icedream e68f46fcfc
Update copyright text. 2018-10-05 11:11:53 +02:00
Icedream f373428ec4
Update changelog.
Add information about pull request #10.
2018-10-05 11:09:30 +02:00
Icedream 46eab3a322
Merge branch 'TheIndra55-develop' into develop 2018-10-05 11:07:05 +02:00
Indra cb9facd9cc added history limit and fixed formatting 2018-10-04 23:09:01 +02:00
Indra d11db9738f added command history 2018-10-04 15:42:45 +02:00
Icedream 06af870346
Add change log.
gitea/icedream/icecon/develop There was a failure building this commit Details
See http://keepachangelog.com/en/0.3.0/ for information about the change log format that is used.
2017-06-10 18:00:22 +02:00
Icedream 6d22fbee2b
Show address of current server in Windows UI.
Closes #3.
2017-06-10 17:41:07 +02:00
Icedream d38e6e10c0
Update copyright notice. 2017-06-10 17:18:29 +02:00
Icedream ce4ab02bf4
Add dependencies as git submodules. 2017-05-05 13:03:05 +02:00
Icedream 508b5d461e
Jenkinsfile: Don't attempt to download UPX if it will be skipped. 2017-04-21 02:50:18 +02:00
Icedream 48f1ab5f16
Adjust go build flags. 2017-04-21 02:48:11 +02:00
Icedream 12224a9ae3
Fix uintptr type incompatibility with new WALK version. 2017-04-21 02:45:53 +02:00
Icedream 15c418e9b6
Jenkinsfile: Fix UPX not available in PATH error. 2017-04-21 02:43:44 +02:00
Icedream 6f7b4daa7e
Jenkinsfile: Update to Go 1.8.x. 2017-04-21 02:41:07 +02:00
Icedream f148c09563
Jenkinsfile: Replace UPX regex cases with constant strings. 2017-04-21 02:36:14 +02:00
Icedream 11201d12c9
Fix goversioninfo arch flags. 2017-04-21 02:31:44 +02:00
Icedream cb55b85a14
Jenkinsfile: Remove some extra comment lines. 2017-04-21 02:31:34 +02:00
Icedream a2895609ed
Jenkinsfile: Install ui2walk tool. 2017-04-21 02:30:08 +02:00
Icedream 61a2f9ce74
Jenkinsfile: Fix path environment variables. 2017-04-21 02:27:19 +02:00
Icedream 8d7e33545a
Add Jenkinsfile. 2017-04-21 02:23:37 +02:00
Icedream 9e6e209eb4
Bump version info to 1.0.1. 2017-04-21 01:55:51 +02:00
Icedream 26bd990227
Fix linker issues on different Windows architectures. 2017-04-21 01:55:46 +02:00
Icedream 4011bce29b
Update maintenance status. 2017-02-09 11:55:13 +01:00
Icedream 655d7cb094 Save original address string and reuse it in Windows UI. 2016-05-20 12:59:06 +02:00
Icedream d7c14fd3b7 Badges! 2016-05-07 18:40:10 +02:00
Icedream 6e08fe8ba6 Add logo and screenshots to README.md. 2016-05-07 18:30:54 +02:00
Icedream b5af05e6d0 Add reference to releases page for binaries. 2016-05-07 16:22:17 +02:00
21 changed files with 397 additions and 23 deletions

33
.dockerignore Normal file
View File

@ -0,0 +1,33 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
*.syso
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
###
*Docker*
*.docker*
#Jenkinsfile
#.github/*

46
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Docker image build
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Check out the repo
uses: actions/checkout@v4
#-
# name: Log in to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

22
.github/workflows/go.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Go
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: 1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Build
run: go build -v .

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
*.o
*.a
*.so
*.syso
# Folders
_obj

26
CHANGELOG.md Normal file
View File

@ -0,0 +1,26 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- Up and down arrow keys can now be used to scroll through command history to reissue already typed commands. (Windows UI) ([#10](https://github.com/icedream/icecon/pull/10), thanks to @TheIndra55)
- Current server address in title bar. (Windows UI)
### Changed
- Binaries are now compiled statically and using Go 1.18.
- Reuse server address as typed in by the user in connect dialog instead of using resolved IP address. (Windows UI)
- Update copyright text.
- Update several dependencies, including yaml.v2 to fix potential looping resource hog (https://github.com/icedream/icecon/security/dependabot/1).
## [1.0.0] - 2016-05-07
### Added
- Add fully working command line flags, see the help text that can be called by running IceCon with `--help` in a console
- Add graphical UI for Windows (`--gui` or automatically shown when run without parameters)
- Add netcat-style console interface (can be used like netcat to pipe through commands)
- Add script-friendly command line interface (`icecon -c <your command here> <server:port> <password>`)
[Unreleased]: https://github.com/icedream/icecon/compare/v1.0.0...develop
[1.0.0]: https://github.com/icedream/icecon/releases/tag/v1.0.0

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM golang:1.22-alpine AS build
WORKDIR /usr/src/icecon
COPY go.mod go.sum ./
RUN go mod download
COPY * .
RUN go generate -v ./...
RUN go build -v -ldflags "-s -w" .
###
FROM alpine:3.19
COPY --from=build /usr/src/icecon/icecon /usr/local/bin
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/local/bin/icecon"]

107
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,107 @@
def binext(os) {
switch(os) {
case "windows":
return ".exe"
default:
return ""
}
}
def upx(file) {
// Install upx
switch("${env.GOOS}.${env.GOARCH}") {
case "linux.amd64":
case "linux.386":
case "darwin.amd64":
case "darwin.arm":
case "windows.amd64":
case "windows.386":
case "freebsd.386":
case "netbsd.386":
withEnv(["PATH+=${tool "UPX v3.91"}"]) {
if (env.GOOS == "linux") {
sh "GOOS= GOARCH= go get -v github.com/pwaller/goupx"
sh "goupx --no-upx \"$file\""
}
sh "upx --best --ultra-brute \"$file\""
}
break
default:
echo "Skipping UPX compression as it is not supported for $goos/$goarch."
break
}
}
def withGoEnv(os, arch, f) {
// Install go
env.GOROOT = tool "Go 1.8"
switch(arch) {
case "x64":
arch = "amd64"
break
case "x86":
arch = "386"
break
case "armv5":
case "armv6":
case "armv7":
arch = "arm"
break
case "armv8":
arch = "arm64"
break
}
withEnv([
"CGO_ENABLED=1",
"GOARCH=${arch}",
"GOOS=${os}",
"GOPATH=${env.WORKSPACE}/.go",
"PATH+=${env.GOROOT}/bin:${env.WORKSPACE}/.go/bin",
]) {
switch(arch) {
case "armv5":
withEnv("GOARM=5", f)
break
case "armv6":
withEnv("GOARM=6", f)
break
case "armv7":
withEnv("GOARM=7", f)
break
default:
f()
break
}
}
}
def build(os, arch) {
node("docker && linux && amd64") {
checkout scm
docker.image("dockcross/${os}-${arch}").inside {
withGoEnv(os, arch) {
def binfilename = "icecon_${env.GOOS}_${env.GOARCH}${binext os}"
sh """
GOOS= GOARCH= go get -v \
github.com/josephspurrier/goversioninfo/cmd/goversioninfo \
github.com/icedream/ui2walk \
"""
sh "go generate -v ./..."
sh "go get -v -d ./..."
sh "go build -v -ldflags -s -o ${binfilename}"
upx binfilename
archive "${binfilename}"
}
}
}
}
parallel (
windows_x64: { build("windows", "x64") },
windows_x86: { build("windows", "x86") },
linux_x64: { build("linux", "x64") },
linux_x86: { build("linux", "x86") },
linux_arm: { build("linux", "armv5") }
)

View File

@ -1,14 +1,23 @@
# IceCon RCON client
# ![Logo](img/logo_32.png) IceCon RCON client
[![Release version](https://img.shields.io/github/release/icedream/icecon.svg?maxAge=2592000)](https://github.com/icedream/icecon/releases)
![Maintained?](https://img.shields.io/maintenance/yes/2023.svg?maxAge=2592000)
*IceCon* is a Q3-compatible RCON client. It can connect to any server that implements RCON over a Q3-compatible network protocol (UDP) and even comes with a nice, straight minimal GUI.
Specifically, this tool has been written for quick administration of modified Modern Warfare 2 ("IW4M") servers. A Windows user could easily set up shortcuts on the desktop that run `icecon.exe -gui <server:port> <password>` which gives you an instant GUI to run commands on your server. Another use case would be scripting on a Linux server by running `icecon -command "<your command here>" <server:port> <password>` to automate specific tasks.
Specifically, this tool has been written for quick administration of modified Modern Warfare 2 ("IW4M") servers but it [is also officially supported for use with FiveM servers](https://forum.cfx.re/t/release-icecon-the-officially-supported-rcon-tool/7558).
A Windows user could easily set up shortcuts on the desktop that run `icecon.exe -gui <server:port> <password>` which gives you an instant GUI to run commands on your server. Another use case would be scripting on a Linux server by running `icecon -command "<your command here>" <server:port> <password>` to automate specific tasks.
![Screenshot 1](img/screenshot1.png)
![Screenshot 2](img/screenshot2.png)
![Screenshot 3](img/screenshot3.png)
## Download
### Binaries
Binaries will be provided as soon as possible, both stable and snapshots!
Binaries for all releases for Linux and Windows are always available on the [GitHub releases page](https://github.com/icedream/icecon/releases).
### Source code

12
go.mod Normal file
View File

@ -0,0 +1,12 @@
module github.com/icedream/icecon
go 1.12
require (
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/icedream/go-q3net v0.1.0
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
golang.org/x/sys v0.12.0 // indirect
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
)

37
go.sum Normal file
View File

@ -0,0 +1,37 @@
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/icedream/go-q3net v0.1.0 h1:ly5QS55sXAs7HunlCPDsUmS6QLYqP6kGBdupwufaiC4=
github.com/icedream/go-q3net v0.1.0/go.mod h1:2Y0epYeaR6uWXDMvapfsUkLDqAXhI8mp/J5LxO86eUU=
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 h1:NVRJ0Uy0SOFcXSKLsS65OmI1sgCCfiDUPj+cwnH7GZw=
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ=
github.com/lxn/win v0.0.0-20210218163916-a377121e959e h1:H+t6A/QJMbhCSEH5rAuRxh+CtW96g0Or0Fxa9IKr4uc=
github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc=
gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E=
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/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

BIN
img/logo_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
img/screenshot1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
img/screenshot2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
img/screenshot3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

10
main.go
View File

@ -10,8 +10,8 @@ import (
"os"
"strings"
"github.com/icedream/go-q3net"
"gopkg.in/alecthomas/kingpin.v2"
"github.com/alecthomas/kingpin/v2"
quake "github.com/icedream/go-q3net"
)
var (
@ -23,6 +23,7 @@ var (
argPassword = kingpin.Arg("password", "The RCON password.")
address *net.UDPAddr
addressStr string
password string
socket *net.UDPConn
@ -39,7 +40,7 @@ func initSocketAddr(addr string) (err error) {
return
}
address = newAddr
address, addressStr = newAddr, addr
return
}
@ -116,7 +117,7 @@ func usage() {
func main() {
fmt.Println("IceCon - Icedream's RCON Client")
fmt.Println("\t\u00A9 2016 Carl Kittelberger/Icedream")
fmt.Println("\t\u00A9 2016-2023 Carl Kittelberger/Icedream")
fmt.Println()
argAddressTCP := argAddress.TCP()
@ -181,7 +182,6 @@ func main() {
if socket != nil {
socket.Close()
}
}
func runConsoleShell() {

View File

@ -1,4 +1,5 @@
//+build windows
//go:build windows
// +build windows
package main
@ -10,8 +11,8 @@ import (
"strings"
"syscall"
"github.com/alecthomas/kingpin/v2"
"github.com/lxn/walk"
"gopkg.in/alecthomas/kingpin.v2"
)
var (
@ -26,6 +27,10 @@ var (
freeConsole *syscall.Proc
dlg *mainDialog
dlgOriginalTitle string
history []string
historyIndex = 0
)
func init() {
@ -59,6 +64,27 @@ func uiNormalize(textRef *string) {
*textRef = text
}
func uiUpdateAddress() {
if len(dlgOriginalTitle) <= 0 {
dlgOriginalTitle = dlg.Title()
}
if len(addressStr) > 0 {
dlg.SetTitle(dlgOriginalTitle + " - " + addressStr)
} else {
dlg.SetTitle(dlgOriginalTitle)
}
}
func addToHistory(command string) {
// limit history to 20 items
if len(history) > 20 {
history = append(history[:0], history[0+1:]...)
}
history = append(history, command)
historyIndex = len(history)
}
func runGraphicalUi() (err error) {
dlg = new(mainDialog)
if err := dlg.init(); err != nil {
@ -68,7 +94,7 @@ func runGraphicalUi() (err error) {
// Window icon
// TODO - Do this more intelligently
for i := uintptr(0); i < uintptr(128); i++ {
for i := 0; i < 128; i++ {
if icon, err := walk.NewIconFromResourceId(i); err == nil {
dlg.SetIcon(icon)
break
@ -91,10 +117,6 @@ func runGraphicalUi() (err error) {
return
}
connectAction.Triggered().Attach(func() {
addressStr := ""
if address != nil {
addressStr = address.String()
}
result, addr, pw, err := runConnectDialog(addressStr, password, dlg)
if err != nil {
uiLogError(fmt.Sprintf("Failed to run connect dialog: %s", err))
@ -107,6 +129,7 @@ func runGraphicalUi() (err error) {
}
password = pw
dlg.ui.rconOutput.SetText("")
uiUpdateAddress()
}
})
if err = dlg.Menu().Actions().Add(connectAction); err != nil {
@ -115,6 +138,31 @@ func runGraphicalUi() (err error) {
// Handle input
dlg.ui.rconInput.KeyPress().Attach(func(key walk.Key) {
// handle history (arrow up/down)
if key == walk.KeyUp || key == walk.KeyDown {
if len(history) == 0 {
return
}
if key == walk.KeyUp {
if historyIndex == 0 {
return
}
historyIndex -= 1
dlg.ui.rconInput.SetText(history[historyIndex])
} else {
if (historyIndex + 1) >= len(history) {
return
}
historyIndex += 1
dlg.ui.rconInput.SetText(history[historyIndex])
}
return
}
if key != walk.KeyReturn {
return
}
@ -129,11 +177,16 @@ func runGraphicalUi() (err error) {
uiLog(address.String() + "> " + cmd)
sendRcon(cmd)
// add to history
addToHistory(cmd)
})
// When window is initialized we can let a secondary routine print all
// output received
dlg.Synchronize(func() {
uiUpdateAddress()
go func() {
for {
msg, err := receiveRcon()

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}

Binary file not shown.

View File

@ -1,4 +1,4 @@
//+build windows
// +build windows,386
package main

5
rsrc_windows_amd64.go Normal file
View File

@ -0,0 +1,5 @@
// +build windows,amd64
package main
//go:generate goversioninfo -manifest "rsrc/app.manifest" -icon "rsrc/app.ico" -o "rsrc_windows.syso" -64

View File

@ -4,13 +4,13 @@
"FileVersion": {
"Major": 1,
"Minor": 0,
"Patch": 0,
"Patch": 1,
"Build": 0
},
"ProductVersion": {
"Major": 1,
"Minor": 0,
"Patch": 0,
"Patch": 1,
"Build": 0
},
"FileFlagsMask": "3f",
@ -24,14 +24,14 @@
"Comments": "IceCon",
"CompanyName": "",
"FileDescription": "Icedream's RCON client",
"FileVersion": "1.0.0.0",
"FileVersion": "1.0.1.0",
"InternalName": "icecon",
"LegalCopyright": "",
"LegalTrademarks": "",
"OriginalFilename": "icecon.exe",
"PrivateBuild": "1",
"ProductName": "IceCon",
"ProductVersion": "1.0.0.0",
"ProductVersion": "1.0.1.0",
"SpecialBuild": ""
},
"VarFileInfo":