Skip to content

Commit d04ed2b

Browse files
committed
v1.0.23
1 parent db4d9ce commit d04ed2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+782
-646
lines changed

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rebels"
3-
version = "1.0.22"
3+
version = "1.0.23"
44
edition = "2021"
55
authors = ["Alessandro Ricottone <[email protected]>"]
66
license = "GPL-3.0-or-later"
@@ -65,13 +65,13 @@ serde = { version = "1.0.215", features = ["derive", "default"] }
6565
serde_json = "1.0.133"
6666
serde_repr = "0.1.19"
6767
sha2 = "0.10.8"
68-
stream-download = { version = "0.12.0", features = ["reqwest-rustls"] }
68+
stream-download = { version = "0.13.1", features = ["reqwest-rustls"] }
6969
strum = { version = "0.26.3", features = ["derive"] }
7070
strum_macros = "0.26.4"
7171
tokio = { version = "1.41.1", features = ["full"] }
7272
tokio-util = "0.7.12"
7373
tui-textarea = "0.7.0"
7474
unicode-width = "0.2.0"
75-
url = "2.5.3"
75+
url = "2.5.4"
7676
uuid = { version = "1.11.0", features = ["v4", "serde"] }
7777
void = "1.0.2"

README.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ https://github.com/user-attachments/assets/aaa02f04-06db-4da5-8fa4-732b60083e66
55

66

77
It's the year 2101. Corporations have taken over the world.
8-
The only way to be free is to join a pirate crew and start plundering the galaxy. The only mean of survival is to play basketball.
8+
The only way to be free is to join a pirate crew and start plundering the galaxy. The only means of survival is to play basketball.
99

1010
Now it's your turn to go out there and make a name for yourself. Create your crew and start wandering the galaxy in search of worthy basketball opponents.
1111

1212
The game is under heavy development and breaking changes are often introduced. If you can't continue an old game because the save file is invalid, you probably need to start a new one or open an issue to check if the save file can be migrated.
1313

