Skip to content

Commit

Permalink
Update readme, clean up output
Browse files Browse the repository at this point in the history
  • Loading branch information
grumpypixel committed Feb 2, 2021
1 parent 88c9a46 commit 0cd3f09
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ The GoPilot is just another browser-based VFR map for Microsoft's Flight Simulat
* Teleport Service
* Pick a point on the map, select the desired altitude, heading and airspeed and off you go

## How do I run the GoPilot?
## Releases

There are no releases yet. At the moment you can only run the program from the command line.
Download the latest version [here](https://github.com/grumpypixel/msfs2020-gopilot/releases)

Windows Command Prompt:
```console
$ build.bat
$ gopilot.exe
```
## How do I build GoPilot myself?

Assuming you have installed Go on your machine and cloned/downloaded the repo, you can build & run GoPilot as follows:

Bash:
```console
Expand All @@ -34,7 +32,11 @@ $ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -o gopilot.exe gopilot/main.g
$ ./gopilot.exe
```

Note: You should start GoPilot on the same Windows machine your Simulator is running.
Windows Command Prompt:
```console
$ build.bat
$ gopilot.exe
```

## GoPilot command-line options

Expand All @@ -54,7 +56,7 @@ $ gopilot.exe --name POTATOSQUAD --searchpath ../.. --address 0.0.0.13370 --time

The gopilot.exe starts a local web server which you can connect to with a browser.

So open the browser of your choice and type the following into the address bar:
Now open the browser of your choice and type the following into the address bar:

```console
http://localhost:8888/
Expand All @@ -73,6 +75,8 @@ The following web server routes are available:
* `/teleport` opens the Teleport Service. Be advised not to teleport yourself into the ground mistakenly.
* `/mehmap` opens a plain & simple map without distractions. (So no HUD. No nothing. Meh.)
* `/setdata` opens an *experimental* page where you can manually set data on the *sim object*. DO NOT USE THIS if you don't know what you're doing. This might (and probably will) CRASH your simulator. Seriously.
* `/simvars` display all registered simulation variables (no auto-update)
* `/debug` display debug information (also no auto-update)

Examples:
* `http://localhost:8888/vfrmap` or simply: `http://localhost:8888`
Expand Down
10 changes: 6 additions & 4 deletions gopilot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const (
defaultConnectionName = "GoPilot"
defaultServerAddress = "0.0.0.0:8888"
defaultSearchPath = "."
githubRoot = "http://github.com/grumpypixel/msfs2020-gopilot/"
githubReleases = "http://github.com/grumpypixel/msfs2020-gopilot/releases"
defaultConnectionTimeout = 600
connectRetrySeconds = 1
requestDataInterval = time.Millisecond * 250
Expand All @@ -67,6 +69,7 @@ func init() {
}

func main() {
fmt.Printf("\nWelcome to %s\nProject page: %s\nReleases: %s\n\n", appTitle, githubRoot, githubReleases)
parseParameters()
locateLibrary(params.searchPath)

Expand All @@ -88,7 +91,7 @@ func parseParameters() {
func locateLibrary(additionalSearchPath string) {
if simconnect.LocateLibrary(additionalSearchPath) == false {
fullpath := path.Join(additionalSearchPath, simconnect.SimConnectDLL)
fmt.Printf("DLL not found in given search paths.\nUnpacking library to: %s\n", fullpath)
fmt.Printf("DLL not found in given search paths\nUnpacking library to: %s\n", fullpath)
if err := simconnect.UnpackDLL(fullpath); err != nil {
fmt.Println("Unable to unpack DLL error:", err)
return
Expand Down Expand Up @@ -150,7 +153,7 @@ func (app *App) initWebServer(address string, shutdown chan bool) {
assetsDir := "/assets/"
webServer.Run(routes, assetsDir)

fmt.Println("Web Server listening on address", address)
fmt.Println("Web Server listening on", address)
fmt.Println("Your network interfaces:")
webServer.ListNetworkInterfaces()
}
Expand All @@ -170,7 +173,7 @@ func (app *App) connect(name string, timeoutSeconds int64) error {
count++
if err := app.mate.Open(name); err != nil {
if count%10 == 0 {
fmt.Printf("...attempts: %d\n", count)
fmt.Printf("Connection attempts... %d\n", count)
}
} else {
return nil
Expand Down Expand Up @@ -210,7 +213,6 @@ func (app *App) handleSocketMessages() {
for {
select {
case event := <-app.socket.EventReceiver:
fmt.Println("main eventreceiver")
eventType := event.Type
switch eventType {
case websockets.SocketEventConnected:
Expand Down

0 comments on commit 0cd3f09

Please sign in to comment.