mirror of
https://github.com/modrinth/code.git
synced 2026-08-28 10:34:53 +00:00
Commonized networking (#3310)
* Fix not being able to connect to local friends socket
* Start basic work on tunneling protocol and move some code into a common crate
* Commonize message serialization logic
* Serialize Base62Ids as u64 when human-readability is not required
* Move ActiveSockets tuple into struct
* Make CI run when rust-common is updated
CI is currently broken for labrinth, however
* Fix theseus-release.yml to reference itself correctly
* Implement Labrinth side of tunneling
* Implement non-friend part of theseus tunneling
* Implement client-side except for socket loop
* Implement the socket loop
Doesn't work though. Debugging time!
* Fix config.rs
* Fix deadlock in labrinth socket handling
* Update dockerfile
* switch to workspace prepare at root level
* Wait for connection before tunneling in playground
* Move rust-common into labrinth
* Remove rust-common references from Actions
* Revert "Update dockerfile"
This reverts commit 3caad59bb4.
* Fix Docker build
* Rebuild Theseus if common code changes
* Allow multiple connections from the same user
* Fix test building
* Move FriendSocketListening and FriendSocketStoppedListening to non-panicking TODO for now
* Make message_serialization macro take varargs for binary messages
* Improve syntax of message_serialization macro
* Remove the ability to connect to a virtual socket, and disable the ability to listen on one
* Allow the app to compile without running labrinth
* Clippy fix
* Update Rust and Clippy fix again
---------
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
@@ -25,7 +25,7 @@ pub fn get_color_from_img(data: &[u8]) -> Result<Option<u32>, ImageError> {
|
||||
)
|
||||
.ok()
|
||||
.and_then(|x| x.first().copied())
|
||||
.map(|x| (x.r as u32) << 16 | (x.g as u32) << 8 | (x.b as u32));
|
||||
.map(|x| ((x.r as u32) << 16) | ((x.g as u32) << 8) | (x.b as u32));
|
||||
|
||||
Ok(color)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::common::ids::base62_impl::to_base62;
|
||||
use crate::database::models::legacy_loader_fields::MinecraftGameVersion;
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::models::ids::base62_impl::to_base62;
|
||||
use crate::models::projects::ProjectId;
|
||||
use crate::routes::ApiError;
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
Reference in New Issue
Block a user