Skip to content

Commit

Permalink
social initial
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Oct 4, 2024
1 parent 5a8a4d4 commit 59194f9
Show file tree
Hide file tree
Showing 16 changed files with 1,308 additions and 86 deletions.
22 changes: 20 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,25 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'social'",
"cargo": {
"args": [
"build",
"--bin=social",
"--package=social"
],
"filter": {
"name": "social",
"kind": "bin"
}
},
"args": ["step-4"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
Expand Down Expand Up @@ -42,4 +60,4 @@
"cwd": "${workspaceFolder}"
}
]
}
}
11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ nft = { path="crates/nft" }
tween = { path="crates/tween" }
world_ui = { path="crates/world_ui" }
collectibles = { path="crates/collectibles" }
social = { path="crates/social" }

bevy = { version = "0.14", default-features = false, features=[
"animation",
Expand Down Expand Up @@ -107,7 +108,11 @@ bevy_simple_text_input = { git = "https://github.com/robtfm/bevy_simple_text_inp
directories = "5"
uuid = { version = "1.7", features = ["v4"] }
build-time = "0.1.3"
async-tungstenite = { version = "0.22.0", features = ["async-std-runtime", "async-tls"] }
dcl-rpc = { version = "2.3.5", default-features = false, features=["client", "websockets", "codegen", "server", "tungstenite"] }
async-trait = "0.1.68"
fastrand = "2"
futures-util = "0.3.28"

[dependencies]
analytics = { workspace = true }
Expand All @@ -131,6 +136,7 @@ tween = { workspace = true }
scene_material = { workspace = true }
world_ui = { workspace = true }
collectibles = { workspace = true }
social = { workspace = true }

bevy = { workspace = true }
bevy_console = { workspace = true }
Expand All @@ -139,18 +145,19 @@ serde = { workspace = true }
serde_json = { workspace = true }
clap = { workspace = true }
uuid = { workspace = true }
build-time = { workspace = true }

pico-args = "0.5.0"
mimalloc = { version = "*", default-features = false }
build-time = { workspace = true }
chrono = { workspace = true }
tracing-appender = "0.2.3"
log-panics = { version = "2.1.0", features = ["with-backtrace"] }

# break_test dependencies
# non-main dependencies
futures-lite = { workspace = true }
dcl_component = { workspace = true }
tokio = { workspace = true }
bevy_simple_text_input = { workspace = true }

[build-dependencies]
prost-build = "0.11.8"
Expand Down
2 changes: 1 addition & 1 deletion assets/ui/chat.dui
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
color="#aa1fc166"
>
<div>
<tab-group style="justify-content: flex-start; width: 100%; flex-wrap: wrap;" tabs="@chat-tabs" onchanged="@tab-changed" initial="@initial-tab" edge-scale="1px 1px -0px 1px"/>
<tab-group id="tabs" style="justify-content: flex-start; width: 100%; flex-wrap: wrap;" tabs="@chat-tabs" onchanged="@tab-changed" initial="@initial-tab" edge-scale="1px 1px -0px 1px"/>
<div>
<button img="images/copy.png" onclick="@copy" image-width="4.4vmin" image-height="4.4vmin" />
<button img="images/redx.png" onclick="@close" image-width="4.4vmin" image-height="4.4vmin" />
Expand Down
10 changes: 6 additions & 4 deletions assets/ui/update.dui
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<define-template id="update-available">
<dialog title="Update Available" buttons="@buttons">
<div style="flex-direction: column; align-items: center; justify-content: center; margin: 4vmin;">
<div style="flex-direction: column;">
<med-text text="@body" />
</div>
<div style="flex-direction: column; align-items: center; justify-content: center; margin: 4vmin; min-height: 0px;">
<vscroll>
<div style="flex-direction: column;">
<med-text text="@body" />
</div>
</vscroll>
<hr />
<div>
<med-link label="Download" color="#8888ff" href="@download" />
Expand Down
6 changes: 3 additions & 3 deletions crates/comms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ prost = { workspace = true }
async-std = { workspace = true }
bevy_kira_audio = { workspace = true }
kira = { workspace = true }
async-trait = { workspace = true }
async-tungstenite = { workspace = true }
futures-util = { workspace = true }

async-trait = "0.1.68"
async-tungstenite = { version = "0.22.0", features = ["async-std-runtime", "async-tls"] }
async-tls = "0.12.0"
futures-util = "0.3.28"
livekit = { git = "https://github.com/robtfm/client-sdk-rust", branch="0.6-h264-false-2", features=["rustls-tls-webpki-roots"], optional = true }
rand = "0.8.5"
multihash-codetable = { version = "0.1.1", features = ["digest", "sha2"] }
Expand Down
5 changes: 4 additions & 1 deletion crates/dcl_component/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ edition = "2021"
bevy = { workspace = true }
prost = { workspace = true }
serde = { workspace = true }
dcl-rpc = { workspace = true }
async-trait = { workspace = true }

[build-dependencies]
prost-build = "0.11.8"
prost-build = "0.11.8"
dcl-rpc = { workspace = true }
20 changes: 19 additions & 1 deletion crates/dcl_component/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::io::Result;
fn main() -> Result<()> {
fn gen_sdk_components() -> Result<()> {
let components = [
"engine_info",
"billboard",
Expand Down Expand Up @@ -57,6 +57,7 @@ fn main() -> Result<()> {
sources.push("src/proto/decentraland/kernel/comms/rfc5/ws_comms.proto".into());
sources.push("src/proto/decentraland/kernel/comms/rfc4/comms.proto".into());
sources.push("src/proto/decentraland/kernel/comms/v3/archipelago.proto".into());
sources.push("src/proto/decentraland/social/friendships/friendships.proto".into());

let serde_components = ["Color3"];

Expand All @@ -73,3 +74,20 @@ fn main() -> Result<()> {

Ok(())
}

fn gen_social_service() -> Result<()> {
let mut conf = prost_build::Config::new();
conf.service_generator(Box::new(dcl_rpc::codegen::RPCServiceGenerator::new()));
conf.type_attribute("*", "#[derive(Debug)]");
conf.compile_protos(
&["src/proto/decentraland/social/friendships/friendships.proto"],
&["src/proto"],
)?;
Ok(())
}

fn main() -> Result<()> {
gen_sdk_components()?;
gen_social_service()?;
Ok(())
}
7 changes: 7 additions & 0 deletions crates/dcl_component/src/proto_components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ pub mod common {
include!(concat!(env!("OUT_DIR"), "/decentraland.common.rs"));
}

pub mod social {
include!(concat!(
env!("OUT_DIR"),
"/decentraland.social.friendships.rs"
));
}

trait DclProtoComponent: prost::Message + Default {}

impl<T: DclProtoComponent + Sync + Send + 'static> FromDclReader for T {
Expand Down
42 changes: 42 additions & 0 deletions crates/social/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[package]
name = "social"
version = "0.1.0"
edition = "2021"

[lib]

[dependencies]
common = { workspace = true }
comms = { workspace = true }
dcl = { workspace = true }
dcl_component = { workspace = true }
ipfs = { workspace = true }
wallet = { workspace = true }

bevy = { workspace = true }
bevy_egui = { workspace = true }
bevy_dui = { workspace = true }
bevy_console = { workspace = true }
urn = { workspace = true }
ethers-core = { workspace = true }
ethers-signers = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
isahc = { workspace = true }
tokio = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
opener = { workspace = true }
urlencoding = { workspace = true }
build-time = { workspace = true }

futures-lite = { workspace = true }

async-tungstenite = { workspace = true }

prost = { workspace = true }
dcl-rpc = { workspace = true }
futures-util = { workspace = true }

matrix-sdk = { version = "0.7.1", default-features = false, features = ["e2e-encryption", "rustls-tls"] }
Loading

0 comments on commit 59194f9

Please sign in to comment.