about summary refs log tree commit diff
path: root/README.md
blob: 558db4fafa59fdbb0601461d7732d0b74b1fa04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# r2wars

## nix

So I use nix for all kinds of things nowadays and so here as well.
You don't have to if you don't want to and that's ok.

There's a nix package here:
https://git.emile.space/hefe/tree/nix/pkgs/r2wars-web/default.nix

And a nix module using that package here:
https://git.emile.space/hefe/tree/nix/modules/r2wars-web/default.nix

And the configuration I'm currently running on https://r2wa.rs using the module which uses the package here:
https://git.emile.space/hefe/tree/nix/hosts/corrino/www/r2wa.rs.nix

If you want to clone from git.emile.space, you can currently do so like this:

```
git clone git://git.emile.space/r2wars-web.git
git clone git://git.emile.space/hefe.git
```

## Usage

```
; CGO_ENABLED=0 SESSION_KEY=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa go run ./src --help
Usage of /var/folders/bt/2db5y4ds5yq2y9m29tt8g5dm0000gn/T/go-build1055665732/b001/exe/src:
  -databasepath string
    	The path to the main database (default "./main.db")
  -h string
    	The host to listen on (shorthand) (default "127.0.0.1")
  -host string
    	The host to listen on (default "127.0.0.1")
  -logfilepath string
    	The path to the log file (default "./server.log")
  -p int
    	The port to listen on (shorthand) (default 8080)
  -port int
    	The port to listen on (default 8080)
  -sessiondbpath string
    	The path to the session database (default "./sesions.db")
  -templates string
    	The path to the templates used (default "./templates")
```

## Architecture

There are essentially the following objects which are all linked to each other (using a table joining their ids):

- User
  - You, the player
- Bots
  - The bots to be run within a battle
- Battles
  - An arena in which bots can be placed and run. Constraints on what bots can be added are defined here
- Architectures
  - The archs supported by r2 in order to be used by bots and battles
- Bits
  - The bits (8, 16, 32, 64) supported by r2 in order to be used by bots and battles

## TODO

- [ ] Add user creating battle as default owner
- [ ] Allow adding other users as owners to battles
- [x] Implement submitting bots
- [x] Implement running the battle
- [x] Add a "start battle now" button
- [ ] Add a "battle starts at this time" field into the battle
- [ ] Figure out how time is stored and restored with the db
- [x] Do some magic to display the current fight backlog with all info
- [ ] After having added a bot to a battle with the right arch, the arch can be changed
      When updating the bot, make sure that it is still valid in all currently linked battles