Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from dankmeme01/0.3.0
Browse files Browse the repository at this point in the history
0.3.0
  • Loading branch information
dankmeme01 authored Sep 27, 2023
2 parents c8ef7a2 + 583be4b commit 27d0337
Show file tree
Hide file tree
Showing 74 changed files with 817 additions and 365 deletions.
19 changes: 3 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 3.5.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(GEODE_CLI /home/dankpc/.pathext/geode)
set(GEODE_TARGET_PLATFORM Win32)
set(CMAKE_HOST_SYSTEM WIN32)

project(globed VERSION 0.1.0)
project(globed VERSION 0.3.0)

file(GLOB_RECURSE SOURCES
src/*.cpp
Expand All @@ -20,9 +17,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
endif()

# add_compile_definitions(_HAS_ITERATOR_DEBUGGING=0)


# Set up the mod binary
add_library(${PROJECT_NAME} SHARED ${SOURCES})

Expand All @@ -34,14 +28,7 @@ endif()

add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

target_include_directories(${PROJECT_NAME} PRIVATE src/)

# Set up dependencies, resources, link Geode
setup_geode_mod(${PROJECT_NAME})

# find_package(Boost REQUIRED)

# if(Boost_FOUND)
# include_directories(${Boost_INCLUDE_DIRS})
# endif()

# link boost
# target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ The JSON file passed in `GLOBED_SERVER_FILE_PATH` should have a format like this
Here is a list of known issues or something I cannot test:

* unable to compile with MSVC, only can compile with clang on Linux. This should be resolved when a Geode update removes winsock.h from includes.
* no idea if it compiles/works on Mac, but I tried to avoid platform-specific code.

Planned features:

* Level ending animation
* Finish making the spectating menu (god i hate UI)

## Special thanks

Expand Down
2 changes: 0 additions & 2 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Globed is an open-source, highly customizable multiplayer mod for Geometry Dash.

It is very much in beta, and you may experience some issues, especially if you live far from the server location. For optimal experience, make sure to update the mod whenever available, so you get all the latest bugfixes.

For best possible experience, use a framerate that is a multiple of 30, be it 60, 120, 240 or 360. Otherwise you may experience some jitter.

## Usage

In the main menu you should see an extra button at the bottom. It will open the Globed Menu, where you can see a list of servers that you can join.
Expand Down
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v0.3.0

* Made it so that you can see other players move while paused (thanks mat for helping to figure it out)
* Changed the player progress indicator to a much prettier one
* Mac support (largely untested, thanks a lot to Firee for helping with it)
* Added glow for player icons
* Changed interpolation (again?) to make other players move smoother (maybe?)
* Fixed some other bugs

Due to protocol changes, this is a required update. Without it you won't be able to connect to official servers.

# v0.2.1

* Made the server levels list much faster and more efficient (thanks to Cvolton and Alphalaneous)
Expand Down
26 changes: 15 additions & 11 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"geode": "1.3.0",
"version": "0.2.1",
"version": "0.3.0",
"id": "dankmeme.globed",
"name": "Globed",
"developer": "dankmeme",
"description": "Multiplayer for Geometry Dash",
"repository": "https://github.com/dankmeme01/globed",
"resources": {
"sprites": [
"resources/menuicon.png"
]
"spritesheets": {
"globedsheet1": [
"resources/menuicon.png",
"resources/spectate.png",
"resources/spectate-stop.png"
]
}
},
"settings": {
"overlay-pos": {
Expand Down Expand Up @@ -99,21 +103,21 @@
"name": "Player progress",
"type": "bool",
"default": true,
"description": "If a player is <cr>off-screen</c>, show how far they are in the level at the edge of your screen."
"description": "Shows an icon of a player below your <cj>progress bar</c>, indicating how far the player is into the level.s"
},
"show-progress-moving": {
"name": "Progress moving",
"old-progress": {
"name": "Old progress",
"type": "bool",
"default": true,
"description": "If <cy>Player progress</c> is <cg>enabled</c>, this will control whether the <cy>progress indicator</c> will move up and down depending on player's <cg>progress in the level</c>. Not recommended to disable due to <cr>overlapping</c> if there are more than 2 players."
"default": false,
"description": "Instead of showing an <cj>icon</c> below the <cy>progress bar</c>, show text with arrows at the <cy>edge of your screen</c> indicating where the player is."
},
"show-progress-opacity": {
"name": "Progress opacity",
"name": "Old progress opacity",
"type": "int",
"default": 255,
"min": 0,
"max": 255,
"description": "If <cy>Player progress</c> is <cg>enabled</c>, this defines the <cg>opacity</c> of the <cy>progress indicator</c>. 0 is <cj>invisible</c> and 255 is <cj>fully opaque</c>"
"description": "If <cy>Old progress</c> is <cg>enabled</c>, this defines the <cg>opacity</c> of the <cy>progress indicator</c>. 0 is <cj>invisible</c> and 255 is <cj>fully opaque</c>"
},
"default-mini-icon": {
"name": "Default mini icon",
Expand Down
Binary file removed resources/icon.xcf
Binary file not shown.
Binary file added resources/spectate-stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/spectate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion server/central/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use util::Logger;
mod util;
mod web;

pub const PROTOCOL_VERSION: &str = "5";
pub const PROTOCOL_VERSION: &str = "6";
static LOGGER: Logger = Logger;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion server/game/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "globed-game-server"
version = "0.3.0"
version = "0.3.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 4 additions & 0 deletions server/game/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ Removes the user from the level they were playing on.

Reads the `PlayerData` structure (described [later](#playerdata)) and stores it in the level.

### SpectateNoData

No data, but the server still returns `LevelData`. Used for spectating.

## Other things

### Secret key
Expand Down
14 changes: 9 additions & 5 deletions server/game/src/data/player_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ pub struct PlayerAccountData {
pub spider: i32,
pub color1: i32,
pub color2: i32,
pub glow: bool,
pub name: String,
}

Expand All @@ -141,6 +142,7 @@ impl PlayerAccountData {
buf.write_i32(self.spider);
buf.write_i32(self.color1);
buf.write_i32(self.color2);
buf.write_u8(if self.glow { 1u8 } else { 0u8 });
buf.write_string(&self.name);
}

Expand All @@ -154,6 +156,7 @@ impl PlayerAccountData {
let spider = buf.read_i32()?;
let color1 = buf.read_i32()?;
let color2 = buf.read_i32()?;
let glow = buf.read_u8()? == 1u8;
let name = buf.read_string()?;

Ok(PlayerAccountData {
Expand All @@ -166,6 +169,7 @@ impl PlayerAccountData {
spider,
color1,
color2,
glow,
name,
})
}
Expand All @@ -179,17 +183,17 @@ impl PlayerAccountData {
&& self.name.is_ascii()
&& self.cube >= 0
&& self.cube <= 148
&& self.ship >= 0
&& self.ship >= 1
&& self.ship <= 51
&& self.ball >= 0
&& self.ball <= 43
&& self.ufo >= 0
&& self.ufo >= 1
&& self.ufo <= 35
&& self.wave >= 0
&& self.wave >= 1
&& self.wave <= 35
&& self.robot >= 0
&& self.robot >= 1
&& self.robot <= 26
&& self.spider >= 0
&& self.spider >= 1
&& self.spider <= 17
}
}
25 changes: 15 additions & 10 deletions server/game/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum PacketType {
UserLevelEntry = 110,
UserLevelExit = 111,
UserLevelData = 112,
SpectateNoData = 113,

/* server */
CheckedIn = 200,
Expand Down Expand Up @@ -397,10 +398,9 @@ impl State {
self.remove_client_from_level(client_id, level_id).await;
}

PacketType::UserLevelData => {
PacketType::UserLevelData | PacketType::SpectateNoData => {
self.verify_secret_key_or_disconnect(client_id, secret_key, peer)
.await?;
let data = PlayerData::decode(&mut bytebuffer)?;

let clients = self.connected_clients.read().await;
let level_id = clients
Expand All @@ -414,14 +414,19 @@ impl State {

drop(clients);

if level_id != -1 {
let levels = self.levels.read().await;
let mut level = levels
.get(&level_id)
.ok_or(anyhow!("this should never happen, {}:{}", file!(), line!()))?
.write()
.await;
level.insert(client_id, data);
// for specating dont try to decode data
if ptype == PacketType::UserLevelData {
let data = PlayerData::decode(&mut bytebuffer)?;

if level_id != -1 {
let levels = self.levels.read().await;
let mut level = levels
.get(&level_id)
.ok_or(anyhow!("this should never happen, {}:{}", file!(), line!()))?
.write()
.await;
level.insert(client_id, data);
}
}

if !self.tick_based {
Expand Down
Loading

0 comments on commit 27d0337

Please sign in to comment.