Skip to content

Commit 721275e

Browse files
author
Andrew Gazelka
committed
update
1 parent c323be3 commit 721275e

19 files changed

Lines changed: 165 additions & 99 deletions

File tree

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ perf.data
3434
.trigger-debug
3535
.trigger
3636
# valence/
37+
38+
proxy.crt
39+
proxy_private_key.pem
40+
root_ca.crt
41+
root_ca.pem
42+
root_ca.srl
43+
server.crt
44+
server_private_key.pem
45+
logs

process-compose.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version: "0.5"
2+
3+
processes:
4+
# Single build process (cargo builds all binaries in parallel)
5+
build:
6+
command: "cargo build --bin hyperion-proxy --bin bedwars --bin rust-mc-bot"
7+
working_dir: "/Users/andrewgazelka/Projects/personal/hyperion"
8+
environment:
9+
- RUST_LOG=debug
10+
log_location: "./logs/build.log"
11+
12+
# Run processes (dependent on build)
13+
hyperion-proxy:
14+
command: "./target/debug/hyperion-proxy --root-ca-cert root_ca.crt --cert proxy.crt --private-key proxy_private_key.pem --server 127.0.0.1:35565 0.0.0.0:25565"
15+
working_dir: "/Users/andrewgazelka/Projects/personal/hyperion"
16+
depends_on:
17+
build:
18+
condition: process_completed_successfully
19+
environment:
20+
- RUST_LOG=debug
21+
- RUST_BACKTRACE=1
22+
log_location: "./logs/hyperion-proxy.log"
23+
restart: "on_failure"
24+
restart_policy:
25+
restart_delay: 5s
26+
max_restarts: 3
27+
28+
bedwars:
29+
command: "./target/debug/bedwars --root-ca-cert root_ca.crt --cert server.crt --private-key server_private_key.pem --ip 0.0.0.0 --port 35565"
30+
working_dir: "/Users/andrewgazelka/Projects/personal/hyperion"
31+
depends_on:
32+
build:
33+
condition: process_completed_successfully
34+
environment:
35+
- RUST_LOG=debug
36+
- RUST_BACKTRACE=1
37+
log_location: "./logs/bedwars.log"
38+
restart: "on_failure"
39+
restart_policy:
40+
restart_delay: 5s
41+
max_restarts: 3
42+
43+
rust-mc-bot:
44+
command: "./target/debug/rust-mc-bot"
45+
working_dir: "/Users/andrewgazelka/Projects/personal/hyperion"
46+
depends_on:
47+
build:
48+
condition: process_completed_successfully
49+
hyperion-proxy:
50+
condition: process_healthy
51+
environment:
52+
- RUST_LOG=debug
53+
- RUST_BACKTRACE=1
54+
- BOT_SERVER=127.0.0.1:25565
55+
- BOT_BOT_COUNT=500
56+
- BOT_THREADS=2
57+
log_location: "./logs/rust-mc-bot.log"
58+
restart: "on_failure"
59+
restart_policy:
60+
restart_delay: 5s
61+
max_restarts: 3
62+
disabled: true # Similar to docker profile, can be enabled when needed
63+
64+
log:
65+
fields:
66+
- "time"
67+
- "level"
68+
- "message"

vendor/valence/crates/java_string/src/cesu8.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::borrow::Cow;
22

3-
use crate::validations::{utf8_char_width, CONT_MASK, TAG_CONT};
3+
use crate::validations::{CONT_MASK, TAG_CONT, utf8_char_width};
44
use crate::{JavaStr, JavaString, Utf8Error};
55

