Files
benilla-octo/crates/benilla-protocol/src/world/writer/gameobject.rs
T
SamandClaude Opus 5.5 972cfc06e8 comments: protocol, the world session, reader, wire helpers and the first writer sends
1,071 comment lines become 370 across 23 files; the code is unchanged.
The Warden refusal and the billing-time default now carry their reasons.
A gap note on cyclic splines described the app, not this crate, and is
gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 20:12:21 +07:00

31 lines
1.0 KiB
Rust

//! The GameObject sends; one `CMSG_GAMEOBJ_USE` serves every kind, dispatched by type.
use anyhow::Result;
use crate::messages::{self, opcode};
use super::WorldWriter;
impl WorldWriter {
/// Use a world GameObject; the server answers by type or refuses silently, with no ack.
pub fn gameobj_use(&mut self, guid: u64) -> Result<()> {
self.send(opcode::CMSG_GAMEOBJ_USE, &messages::gameobj_use(guid))
}
/// Ask a GameObject template; `entry` is the guid's bits 24-47 ([`crate::guid::entry`]).
pub fn gameobject_query(&mut self, entry: u32, guid: u64) -> Result<()> {
self.send(
opcode::CMSG_GAMEOBJECT_QUERY,
&messages::gameobject_query(entry, guid),
)
}
/// Ask a book page; the server resolves it by id alone and answers each page of the chain.
pub fn page_text_query(&mut self, page_id: u32, guid: u64) -> Result<()> {
self.send(
opcode::CMSG_PAGE_TEXT_QUERY,
&messages::page_text_query(page_id, guid),
)
}
}