Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta45 #115

Merged
merged 59 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
1479feb
beta9
Hoshinonyaruko Jan 26, 2024
4a6f523
beta11
Hoshinonyaruko Jan 26, 2024
8739198
beta11
Hoshinonyaruko Jan 26, 2024
d9e0844
beta13
Hoshinonyaruko Jan 26, 2024
ab96bf7
beta14
Hoshinonyaruko Jan 26, 2024
9b7bf0e
beta12
Hoshinonyaruko Jan 26, 2024
7c66e7d
beta13
Hoshinonyaruko Jan 26, 2024
eb0b186
beta15
Hoshinonyaruko Jan 26, 2024
122de8b
beta16
Hoshinonyaruko Jan 26, 2024
5e4903f
beta17
Hoshinonyaruko Jan 26, 2024
7a82cfb
beta18
Hoshinonyaruko Jan 27, 2024
ecc8263
mergefix
Hoshinonyaruko Jan 27, 2024
d0a0a85
beta19
Hoshinonyaruko Jan 27, 2024
afcb856
beta20
Hoshinonyaruko Jan 27, 2024
fafe0f9
beta20
Hoshinonyaruko Jan 27, 2024
397d4c7
beta21
Hoshinonyaruko Jan 27, 2024
c00e1a8
fixmerge
Hoshinonyaruko Jan 27, 2024
42ed202
add_playermanager_api
Hoshinonyaruko Jan 27, 2024
31a6771
beta22
Hoshinonyaruko Jan 27, 2024
050d359
beta22
Hoshinonyaruko Jan 27, 2024
939e818
beta23
Hoshinonyaruko Jan 28, 2024
19cf927
merge
Hoshinonyaruko Jan 28, 2024
8073f3a
beta24
Hoshinonyaruko Jan 29, 2024
fdd6016
mergechanges
Hoshinonyaruko Jan 29, 2024
b167455
beta25
Hoshinonyaruko Jan 30, 2024
844698b
merge
Hoshinonyaruko Jan 30, 2024
f5c8d82
beta26
Hoshinonyaruko Jan 30, 2024
2d5e94d
merge
Hoshinonyaruko Jan 30, 2024
3076085
beta27
Hoshinonyaruko Jan 30, 2024
a8a67ed
beta28
Hoshinonyaruko Jan 31, 2024
4c954fa
beta28
Hoshinonyaruko Jan 31, 2024
2f9063e
beta28
Hoshinonyaruko Jan 31, 2024
cd6fad7
beta29
Hoshinonyaruko Jan 31, 2024
2651176
beta29
Hoshinonyaruko Jan 31, 2024
265b5e3
beta30
Hoshinonyaruko Jan 31, 2024
8aac47a
beta31
Hoshinonyaruko Feb 2, 2024
a559fa2
beta31
Hoshinonyaruko Feb 2, 2024
f5bb66a
beta32
Hoshinonyaruko Feb 2, 2024
44fac8f
beta33
Hoshinonyaruko Feb 6, 2024
a44ef68
merge
Hoshinonyaruko Feb 6, 2024
e731f93
beta34
Hoshinonyaruko Feb 8, 2024
c8921a1
beta34
Hoshinonyaruko Feb 8, 2024
e6b4a3e
beta35
Hoshinonyaruko Feb 8, 2024
ac77292
merge
Hoshinonyaruko Feb 8, 2024
3992e84
beta35
Hoshinonyaruko Feb 8, 2024
d19fc5c
beta36
Hoshinonyaruko Feb 8, 2024
ff271bc
merge
Hoshinonyaruko Feb 8, 2024
a451334
beta37
Hoshinonyaruko Feb 18, 2024
6e4f28c
beta37
Hoshinonyaruko Feb 18, 2024
89d6c06
beta38
Hoshinonyaruko Feb 18, 2024
75002bc
beta39
Hoshinonyaruko Feb 18, 2024
e808a36
beta40
Hoshinonyaruko Feb 18, 2024
d2d5f4c
beta41
Hoshinonyaruko Feb 25, 2024
a40afd7
beta41
Hoshinonyaruko Feb 25, 2024
5977c8d
beat43
Hoshinonyaruko Mar 2, 2024
0ca7960
beta43
Hoshinonyaruko Mar 2, 2024
44b7bb5
beta45
Hoshinonyaruko Mar 2, 2024
d40d897
beta45
Hoshinonyaruko Mar 2, 2024
d48a772
Merge branch 'main' into beta45
Hoshinonyaruko Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/hoshinonyaruko/palworld-go

