Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
GStudiosX2 committed Jan 2, 2025
2 parents b2b333f + 11d49b3 commit c47dfc2
Show file tree
Hide file tree
Showing 48 changed files with 1,108 additions and 396 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ serde_derive = "1.0.210"
base64 = "0.22.1"
bitcode = "0.6.3"
bitcode_derive = "0.6.3"
bitmask-enum = "2.2.5"
#bitmask-enum = "2.2.5"

# Bit manipulation
byteorder = "1.5.0"
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,11 @@ This project is licensed under the MIT License - see the [LICENSE.md](LICENSE) f
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=ferrumc-rs/ferrumc&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=ferrumc-rs/ferrumc&type=Date" />
</picture>
</a>
</a>
## 📊 Stats
[![Timeline graph](https://images.repography.com/59032276/ferrumc-rs/ferrumc/recent-activity/J6CgGhzs6y3LXRuADz1QpSUriBC3ix9DXnPUbbljruA/O-qGFiSVQmksFEaX7mVQ4jY3lppUTK2xUw4CpqZ3oUk_timeline.svg)](https://github.com/ferrumc-rs/ferrumc/commits)
[![Issue status graph](https://images.repography.com/59032276/ferrumc-rs/ferrumc/recent-activity/J6CgGhzs6y3LXRuADz1QpSUriBC3ix9DXnPUbbljruA/O-qGFiSVQmksFEaX7mVQ4jY3lppUTK2xUw4CpqZ3oUk_issues.svg)](https://github.com/ferrumc-rs/ferrumc/issues)
[![Pull request status graph](https://images.repography.com/59032276/ferrumc-rs/ferrumc/recent-activity/J6CgGhzs6y3LXRuADz1QpSUriBC3ix9DXnPUbbljruA/O-qGFiSVQmksFEaX7mVQ4jY3lppUTK2xUw4CpqZ3oUk_prs.svg)](https://github.com/ferrumc-rs/ferrumc/pulls)
[![Top contributors](https://images.repography.com/59032276/ferrumc-rs/ferrumc/recent-activity/J6CgGhzs6y3LXRuADz1QpSUriBC3ix9DXnPUbbljruA/O-qGFiSVQmksFEaX7mVQ4jY3lppUTK2xUw4CpqZ3oUk_users.svg)](https://github.com/ferrumc-rs/ferrumc/graphs/contributors)
2 changes: 1 addition & 1 deletion src/bin/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ferrumc_core::identity::player_identity::*;
use ferrumc_macros::Event;
use ferrumc_ecs::entities::Entity;
use ferrumc_macros::Event;

/// This event is triggered when the player attempts to log on to the server.
///
Expand Down
32 changes: 18 additions & 14 deletions src/bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
#![forbid(unsafe_code)]
extern crate core;

use crate::cli::{CLIArgs, Command, ImportArgs};
use crate::errors::BinaryError;
use clap::Parser;
use ferrumc_config::statics::get_global_config;
use ferrumc_config::whitelist::create_whitelist;
use ferrumc_core::chunks::chunk_receiver::ChunkReceiver;
use ferrumc_core::identity::player_identity::PlayerIdentity;
use ferrumc_ecs::Universe;
use ferrumc_general_purpose::paths::get_root_path;
use ferrumc_net::packets::outgoing::login_success::LoginSuccessPacket;
use ferrumc_net::server::create_server_listener;
use ferrumc_net::{connection::StreamWriter, NetResult};
use ferrumc_net_codec::encode::NetEncodeOpts;
use ferrumc_state::ServerState;
use ferrumc_world::World;
use std::hash::{Hash, Hasher};
use std::sync::Arc;
use systems::definition;
use tracing::{error, info};
use ferrumc_core::identity::player_identity::PlayerIdentity;
use ferrumc_net::packets::outgoing::login_success::LoginSuccessPacket;
use ferrumc_net::{connection::StreamWriter, NetResult};
use ferrumc_net_codec::encode::NetEncodeOpts;
use crate::cli::{CLIArgs, Command, ImportArgs};
use tracing::{error, info, trace};

pub(crate) mod errors;
mod cli;
pub(crate) mod errors;
mod packet_handlers;
mod systems;

Expand All @@ -34,11 +34,13 @@ mod whitelist;

pub type Result<T> = std::result::Result<T, BinaryError>;

pub async fn send_login_success(state: Arc<ServerState>, conn_id: usize, identity: PlayerIdentity) -> NetResult<()> {
pub async fn send_login_success(
state: Arc<ServerState>,
conn_id: usize,
identity: PlayerIdentity,
) -> NetResult<()> {
//Send a Login Success Response to further the login sequence
let mut writer = state
.universe
.get_mut::<StreamWriter>(conn_id)?;
let mut writer = state.universe.get_mut::<StreamWriter>(conn_id)?;

writer
.send_packet(
Expand All @@ -47,7 +49,8 @@ pub async fn send_login_success(state: Arc<ServerState>, conn_id: usize, identit
)
.await?;

state.universe
state
.universe
.add_component::<PlayerIdentity>(conn_id, identity)?;

Ok(())
Expand All @@ -64,11 +67,11 @@ async fn main() {
let mut hasher = std::collections::hash_map::DefaultHasher::new();
std::any::TypeId::of::<ChunkReceiver>().hash(&mut hasher);
let digest = hasher.finish();
println!("ChunkReceiver: {:X}", digest);
trace!("ChunkReceiver: {:X}", digest);
let mut hasher = std::collections::hash_map::DefaultHasher::new();
std::any::TypeId::of::<StreamWriter>().hash(&mut hasher);
let digest = hasher.finish();
println!("StreamWriter: {:X}", digest);
trace!("StreamWriter: {:X}", digest);
}

match cli_args.command {
Expand Down Expand Up @@ -152,6 +155,7 @@ async fn create_state() -> Result<ServerState> {
world: World::new().await,
})
}

fn check_deadlocks() {
{
use parking_lot::deadlock;
Expand Down
Loading

0 comments on commit c47dfc2

Please sign in to comment.