Skip to content

Commit

Permalink
Try udp listener
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Mar 4, 2024
1 parent 27c50e7 commit 8be0a42
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 148 deletions.
11 changes: 7 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ func getUserLaunchArgs(steamRoot string, steamID steamid.SID64) ([]string, error
return launchOpts, nil
}

func getLaunchArgs(rconPass string, rconPort uint16, steamRoot string, steamID steamid.SID64) ([]string, error) {
func getLaunchArgs(rconPass string, rconPort uint16, steamRoot string, steamID steamid.SID64, udpEnabled bool, udpAddr string) ([]string, error) {
userArgs, errUserArgs := getUserLaunchArgs(steamRoot, steamID)
if errUserArgs != nil {
return nil, errors.Join(errUserArgs, errSteamLaunchArgs)
}

bdArgs := []string{
"-game", "tf",
//"-noreactlogin", // needed for vac to load as of late 2022?
// "-noreactlogin", // needed for vac to load as of late 2022?
"-steam",
"-secure",
"-usercon",
Expand All @@ -133,11 +133,14 @@ func getLaunchArgs(rconPass string, rconPort uint16, steamRoot string, steamID s
"+hostport", fmt.Sprintf("%d", rconPort),
"+net_start",
"+con_timestamp", "1",
"-condebug",
"-conclearlog",
"-rpt", // Same as having -condebug, -conclearlog, and -console enabled
"-g15",
}

if udpEnabled {
bdArgs = append(bdArgs, "+logaddress_add", udpAddr)
}

var full []string //nolint:prealloc

for _, arg := range append(bdArgs, userArgs...) {
Expand Down
135 changes: 0 additions & 135 deletions console.go

This file was deleted.

1 change: 1 addition & 0 deletions domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ var (
errHTTPShutdown = errors.New("failed to shutdown http service")
errTempDir = errors.New("failed to create temp dir")
errSettingsBDAPIAddr = errors.New("bd-api address invalid")
errResolveAddr = errors.New("failed to resolve address")
)

const (
Expand Down
2 changes: 1 addition & 1 deletion history.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type chatRecorder struct {
db store.Querier
}

func newChatRecorder(db store.Querier, ingest *logIngest) chatRecorder {
func newChatRecorder(db store.Querier, ingest *eventBroadcaster) chatRecorder {
cr := chatRecorder{
incoming: make(chan LogEvent),
db: db,
Expand Down
Loading

0 comments on commit 8be0a42

Please sign in to comment.