Skip to content

Commit

Permalink
cmd/vinegar: run mutexer only on player; check for failure
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Feb 13, 2024
1 parent 0c5a1e9 commit 16bc4ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,19 @@ func (b *Binary) Run(args ...string) error {
}
}

if b.GlobalConfig.MultipleInstances {
// Studio can run in multiple instances, not Player
if b.GlobalConfig.MultipleInstances && b.Type == roblox.Player {
slog.Info("Running robloxmutexer")

mutexer := b.Prefix.Wine(filepath.Join(BinPrefix, "robloxmutexer.exe"))
if err := mutexer.Start(); err != nil {
return fmt.Errorf("start robloxmutexer: %w", err)
}
go func() {
if err := mutexer.Wait(); err != nil {
slog.Error("robloxmutexer returned too early", "error", err)
}
}()
}

cmd, err := b.Command(args...)
Expand Down Expand Up @@ -346,7 +352,7 @@ func (b *Binary) Tail(name string) {
}

for line := range t.Lines {
fmt.Fprintln(b.Prefix.Stderr, line.Text)
// fmt.Fprintln(b.Prefix.Stderr, line.Text)

if b.Config.DiscordRPC {
if err := b.Activity.HandleRobloxLog(line.Text); err != nil {
Expand Down

0 comments on commit 16bc4ba

Please sign in to comment.