Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated link #223

Merged
merged 5 commits into from
Jan 4, 2025
Merged

Updated link #223

merged 5 commits into from
Jan 4, 2025

Conversation

tristanpoland
Copy link
Member

Plugin Enhancements:

  • Added new dependencies: serde_json, rust_socketio, and lazy_static in Cargo.toml to support JSON serialization, socket communication, and static initialization, respectively.
  • Refactored the Listner struct to include a servers field for managing socket connections and implemented a new constructor to initialize connections based on link_config.json.
  • Updated the on method in the Listner struct to forward events to all connected servers, ensuring data synchronization across the network.

Server Module Updates:

  • Integrated the Listner struct into the server module by importing it and initializing it when a new player is added. This allows the server to manage player connections and forward events. [1] [2]
  • Modified the HorizonThread initialization to include loading the link_plugin, ensuring the plugin is ready to handle events and connections.

Configuration Changes:

  • Added link_config.json to store server addresses, which are read during the initialization of the Listner struct to establish connections.

@tristanpoland tristanpoland linked an issue Jan 4, 2025 that may be closed by this pull request
@@ -0,0 +1,5 @@
[
"http://localhost:3000",

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
@@ -0,0 +1,5 @@
[
"http://localhost:3000",
"http://otherserver:3000",

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
[
"http://localhost:3000",
"http://otherserver:3000",
"http://anotherserver:3000"

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
@@ -150,6 +154,10 @@

async fn add_player(&self, player: Player) -> Result<()> {
let mut players = self.players.lock().await;

// TODO Add player to struct. Eventually we will make the server connections global for lower resource usage

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@tristanpoland tristanpoland marked this pull request as ready for review January 4, 2025 04:46
@tristanpoland tristanpoland requested a review from Caznix January 4, 2025 04:46
Copy link
Collaborator

@Caznix Caznix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@Caznix Caznix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Copy link
Collaborator

@Caznix Caznix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

press the approve button apparently

@Caznix Caznix merged commit 2722deb into main Jan 4, 2025
3 checks passed
@tristanpoland tristanpoland deleted the 173-peer-to-peer-community-edition-networking branch January 22, 2025 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Peer-To-Peer community edition networking
2 participants