go 1.21.1

replace github.com/gorcon/rcon => ./rcon

require github.com/gorcon/rcon v1.3.4 // direct

require (
Expand Down
3 changes: 3 additions & 0 deletions rcon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
.vscode/
vendor/
194 changes: 194 additions & 0 deletions rcon/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
run:
skip-dirs:
- vendor/
skip-files:
- ".*_test.go$"

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true

# SEE: https://golangci-lint.run/usage/configuration/
linters-settings:
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
funlen:
# default is 60
lines: 60
# default is 40
statements: 40
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 15
goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 2
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- paramTypeCombine
# - whyNoLint
# - commentedOutCode
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 15
cyclop:
max-complexity: 15
godox:
keywords:
- "BUG"
- "FIXME"
# - "TODO"
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/golangci/golangci-lint
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
gomnd:
settings:
mnd:
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
checks: argument,case,condition,operation,return,assign
govet:
# report about shadowed variables.
check-shadowing: true
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/Sirupsen/logrus
- gopkg.in/sirupsen/logrus.v0
- gopkg.in/sirupsen/logrus.v1
- gopkg.in/Sirupsen/logrus.v0
- gopkg.in/Sirupsen/logrus.v1
lll:
line-length: 120 # 120 is default
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
misspell:
locale: US
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
whitespace:
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
wsl:
# If true append is only allowed to be cuddled if appending value is
# matching variables, fields or types on line above. Default is true.
strict-append: true
# Allow calls and assignments to be cuddled as long as the lines have any
# matching variables, fields or types. Default is true.
allow-assign-and-call: true
# Allow multiline assignments to be cuddled. Default is true.
allow-multiline-assign: true
# Allow declarations (var) to be cuddled.
allow-cuddle-declarations: true
# Allow trailing comments in ending of blocks
allow-trailing-comment: true
# Force newlines in end of case at this limit (0 = never).
force-case-trailing-whitespace: 0
varnamelen:
# The longest distance, in source lines, that is being considered a "small scope." (defaults to 5)
# Variables used in at most this many lines will be ignored.
max-distance: 5
# The minimum length of a variable's name that is considered "long." (defaults to 3)
# Variable names that are at least this long will be ignored.
min-name-length: 3
# Check method receivers. (defaults to false)
check-receiver: false
# Check named return values. (defaults to false)
check-return: false
# Check type parameters. (defaults to false)
check-type-param: false
# Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to false)
ignore-type-assert-ok: false
# Ignore "ok" variables that hold the bool return value of a map index. (defaults to false)
ignore-map-index-ok: false
# Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to false)
ignore-chan-recv-ok: false
# Optional list of variable names that should be ignored completely. (defaults to empty list)
ignore-names:
- err
# Optional list of variable declarations that should be ignored completely. (defaults to empty list)
# Entries must be in one of the following forms (see below for examples):
# - for variables, parameters, named return values, method receivers, or type parameters:
# <name> <type> (<type> can also be a pointer/slice/map/chan/...)
# - for constants: const <name>
ignore-decls:
- t testing.T
- f *foo.Bar
- e error
- i int
- const C
- T any
- m map[string]int
- x int
- y int
- w io.Writer
- r io.Reader
- i int64
- f *os.File
- m int
- n int64
- i int32
- c *Context

linters:
enable-all: true
disable:
- interfacer # is deprecated (since v1.38.0)
- scopelint # is deprecated (since v1.39.0)
- golint # is deprecated (since v1.41.0)
- maligned # is deprecated (since v1.38.0)
- ifshort # is deprecated (since v1.48.0)
- deadcode # is deprecated (since v1.49.0)
- nosnakecase # is deprecated (since v1.48.1)
- varcheck # is deprecated (since v1.49.0)
- exhaustivestruct # is deprecated (since v1.46.0)
- structcheck # is deprecated (since v1.49.0)
- rowserrcheck # is disabled because of generics
- sqlclosecheck # is disabled because of generics
- structcheck # is disabled because of generics
- wastedassign # is disabled because of generics
- dupword
- gomnd
- wrapcheck

issues:
exclude:
- "don't use ALL_CAPS in Go names; use CamelCase" # golint
- "ST1003: should not use ALL_CAPS in Go names; use CamelCase instead" # stylecheck
- "shadow: declaration of \"err\"" # govet
- "DefaultSettings`? is a global variable" # gochecknoglobals
- "are|is missing in" # exhaustivestruct # v1.33
107 changes: 107 additions & 0 deletions rcon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Changelog
All notable changes to this project will be documented in this file.

**ATTN**: This project uses [semantic versioning](http://semver.org/).

## [Unreleased]

## [v1.3.4] - 2022-11-12
### Fixed
- Minor fixes in packet package.

### Updated
- Updated Golang version to 1.19.
- Updated golangci linter to 1.50.1 version.

## [v1.3.3] - 2022-05-16
### Fixed
- Added "response from not rcon server" error on auth request (Re fixed panic: runtime error: makeslice: len out of range in rcon.Dial #5).

## [v1.3.2] - 2022-05-16
### Fixed
- Fixed panic: runtime error: makeslice: len out of range in rcon.Dial

### Updated
- Updated golangci linter to 1.42.1 version

## [v1.3.1] - 2021-01-06
### Updated
- Updated golangci linter to 1.33 version

### Changed
- Changed errors handling - added wrapping.

## [v1.3.0] - 2020-12-02
### Fixed
- Fixed wrong number of bytes written in Packet WriteTo function.

### Added
- Added rcontest Server for mocking RCON connections.

## [v1.2.4] - 2020-11-14
### Added
- Added the ability to run tests on a real Project Zomboid server. To do this, set environment variables
`TEST_PZ_SERVER=true`, `TEST_PZ_SERVER_ADDR` and `TEST_PZ_SERVER_PASSWORD` with address and password from Project Zomboid
remote console.
- Added the ability to run tests on a real Rust server. To do this, set environment variables `TEST_RUST_SERVER=true`,
`TEST_RUST_SERVER_ADDR` and `TEST_RUST_SERVER_PASSWORD` with address and password from Rust remote console.
- Added invalid padding test.

### Changed
- Changed CI workflows and related badges. Integration with Travis-CI was changed to GitHub actions workflow. Golangci-lint
job was joined with tests workflow.

## [v1.2.3] - 2020-10-20
### Fixed
- Fixed read/write deadline. The deadline was started from the moment the connection was established and was not updated
after the command was sent.

## [v1.2.2] - 2020-10-18
### Added
- Added one more workaround for Rust server. When sent command "Say" there is no response data from server
with packet.ID = SERVERDATA_EXECCOMMAND_ID, only previous console message that command was received with
packet.ID = -1, therefore, forcibly set packet.ID to SERVERDATA_EXECCOMMAND_ID.

## [v1.2.1] - 2020-10-06
### Added
- Added authentication failed test.

### Changed
- Updated Golang version to 1.15.

## [v1.2.0] - 2020-07-10
### Added
- Added options to Dial. It is possible to set timeout and deadline settings.

### Fixed
- Change `SERVERDATA_AUTH_ID` and `SERVERDATA_EXECCOMMAND_ID` from 42 to 0. Conan Exiles has a bug because of which it
always responds 42 regardless of the value of the request ID. This is no longer relevant, so the values have been
changed.

### Changed
- Renamed `DefaultTimeout` const to `DefaultDeadline`
- Changed default timeouts from 10 seconds to 5 seconds

## [v1.1.2] - 2020-05-13
### Added
- Added go modules (go 1.13).
- Added golangci.yml linter config. To run linter use `golangci-lint run` command.
- Added CHANGELOG.md.
- Added more tests.

## v1.0.0 - 2019-07-27
### Added
- Initial implementation.

[Unreleased]: https://github.com/gorcon/rcon/compare/v1.3.4...HEAD
[v1.3.4]: https://github.com/gorcon/rcon/compare/v1.3.3...v1.3.4
[v1.3.3]: https://github.com/gorcon/rcon/compare/v1.3.2...v1.3.3
[v1.3.2]: https://github.com/gorcon/rcon/compare/v1.3.1...v1.3.2
[v1.3.1]: https://github.com/gorcon/rcon/compare/v1.3.0...v1.3.1
[v1.3.0]: https://github.com/gorcon/rcon/compare/v1.2.4...v1.3.0
[v1.2.4]: https://github.com/gorcon/rcon/compare/v1.2.3...v1.2.4
[v1.2.3]: https://github.com/gorcon/rcon/compare/v1.2.2...v1.2.3
[v1.2.2]: https://github.com/gorcon/rcon/compare/v1.2.1...v1.2.2
[v1.2.1]: https://github.com/gorcon/rcon/compare/v1.2.0...v1.2.1
[v1.2.0]: https://github.com/gorcon/rcon/compare/v1.1.2...v1.2.0
[v1.1.2]: https://github.com/gorcon/rcon/compare/v1.0.0...v1.1.2
21 changes: 21 additions & 0 deletions rcon/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading