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

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

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
/target
.env
tmp/
servers/
+1
View File
@@ -3,3 +3,4 @@ mod socket;
pub use socket::process_rpc_socket;
pub mod actions;
pub mod rpc_client;
+17
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
}
}
}
+4 -1
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
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