14+
[![Trailer on youtube](https://youtu.be/5Lu9MSgmTBc/0.jpg)](https://youtu.be/5Lu9MSgmTBc)
15+
1416
## Just try it out!
1517

1618
Connect via SSH to try the game.
@@ -23,7 +25,13 @@ Save files are deleted after 2 days of inactivity.
2325

2426
### Build
2527

26-
You need to have the rust toolchain installed --> https://www.rust-lang.org/tools/install. Then you can clone the repo and build the game with
28+
There are some dependencies to build:
29+
30+
- Linux: install `libasound2-dev` and `cmake` (for instance, on Ubuntu they can be installed with `sudo apt-get install -y libasound2-dev cmake`);
31+
- MacOs: install `cmake` (for instance, using [brew](https://formulae.brew.sh/formula/cmake));
32+
- Windows: install [cmake](https://cmake.org/download/).
33+
34+
You need to have the [rust toolchain](https://www.rust-lang.org/tools/install). Then you can clone the repo and build the game with
2735

2836
`cargo build --release`
2937

@@ -61,9 +69,9 @@ This game runs as a terminal application, meaning that you just need to run the
6169

6270
Suggested minimal terminal size: 160x48. Not all terminals support the game colors nicely, so you might need to try different ones. Here is a list of tested terminals:
6371

64-
- Linux: whatever the default terminal is, it should work
65-
- MacOs: [iTerm2](https://iterm2.com/), [tabby](https://tabby.sh/), [WezTerm](https://wezfurlong.org/wezterm/index.html)
66-
- Windows: [tabby](https://tabby.sh/)
72+
- Linux: whatever the default terminal is, it should work;
73+
- MacOs: [iTerm2](https://iterm2.com/), [tabby](https://tabby.sh/), [WezTerm](https://wezfurlong.org/wezterm/index.html);
74+
- Windows: [tabby](https://tabby.sh/).
6775

6876
**Important**: currently local bot teams are generated by default to make the game more enjoyable. This behaviour can be disabled by passing the `-f` flag to the executable. In the future, when more players will be available, the game will default to online teams only.
6977

@@ -85,6 +93,18 @@ Join the [discord](https://discord.gg/ebjp33UrrV)! There is no fixed roadmap for
8593

8694
It is almost guaranteed that you will encounter bugs along your journey. If you do, please open an issue and describe what happened. If you are a developer and want to contribute, feel free to open a pull request.
8795

96+
## Running a relayer node
97+
98+
Running a relayer node helps keep the game decentralized. You can do so by running `rebels -n`. Other players can connect with your relayer at startup using `rebels -i <RELAYER-NODE-IP4-OR-IP6>`. If you do so, please consider opening a PR to add your address to the following list of known relayers.
99+
100+
### Additional relayer nodes
101+
102+
- `85.214.130.204`
103+
104+
## Running a SSH server
105+
106+
You can also run a SSH server with `rebels -j`. Other players can connect with your server using `ssh <USERNAME>@<SERVER-IP4-OR-IP6> -p 3788`.
107+
88108
## License
89109

90110
This software is released under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html) license.

src/app.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,12 @@ impl App {
392392
text: format!("Failed to send own team to peers: {}", e),
393393
});
394394
}
395-
} else {
396-
if let Err(e) = network_handler.dial_seed() {
397-
self.ui.swarm_panel.push_log_event(SwarmPanelEvent {
398-
timestamp: Tick::now(),
399-
peer_id: None,
400-
text: format!("Failed to dial seed: {}", e),
401-
});
402-
}
395+
} else if let Err(e) = network_handler.dial_seed() {
396+
self.ui.swarm_panel.push_log_event(SwarmPanelEvent {
397+
timestamp: Tick::now(),
398+
peer_id: None,
399+
text: format!("Failed to dial seed: {}", e),
400+
});
403401
}
404402
}
405403
}

src/crossterm_event_handler.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ impl CrosstermEventHandler {
5252
CrosstermEvent::Resize(w, h) => {
5353
sender.send(TerminalEvent::Resize(w, h)).await
5454
}
55-
_ => unimplemented!(),
55+
_ => {
56+
log::info!("Crossterm event not implemented");
57+
Ok(())
58+
}
5659
}
5760
.expect("failed to send terminal event")
5861
}

src/game_engine/isolation.rs

-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ impl EngineAction for Isolation {
119119
iso.info.shortened_name(),
120120
defender.info.shortened_name()
121121
),
122-
123122
format!(
124123
"{} cuts through {} and the help defense.",
125124
iso.info.shortened_name(),
@@ -184,7 +183,6 @@ impl EngineAction for Isolation {
184183
iso.info.shortened_name(),
185184
defender.info.shortened_name()
186185
),
187-
188186
].choose(rng).expect("There should be one option").clone(),
189187
start_at: input.end_at,
190188
end_at: input.end_at.plus(timer_increase),

src/game_engine/off_the_screen.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ impl EngineAction for OffTheScreen {
147147
),
148148
format!(
149149
"{} tries to use the screen to get open for the shot, but {} is right there, forcing a bad attempt.",
150-
playmaker.info.shortened_name(), target.info.shortened_name(),
151-
),
150+
playmaker.info.shortened_name(), target.info.shortened_name(),
151+
),
152152
format!(
153153
"{} receives the pass from {} but can't escape {}'s tight defense, resulting in a rushed shot.",
154154
playmaker.info.shortened_name(), target.info.shortened_name(), target_defender.info.shortened_name()
155155
),
156156
format!(
157157
"{} gets the pass after the screen, but {} doesn't give an inch, and the shot is off balance.",
158-
playmaker.info.shortened_name(), target.info.shortened_name(),
158+
playmaker.info.shortened_name(), target.info.shortened_name(),
159159
),
160160
].choose(rng).expect("There should be one option").clone(),
161161
assist_from: Some(play_idx),

src/game_engine/pick_and_roll.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ impl EngineAction for PickAndRoll {
130130
..Default::default()
131131
},
132132
x if x > ADV_DEFENSE_LIMIT => {
133-
134133
match rng.gen_bool(0.5) {
135134
false => ActionOutput {
136135
possession: input.possession,
@@ -189,8 +188,6 @@ impl EngineAction for PickAndRoll {
189188
..Default::default()
190189
}
191190
}
192-
193-
194191
},
195192
_ => {
196193
playmaker_update.turnovers = 1;
@@ -281,7 +278,7 @@ impl EngineAction for PickAndRoll {
281278
possession: input.possession,
282279
advantage: Advantage::Neutral,
283280
attackers: vec![target_idx],
284-
defenders: vec![play_idx],
281+
defenders: vec![play_idx],
285282
situation: ActionSituation::CloseShot,
286283
description:[
287284
format!(
@@ -316,7 +313,7 @@ impl EngineAction for PickAndRoll {
316313
possession: input.possession,
317314
advantage: Advantage::Defense,
318315
attackers: vec![target_idx],
319-
defenders: vec![target_idx],
316+
defenders: vec![target_idx],
320317
situation: ActionSituation::MediumShot,
321318
description:[
322319
format!(
@@ -325,7 +322,7 @@ impl EngineAction for PickAndRoll {
325322
),
326323
format!(
327324
"The pick'n'roll is executed, but {} is quick to cover as {} passes to {}.",
328-
target_defender.info.shortened_name(), playmaker.info.shortened_name(), target.info.shortened_name(),
325+
target_defender.info.shortened_name(), playmaker.info.shortened_name(), target.info.shortened_name(),
329326
),
330327
format!(
331328
"They try the pick'n'roll. {} passes to {} but {} sticks to {} like glue.",

src/game_engine/post.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl EngineAction for Post {
6767
defender.info.shortened_name()
6868
),
6969
format!(
70-
"{} beats {} with a slick move and makes a strong move to the basket.",
70+
"{} beats {} with a slick step and makes a strong move to the basket.",
7171
poster.info.shortened_name(),
7272
defender.info.shortened_name()
7373
),

src/image/player.rs

+20-10
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ impl PlayerImage {
154154
} else if info.population == Population::Octopulp {
155155
match rng.gen_range(0..=1) {
156156
0 => Some(BeardImage::Octobeard1),
157-
_ => Some(BeardImage::Octobeard2),
157+
1 => Some(BeardImage::Octobeard2),
158+
_ => unreachable!(),
158159
}
159160
} else {
160161
match rng.gen_range(1..=6) {
@@ -299,7 +300,8 @@ impl PlayerImage {
299300
pub fn set_wooden_leg(&mut self, rng: &mut ChaCha8Rng) {
300301
self.wooden_leg = match rng.gen_range(0..=1) {
301302
0 => Some(WoodenLegImage::Left),
302-
_ => Some(WoodenLegImage::Right),
303+
1 => Some(WoodenLegImage::Right),
304+
_ => unreachable!(),
303305
};
304306
}
305307

@@ -308,28 +310,34 @@ impl PlayerImage {
308310
Population::Galdari => match rng.gen_range(0..=2) {
309311
0 => Some(EyePatchImage::LeftLow),
310312
1 => Some(EyePatchImage::RightLow),
311-
_ => Some(EyePatchImage::Central),
313+
2 => Some(EyePatchImage::Central),
314+
_ => unreachable!(),
312315
},
313316
Population::Polpett | Population::Yardalaim => match rng.gen_range(0..=1) {
314317
0 => Some(EyePatchImage::LeftLow),
315-
_ => Some(EyePatchImage::RightLow),
318+
1 => Some(EyePatchImage::RightLow),
319+
_ => unreachable!(),
316320
},
317321
Population::Octopulp => {
318322
if self.head == HeadImage::Octopulp1 {
319323
Some(EyePatchImage::OctopulpCentral)
320324
} else if self.head == HeadImage::Octopulp2 {
321325
match rng.gen_range(0..=1) {
322326
0 => Some(EyePatchImage::LeftLow),
323-
_ => Some(EyePatchImage::RightLow),
327+
1 => Some(EyePatchImage::RightLow),
328+
_ => unreachable!(),
324329
}
325330
} else {
326331
unreachable!()
327332
}
328333
}
329334
Population::Pupparoll => Some(EyePatchImage::Pupparoll),
330-
_ => match rng.gen_range(0..=1) {
331-
0 => Some(EyePatchImage::LeftLow),
332-
_ => Some(EyePatchImage::RightLow),
335+
_ => match rng.gen_range(0..=3) {
336+
0 => Some(EyePatchImage::LeftHigh),
337+
1 => Some(EyePatchImage::LeftLow),
338+
2 => Some(EyePatchImage::RightHigh),
339+
3 => Some(EyePatchImage::RightLow),
340+
_ => unreachable!(),
333341
},
334342
};
335343
}
@@ -338,12 +346,14 @@ impl PlayerImage {
338346
self.hook = if population == Population::Pupparoll {
339347
match rng.gen_range(0..=1) {
340348
0 => Some(HookImage::LeftPupparoll),
341-
_ => Some(HookImage::RightPupparoll),
349+
1 => Some(HookImage::RightPupparoll),
350+
_ => unreachable!(),
342351
}
343352
} else {
344353
match rng.gen_range(0..=1) {
345354
0 => Some(HookImage::Left),
346-
_ => Some(HookImage::Right),
355+
1 => Some(HookImage::Right),
356+
_ => unreachable!(),
347357
}
348358
};
349359
}

src/network/handler.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,18 @@ impl NetworkHandler {
102102
];
103103

104104
if let Some(ip) = seed_ip {
105-
seed_addresses.push(
106-
format!("/ip4/{ip}/tcp/{DEFAULT_SEED_PORT}")
107-
.parse()
108-
.expect("Invalid provided seed ip."),
109-
);
105+
if let Ok(address) = format!("/ip4/{ip}/tcp/{DEFAULT_SEED_PORT}").parse() {
106+
seed_addresses.push(address);
107+
} else if let Ok(address) = format!("/ip6/{ip}/tcp/{DEFAULT_SEED_PORT}").parse() {
108+
seed_addresses.push(address);
109+
}
110110
}
111111

112-
info!("Network handler started on port {}", tcp_port);
112+
info!(
113+
"Network handler started on port {} with {} seed addresses.",
114+
tcp_port,
115+
seed_addresses.len()
116+
);
113117

114118
Ok(Self {
115119
swarm,

src/network/network_callback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl NetworkCallback {
210210
seed_info: SeedInfo,
211211
) -> AppCallback {
212212
Box::new(move |app: &mut App| {
213-
log::info!("Got seed info: {:#?}", seed_info);
213+
log::info!("Got seed info");
214214
let event = SwarmPanelEvent {
215215
timestamp,
216216
peer_id,

src/space_adventure/asteroid.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use super::collisions::HitBox;
12
use super::networking::ImageType;
23
use super::space_callback::SpaceCallback;
34
use super::visual_effects::VisualEffect;

src/space_adventure/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{networking::ImageType, space_callback::SpaceCallback, traits::*};
1+
use super::{collisions::HitBox, networking::ImageType, space_callback::SpaceCallback, traits::*};
22
use crate::register_impl;
33
use glam::{I16Vec2, Vec2};
44
use image::{Rgba, RgbaImage};

0 commit comments

Comments
 (0)