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

Windows exe for server #20

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,23 @@ usage: src/app.rb [options]
-p2n, --p2_name player 2 name
--help print this help
```

### Server as .exe

> [!Note]
> This mode is not recommended unless absolutely necessary.
> Consider using this to provide server access for students that cannot install ruby on their machine.
> Students that can install ruby on their own machine already have everything they need to run the server with the instructions above.

- Ensure Ruby 3.3.5 is installed: `ruby -v`
- Install ocran: `gem install ocran`
- Navigate to the server directory: `cd server`
- Locate the public IP of the client
- Generate exe: `rake "exe[<IP>]"` (replace `<IP>` with the IP from above)

Note that this exe will only execute in one player mode on port 9090 for the given IP with all other default settings (default map, no fast mode, etc).

If you want an exe with custom settings:

- copy the orcan command from the exe rake task in `server/Rakefile`
- append additional flags to the end of the command
7 changes: 1 addition & 6 deletions server/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,9 @@ STATS_DIRECTORIES = [
].collect { |name, dir| [ name, "#{dir}" ] }.select { |name, dir| File.directory?(dir) }

task :exe, [:ip] do |t, args|
sh "ocra --icon AtomicRTS.ico --output game.exe --chdir-first src/app.rb assets/**/* maps/* -- -p1 #{args[:ip]} "
sh "ocran --icon AtomicRTS.ico --output game.exe --chdir-first src/app.rb assets/**/* maps/* -- -p1 #{args[:ip]} "
end

task :installer, [:ip] do |t, args|
sh "ocra --icon AtomicRTS.ico --output game.exe --innosetup inno.iss --chdir-first --no-lzma src/app.rb assets/**/* maps/* -- -p1 #{args[:ip]} "
end


task :stats do
CodeStatistics.new(*STATS_DIRECTORIES).to_s
end
Expand Down