~starkingdoms/starkingdoms

e3a9258548855d894f06af02f69f56b1dd3c0f02 — ghostlyzsh 1 year, 10 months ago c76b5b6 + 716942f
Merge branch 'bevy_rewrite' of https://gitlab.com/starkingdoms.tk/starkingdoms.tk into bevy_rewrite
7 files changed, 24 insertions(+), 26 deletions(-)

M Cargo.lock
M Cargo.toml
D bevy_tungstenite_stk/Cargo.toml
M server/Cargo.toml
M server/src/main.rs
M server/src/packet.rs
R {bevy_tungstenite_stk/src/lib => server/src/ws}.rs
M Cargo.lock => Cargo.lock +2 -10
@@ 1058,15 1058,6 @@ dependencies = [
]

[[package]]
name = "bevy_tungstenite_stk"
version = "0.1.0"
dependencies = [
 "bevy",
 "crossbeam-channel",
 "tungstenite",
]

[[package]]
name = "bevy_utils"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 3589,7 3580,7 @@ version = "0.1.0-alpha1"
dependencies = [
 "bevy",
 "bevy_rapier2d",
 "bevy_tungstenite_stk",
 "crossbeam-channel",
 "hex",
 "hmac",
 "jwt",


@@ 3600,6 3591,7 @@ dependencies = [
 "starkingdoms-common",
 "tikv-jemallocator",
 "tracing-subscriber",
 "tungstenite",
]

[[package]]

M Cargo.toml => Cargo.toml +1 -2
@@ 3,8 3,7 @@ members = [
    "server",
    "starkingdoms-backplane",
    "starkingdoms-common",
    "savefile_decoder",
    "bevy_tungstenite_stk"
    "savefile_decoder"
]
resolver = "2"


D bevy_tungstenite_stk/Cargo.toml => bevy_tungstenite_stk/Cargo.toml +0 -11
@@ 1,11 0,0 @@
[package]
name = "bevy_tungstenite_stk"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = { version = "0.12", default-features = false }
crossbeam-channel = "0.5"
tungstenite = "0.21"
\ No newline at end of file

M server/Cargo.toml => server/Cargo.toml +2 -1
@@ 16,8 16,9 @@ jwt = "0.16"
sha2 = "0.10"
hmac = "0.12"
hex = "0.4"
bevy_tungstenite_stk = { version = "0.1", path = "../bevy_tungstenite_stk" }
tikv-jemallocator = "0.5.0"
crossbeam-channel = "0.5"
tungstenite = "0.21"

[features]
default = []

M server/src/main.rs => server/src/main.rs +2 -1
@@ 22,6 22,7 @@ static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
use std::net::IpAddr;

use crate::mathutil::rot2d;
use crate::ws::{StkTungsteniteServerConfig, StkTungsteniteServerPlugin, WsEvent};
use bevy::math::{vec2, vec3};
use bevy::{
    app::{PluginGroupBuilder, ScheduleRunnerPlugin},


@@ 30,7 31,6 @@ use bevy::{
    time::TimePlugin,
};
use bevy_rapier2d::prelude::*;
use bevy_tungstenite_stk::{StkTungsteniteServerConfig, StkTungsteniteServerPlugin, WsEvent};
use component::Input;
use component::*;
use hmac::{Hmac, Mac};


@@ 49,6 49,7 @@ pub mod component;
pub mod macros;
pub mod mathutil;
pub mod packet;
pub mod ws;

const CLIENT_SCALE: f32 = 50.0;


M server/src/packet.rs => server/src/packet.rs +1 -1
@@ 15,8 15,8 @@ use std::fmt::{Display, Formatter};
//     You should have received a copy of the GNU Affero General Public License
//     along with this program.  If not, see <https://www.gnu.org/licenses/>.
use crate::component::{PartType, PlanetType};
use bevy_tungstenite_stk::tungstenite::Message;
use serde::{Deserialize, Serialize};
use tungstenite::Message;

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct ProtoTransform {

R bevy_tungstenite_stk/src/lib.rs => server/src/ws.rs +16 -0
@@ 1,3 1,19 @@
// StarKingdoms.IO, a browser game about drifting through space
//     Copyright (C) 2024 ghostly_zsh, TerraMaster85, core
//
//     This program is free software: you can redistribute it and/or modify
//     it under the terms of the GNU Affero General Public License as published by
//     the Free Software Foundation, either version 3 of the License, or
//     (at your option) any later version.
//
//     This program is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU Affero General Public License for more details.
//
//     You should have received a copy of the GNU Affero General Public License
//     along with this program.  If not, see <https://www.gnu.org/licenses/>.

use bevy::app::{App, Plugin, PostUpdate, Startup};
use bevy::ecs::event::ManualEventReader;
use bevy::log::{error, warn};