66
impl JavaStr {
@@ -28,7 +28,7 @@ impl JavaStr {
2828
/// assert!(result.is_err());
2929
/// ```
3030
#[inline]
31-
pub fn from_modified_utf8(bytes: &[u8]) -> Result<Cow<JavaStr>, Utf8Error> {
31+
pub fn from_modified_utf8(bytes: &[u8]) -> Result<Cow<'_, JavaStr>, Utf8Error> {
3232
match JavaStr::from_full_utf8(bytes) {
3333
Ok(str) => Ok(Cow::Borrowed(str)),
3434
Err(_) => JavaString::from_modified_utf8_internal(bytes).map(Cow::Owned),
@@ -57,7 +57,7 @@ impl JavaStr {
5757
/// ```
5858
#[inline]
5959
#[must_use]
60-
pub fn to_modified_utf8(&self) -> Cow<[u8]> {
60+
pub fn to_modified_utf8(&self) -> Cow<'_, [u8]> {
6161
if is_valid_cesu8(self) {
6262
Cow::Borrowed(self.as_bytes())
6363
} else {

vendor/valence/crates/java_string/src/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl JavaCodePoint {
101101
pub const fn as_u32(self) -> u32 {
102102
unsafe {
103103
// SAFETY: JavaCodePoint has the same repr as a u32
104-
let result = std::mem::transmute(self);
104+
let result = std::mem::transmute::<JavaCodePoint, u32>(self);
105105

106106
if result > 0x10ffff {
107107
// SAFETY: JavaCodePoint can never have a value > 0x10FFFF.

vendor/valence/crates/java_string/src/slice.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ impl JavaStr {
585585
/// assert_eq!(v, [(0, JavaStr::from_str("aba"))]); // only the first `aba`
586586
/// ```
587587
#[inline]
588-
pub fn match_indices<P>(&self, pat: P) -> MatchIndices<P>
588+
pub fn match_indices<P>(&self, pat: P) -> MatchIndices<'_, P>
589589
where
590590
P: JavaStrPattern,
591591
{
@@ -625,7 +625,7 @@ impl JavaStr {
625625
/// );
626626
/// ```
627627
#[inline]
628-
pub fn matches<P>(&self, pat: P) -> Matches<P>
628+
pub fn matches<P>(&self, pat: P) -> Matches<'_, P>
629629
where
630630
P: JavaStrPattern,
631631
{
@@ -777,7 +777,7 @@ impl JavaStr {
777777
/// assert_eq!(v, [(2, JavaStr::from_str("aba"))]); // only the last `aba`
778778
/// ```
779779
#[inline]
780-
pub fn rmatch_indices<P>(&self, pat: P) -> RMatchIndices<P>
780+
pub fn rmatch_indices<P>(&self, pat: P) -> RMatchIndices<'_, P>
781781
where
782782
P: JavaStrPattern,
783783
{
@@ -815,7 +815,7 @@ impl JavaStr {
815815
/// );
816816
/// ```
817817
#[inline]
818-
pub fn rmatches<P>(&self, pat: P) -> RMatches<P>
818+
pub fn rmatches<P>(&self, pat: P) -> RMatches<'_, P>
819819
where
820820
P: JavaStrPattern,
821821
{
@@ -871,7 +871,7 @@ impl JavaStr {
871871
/// );
872872
/// ```
873873
#[inline]
874-
pub fn rsplit<P>(&self, pat: P) -> RSplit<P>
874+
pub fn rsplit<P>(&self, pat: P) -> RSplit<'_, P>
875875
where
876876
P: JavaStrPattern,
877877
{
@@ -940,7 +940,7 @@ impl JavaStr {
940940
/// );
941941
/// ```
942942
#[inline]
943-
pub fn rsplit_terminator<P>(&self, pat: P) -> RSplitTerminator<P>
943+
pub fn rsplit_terminator<P>(&self, pat: P) -> RSplitTerminator<'_, P>
944944
where
945945
P: JavaStrPattern,
946946
{
@@ -987,7 +987,7 @@ impl JavaStr {
987987
/// );
988988
/// ```
989989
#[inline]
990-
pub fn rsplitn<P>(&self, n: usize, pat: P) -> RSplitN<P>
990+
pub fn rsplitn<P>(&self, n: usize, pat: P) -> RSplitN<'_, P>
991991
where
992992
P: JavaStrPattern,
993993
{
@@ -1065,7 +1065,7 @@ impl JavaStr {
10651065
/// );
10661066
/// ```
10671067
#[inline]
1068-
pub fn split<P>(&self, pat: P) -> Split<P>
1068+
pub fn split<P>(&self, pat: P) -> Split<'_, P>
10691069
where
10701070
P: JavaStrPattern,
10711071
{
@@ -1193,7 +1193,7 @@ impl JavaStr {
11931193
/// );
11941194
/// ```
11951195
#[inline]
1196-
pub fn split_inclusive<P>(&self, pat: P) -> SplitInclusive<P>
1196+
pub fn split_inclusive<P>(&self, pat: P) -> SplitInclusive<'_, P>
11971197
where
11981198
P: JavaStrPattern,
11991199
{
@@ -1266,7 +1266,7 @@ impl JavaStr {
12661266
/// );
12671267
/// ```
12681268
#[inline]
1269-
pub fn split_terminator<P>(&self, pat: P) -> SplitTerminator<P>
1269+
pub fn split_terminator<P>(&self, pat: P) -> SplitTerminator<'_, P>
12701270
where
12711271
P: JavaStrPattern,
12721272
{
@@ -1318,7 +1318,7 @@ impl JavaStr {
13181318
/// assert_eq!(v, [JavaStr::from_str("")]);
13191319
/// ```
13201320
#[inline]
1321-
pub fn splitn<P>(&self, n: usize, pat: P) -> SplitN<P>
1321+
pub fn splitn<P>(&self, n: usize, pat: P) -> SplitN<'_, P>
13221322
where
13231323
P: JavaStrPattern,
13241324
{

vendor/valence/crates/valence_anvil/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use flate2::bufread::{GzDecoder, ZlibDecoder};
3232
use flate2::write::{GzEncoder, ZlibEncoder};
3333
use lru::LruCache;
3434
use thiserror::Error;
35-
use valence_nbt::binary::{FromModifiedUtf8, ToModifiedUtf8};
3635
use valence_nbt::Compound;
36+
use valence_nbt::binary::{FromModifiedUtf8, ToModifiedUtf8};
3737

3838
#[cfg(feature = "bevy_plugin")]
3939
mod bevy;
@@ -298,8 +298,8 @@ impl RegionFolder {
298298
fn region_chunks(
299299
this: &mut RegionFolder,
300300
pos: Result<(i32, i32), RegionError>,
301-
) -> impl Iterator<Item = Result<(i32, i32), RegionError>> {
302-
let positions = match pos {
301+
) -> Vec<Result<(i32, i32), RegionError>> {
302+
match pos {
303303
Ok((region_x, region_z)) => {
304304
match RegionFolder::region(
305305
&mut this.regions,
@@ -313,8 +313,7 @@ impl RegionFolder {
313313
}
314314
}
315315
Err(err) => vec![Err(err)],
316-
};
317-
positions.into_iter()
316+
}
318317
}
319318

320319
Ok(std::fs::read_dir(&self.region_root)?

vendor/valence/crates/valence_entity/build.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -384,20 +384,23 @@ fn build_entities() -> anyhow::Result<TokenStream> {
384384
}]);
385385

386386
// Get the default values of the attributes.
387-
let mut attribute_default_values = TokenStream::new();
388-
389-
if let Some(attributes) = &entity.attributes {
390-
for attribute in attributes {
391-
let name = ident(attribute.name.to_pascal_case());
392-
let base_value = attribute.base_value;
393-
attribute_default_values.extend([quote! {
394-
.with_attribute_and_value(
395-
super::EntityAttribute::#name,
396-
#base_value,
397-
)
398-
}]);
387+
#[allow(clippy::excessive_nesting)]
388+
let attribute_default_values = {
389+
let mut values = TokenStream::new();
390+
if let Some(attributes) = &entity.attributes {
391+
for attribute in attributes {
392+
let name = ident(attribute.name.to_pascal_case());
393+
let base_value = attribute.base_value;
394+
values.extend([quote! {
395+
.with_attribute_and_value(
396+
super::EntityAttribute::#name,
397+
#base_value,
398+
)
399+
}]);
400+
}
399401
}
400-
}
402+
values
403+
};
401404

402405
bundle_init_fields.extend([quote! {
403406
living_attributes: super::attributes::EntityAttributes::new() #attribute_default_values,

vendor/valence/crates/valence_ident/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ macro_rules! ident {
3434
($string:literal) => {
3535
// SAFETY: parse_ident_str returns a &'static str, which is guaranteed to be
3636
// valid UTF-8
37-
unsafe {
38-
$crate::Ident::new_unchecked($crate::Utf8Bytes::from_static($crate::parse_ident_str!(
39-
$string
40-
)))
41-
}
37+
$crate::Ident::new_unchecked($crate::Utf8Bytes::from_static($crate::parse_ident_str!(
38+
$string
39+
)))
4240
};
4341
}
4442

vendor/valence/crates/valence_nbt/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ format.
99
- `binary`: Adds support for serializing and deserializing in Java edition's binary format.
1010
- `snbt`: Adds support for serializing and deserializing in "stringified" format.
1111
- `preserve_order`: Causes the order of fields in [`Compound`]s to be
12-
preserved during insertion and deletion at a slight cost to performance.
13-
The iterators on `Compound` can then implement [`DoubleEndedIterator`].
12+
preserved during insertion and deletion at a slight cost to performance.
13+
The iterators on `Compound` can then implement [`DoubleEndedIterator`].
1414
- `serde` Adds support for [`serde`](https://docs.rs/serde/latest/serde/)

vendor/valence/crates/valence_nbt/src/compound.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ where
208208
}
209209
}
210210

211-
pub fn entry<K>(&mut self, k: K) -> Entry<S>
211+
pub fn entry<K>(&mut self, k: K) -> Entry<'_, S>
212212
where
213213
K: Into<S>,
214214
{
@@ -232,31 +232,31 @@ where
232232
self.map.is_empty()
233233
}
234234

235-
pub fn iter(&self) -> Iter<S> {
235+
pub fn iter(&self) -> Iter<'_, S> {
236236
Iter {
237237
iter: self.map.iter(),
238238
}
239239
}
240240

241-
pub fn iter_mut(&mut self) -> IterMut<S> {
241+
pub fn iter_mut(&mut self) -> IterMut<'_, S> {
242242
IterMut {
243243
iter: self.map.iter_mut(),
244244
}
245245
}
246246

247-
pub fn keys(&self) -> Keys<S> {
247+
pub fn keys(&self) -> Keys<'_, S> {
248248
Keys {
249249
iter: self.map.keys(),
250250
}
251251
}
252252

253-
pub fn values(&self) -> Values<S> {
253+
pub fn values(&self) -> Values<'_, S> {
254254
Values {
255255
iter: self.map.values(),
256256
}
257257
}
258258

259-
pub fn values_mut(&mut self) -> ValuesMut<S> {
259+
pub fn values_mut(&mut self) -> ValuesMut<'_, S> {
260260
ValuesMut {
261261
iter: self.map.values_mut(),
262262
}

0 commit comments

Comments
 (0)