better lighting
This commit is contained in:
parent
805a2713a3
commit
6ed4e17065
75 changed files with 6417 additions and 3667 deletions
|
|
@ -2,8 +2,8 @@ extern crate alloc;
|
|||
|
||||
use alloc::vec;
|
||||
use alloc::vec::Vec;
|
||||
use crate::protocol::*;
|
||||
use crate::protocol::pxl8_msg_type::*;
|
||||
use crate::pxl8::*;
|
||||
use crate::pxl8::pxl8_msg_type::*;
|
||||
use crate::voxel::VoxelChunk;
|
||||
|
||||
pub const DEFAULT_PORT: u16 = 7777;
|
||||
|
|
@ -374,6 +374,24 @@ impl Transport {
|
|||
sys::sendto(self.socket, &self.send_buf[..offset], &self.client_addr);
|
||||
}
|
||||
|
||||
pub fn send_chunk_exit(&mut self, sequence: u32) {
|
||||
if !self.has_client {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut offset = 0;
|
||||
|
||||
let msg_header = pxl8_msg_header {
|
||||
sequence,
|
||||
size: 0,
|
||||
type_: PXL8_MSG_CHUNK_EXIT as u8,
|
||||
version: PXL8_PROTOCOL_VERSION as u8,
|
||||
};
|
||||
offset += self.serialize_header(&msg_header, offset);
|
||||
|
||||
sys::sendto(self.socket, &self.send_buf[..offset], &self.client_addr);
|
||||
}
|
||||
|
||||
fn serialize_chunk_msg_header(&mut self, msg: &ChunkMessage, offset: usize) -> usize {
|
||||
let buf = &mut self.send_buf[offset..];
|
||||
buf[0] = msg.chunk_type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue