Skip to content

Commit

Permalink
Merge pull request #63 from PocketRelay/dev
Browse files Browse the repository at this point in the history
Combining branches
  • Loading branch information
jacobtread committed Dec 6, 2023
2 parents 8d62bdc + 3269a18 commit b076afc
Show file tree
Hide file tree
Showing 50 changed files with 2,823 additions and 1,624 deletions.
782 changes: 440 additions & 342 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pocket-relay"
version = "0.5.10"
version = "0.6.0-beta"
description = "Pocket Relay Server"
readme = "README.md"
keywords = ["EA", "PocketRelay", "MassEffect"]
Expand Down Expand Up @@ -32,7 +32,7 @@ argon2 = { version = "0.5", features = ["std"] }

base64ct = { version = "1.5", features = ["alloc"] }
flate2 = { version = "1", features = ["zlib"], default-features = false }
ring = "0.16"
ring = "0.17"

# Library for obtaining the local IP address of the device
local-ip-address = "0.5"
Expand All @@ -46,16 +46,16 @@ email_address = "0.2.4"
# Codec utils for encoding and decoding packets
tokio-util = { version = "0.7", features = ["codec"] }

# Hyper for connection upgrades
# Hyper for connection upgrades (TODO: Update to 1.0 once reqwest supports it)
hyper = "0.14.25"
tower = "0.4"

bitflags = { version = "2.3.1", features = ["serde"] }
tdf = { version = "0.1" }
bytes = "1.4.0"
futures = "0.3"

indoc = "2"
parking_lot = "0.12.1"

# SeaORM
[dependencies.sea-orm]
Expand Down Expand Up @@ -87,7 +87,7 @@ features = [
"sync",
]

# Axum web framework
# Axum web framework (TODO: Update to 0.7 once once reqwest supports hyper 1.0)
[dependencies.axum]
version = "0.6.1"
default-features = false
Expand All @@ -111,6 +111,10 @@ version = "0.4"
default-features = false
features = ["std", "serde"]

[dev-dependencies]
# Random numbers for seeding
rand = "0.8"

[profile.release]
strip = true
lto = true
Expand Down
53 changes: 22 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Pocket Relay

<img src="https://raw.githubusercontent.com/PocketRelay/.github/main/assets/logo-new-text.svg" width="100%" height="120px">

# Pocket Relay

*Mass Effect 3 Server Emulator / Private Server*


