tests for minecraft-server container, save rpc before changing control method

This commit is contained in:
2026-06-03 14:44:20 +02:00
parent dea2bd0af7
commit 3ce0f800a0
5 changed files with 32 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target
.env
tmp/
servers/

View File

@ -3,3 +3,4 @@ mod socket;
pub use socket::process_rpc_socket;
pub mod actions;
pub mod rpc_client;

17
src/rpc/rpc_client.rs Normal file
View File

@ -0,0 +1,17 @@
pub struct RpcClient{
pub read_buffer: Vec<u8>,
pub buffer: Vec<u8>,
pub close: bool
}
impl RpcClient {
pub fn new() -> Self {
Self {
read_buffer: vec![0; 1024],
buffer: vec![0; 10240],
close: true
}
}
}

View File

@ -3,6 +3,8 @@ use tokio::net::TcpStream;
use crate::DbPool;
use crate::rpc::rpc_client::RpcClient;
/*
* request_format :
@ -19,5 +21,6 @@ use crate::DbPool;
*/
pub async fn process_rpc_socket(_stream: TcpStream, _pool: DbPool) -> io::Result<()> {
panic!("not implemented");
let client = RpcClient::new();
}

9
test.sh Normal file
View File

@ -0,0 +1,9 @@
docker run -v "$(pwd)/servers/potato:/data" \
-e EULA=TRUE \
-u 1000:100 \
--rm \
-e TYPE=VANILLA\
-e VERSION="1.21.6" \
-e DIFFICULTY="2" \
-p 8080:8080 \
-it itzg/minecraft-server:latest