![License](https://img.shields.io/github/license/PocketRelay/Server?style=for-the-badge)
![Build](https://img.shields.io/github/actions/workflow/status/PocketRelay/Server/rust.yml?style=for-the-badge)

[Discord Server (discord.gg/yvycWW8RgR)](https://discord.gg/yvycWW8RgR)
[Website (pocket-relay.pages.dev)](https://pocket-relay.pages.dev/)

Development is undergone on the [dev](https://github.com/PocketRelay/Server/tree/dev) branch so the master branch can be
considered semi stable with only non breaking changes being merged in-between releases
[Discord Server (discord.gg/yvycWW8RgR)](https://discord.gg/yvycWW8RgR) | [Website (pocket-relay.pages.dev)](https://pocket-relay.pages.dev/)


The master branch contains the latest changes and may not be stable for general use, if you would like to compile a stable version from source its recommened you use a specific tag rather than master

**Pocket Relay** Is a custom implementation of the Mass Effect 3 multiplayer servers all bundled into a easy to use server with a Dashboard for managing accounts and inventories.

With **Pocket Relay** you can play Mass Effect 3 multiplayer offline by yourself, over LAN, or even over WAN as a public server
With **Pocket Relay**, you can play Mass Effect 3 multiplayer offline, over LAN, or even over WAN as a public server.

View the website for information https://pocket-relay.pages.dev/
Visit the [website](https://pocket-relay.pages.dev/) for more information.


## 📌 EA / BioWare Notice
## 🌐 EA / BioWare Notice

The **Pocket Relay** software in all its forms are in no way or form supported, endorsed, or provided by BioWare or Electronic Arts. Mass Effect is a registered trademark of Bioware/EA International (Studio and Publishing), Ltd in the U.S. and/or other countries. All Mass Effect art, images, and lore are the sole property of Bioware/EA International (Studio and Publishing), Ltd and have been reproduced here in an effort to assist the Mass Effect player community. All other trademarks are the property of their respective owners.
The **Pocket Relay** software, in all its forms, is not supported, endorsed, or provided by BioWare or Electronic Arts. Mass Effect is a registered trademark of Bioware/EA International (Studio and Publishing), Ltd in the U.S. and/or other countries. All Mass Effect art, images, and lore are the sole property of Bioware/EA International (Studio and Publishing), Ltd and are reproduced here to assist the Mass Effect player community. All other trademarks are the property of their respective owners.


## 📖 Starting your own server
Expand All @@ -35,8 +35,8 @@ the [Server Setup Guide](https://pocket-relay.pages.dev/guide/server/)

Below is a table of the download links for the different platforms

| Platform | Download |
| -------- | ------------------------------------------------------------------------------------------------------- |
| Platform | Download |
| -------- | --------------------------------------------------------------------------------------------------- |
| Windows | [Download](https://github.com/PocketRelay/Server/releases/latest/download/pocket-relay-windows.exe) |
| Linux | [Download](https://github.com/PocketRelay/Server/releases/latest/download/pocket-relay-linux) |

Expand All @@ -45,33 +45,24 @@ You can find individual releases on the [Releases](https://github.com/PocketRela

## 🔧 Configuration

In order to configure the server such as changing the ports you can see the
configuration documentation [Here (docs/CONFIG.md)](https://pocket-relay.pages.dev/guide/config/)

To configure the server, such as changing ports, refer to the [Configuration Documentation](https://pocket-relay.pages.dev/guide/config/).

## ⚙️ Features

- **Origin Support** This server supports **Origin** / **EA Launcher** copies of the game through its fetching system. As long as the official servers are still available and you have internet access the server will connect to the official servers to authorize **Origin** accounts. *This behavior can be disabled using the `PR_ORIGIN_FETCH` environment variable*
- **Origin Fetching** Along with supporting **Origin** authentication your player data from the official servers can also be loaded for those logging into **Origin** accounts. *This behavior can be disabled using the `PR_ORIGIN_FETCH_DATA` environment variable*
- **Portable & Platform Independent** This server can be run on most hardware and software due to its low requirements and custom
implementations of lots of required portions allowing you to run it
on Windows, Linux, etc. *Note the server will store the player data and logging in a folder named `data` in the same folder as the exe*
- **Cracked Support** This server supports cracked Mass Effect 3 copies so you can play on the server using them.
- **Docker Support** This server includes a `Dockerfile` so that it can be run in a containerized environment. The server uses a small alpine linux container to run inside
- **Dashboard** The server includes a management dashboard
- This includes leaderboards displays
- Allowing players to edit their username, email, and password
- Deleting and managing accounts
- Viewing running games
- Inventory editing for admins (Weapons, Classes, Characters, etc)
- View server logs as super admin
- **Origin Support:** Connects to official servers to authorize **Origin**/**EA Launcher** accounts (configurable).
- **Origin Fetching:** Loads player data from official servers for **Origin** accounts (configurable).
- **Portable & Platform Independent:** Low hardware requirements, platform-independent (data stored in a 'data' folder).
- **Unofficial Support:** Allows playing with unofficially licensed Mass Effect 3 copies.
- **Docker Support:** Includes a `Dockerfile` for containerized deployment in a small Alpine Linux container.
- **Dashboard:** Management dashboard with leaderboards, account management, game monitoring, and more.


## 🚀 Manual Building

Instructions for building the server can be found at https://pocket-relay.pages.dev/docs/server/manual-building
Build instructions can be found [here](https://pocket-relay.pages.dev/docs/server/manual-building).

> **Note**
> Building the server can be quite a heavy load on your computer
> Building the server can be resource-intensive.

## 🧾 License
Expand Down
4 changes: 4 additions & 0 deletions examples/nginx-client-auth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data
server.crt
server.key
client.crt
4 changes: 4 additions & 0 deletions examples/nginx-client-auth/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"port": 80,
"reverse_proxy": true
}
23 changes: 23 additions & 0 deletions examples/nginx-client-auth/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3"
services:
server:
restart: unless-stopped
container_name: pocket-relay
image: jacobtread/pocket-relay:latest
volumes:
# Bind the server config to a local config.json file
- ./config.json:/app/config.json
# Binding the server data to a local data folder
- ./data:/app/data
nginx:
restart: unless-stopped
image: nginx
ports:
- "443:443/tcp"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./client.crt:/etc/nginx/client.crt:ro
- ./server.crt:/etc/nginx/server.crt:ro
- ./server.key:/etc/nginx/server.key:ro
depends_on:
- server
28 changes: 28 additions & 0 deletions examples/nginx-client-auth/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
events {}

http {
server {
listen 443 ssl;

server_name localhost;

ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server.key;

ssl_client_certificate /etc/nginx/client.crt;
ssl_verify_client on;


location / {
proxy_pass http://server:80;

# Provide server with real IP address of clients
proxy_set_header X-Real-IP $remote_addr;

# Upgrade websocket connections
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
}
}
}
16 changes: 15 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use log::LevelFilter;
use serde::Deserialize;
use std::{env, fs::read_to_string, path::Path};
use std::{
env,
fs::read_to_string,
net::{IpAddr, Ipv4Addr},
path::Path,
};

use crate::session::models::Port;

Expand Down Expand Up @@ -60,6 +65,7 @@ pub fn load_config() -> Option<Config> {
#[derive(Deserialize)]
#[serde(default)]
pub struct Config {
pub host: IpAddr,
pub port: Port,
pub qos: QosServerConfig,
pub reverse_proxy: bool,
Expand All @@ -73,6 +79,7 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
Self {
host: IpAddr::V4(Ipv4Addr::UNSPECIFIED),
port: 80,
qos: QosServerConfig::default(),
reverse_proxy: false,
Expand All @@ -95,6 +102,13 @@ pub enum QosServerConfig {
Local,
/// Use a custom QoS server
Custom { host: String, port: u16 },
/// Disable the QoS server (Public IP *wont* be resolved)
Disabled,
/// Configuration to use when using hamachi
Hamachi {
/// The address of the host computer (Required for 127.0.0.1 resolution)
host: Ipv4Addr,
},
}

#[derive(Deserialize)]
Expand Down

0 comments on commit b076afc

Please sign in to comment.