-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't change Universe Attributes #1
Comments
Perhaps I stumbled upon something not implemented fully yet. xD
|
While, yes, the Universe server is unfinished, and I don't have much time to dedicate to this project at the moment, this is a feature I'd expect to work. Keep in mind that AW 4.1 is the primary target, and maybe check the logs for your database to see if the Universe is issuing queries it doesn't like? With regard to 5.2, I don't know if it would work with that or not. I have never used that version. |
Thanks for the reply! I'll continue to tinker with it and see if I can't get it to work (thanks for the DB tip). As for 5.2 I am not sure either, a future prospect perhaps. |
Just a heads up, I turned on MySQL logging and I did not see any queries whatsoever towards the server when applying universe settings. I see these two messages when logging into the universe, though I think it's unrelated to the attribs:
As a workaround I manually inserted the values into the database, the values are being read correctly. |
For what it's worth, the code path that should handle this is as follows: in PacketType::AttributeChange => packet_handler::attribute_change(
client,
packet,
&self.database,
&self.client_manager,
), in for var in packet.get_vars().iter() {
if let AWPacketVar::String(id, val) = var {
log::info!("Client {} setting {:?} to {:?}", client.addr.ip(), id, val);
set_attribute(*id, val, database).ok();
}
} in database.attrib_set(id, value).map_err(|_| ())?; and fn attrib_set(&self, attribute_id: Attribute, value: &str) -> Result<(), ReasonCode> {
let mut conn = self.conn().map_err(|_| ReasonCode::DatabaseError)?;
// Check if attribute is already in the database
let rows: Vec<Row> = conn
.exec(
r"SELECT * FROM awu_attrib WHERE ID=:id",
params! {
"id" => attribute_id as u32,
},
)
.map_err(|_| ReasonCode::DatabaseError)?;
if rows.is_empty() {
// Add the attribute if it is not already existent
conn.exec_drop(
r"INSERT INTO awu_attrib (ID, Value) VALUES(:id, :value);",
params! {
"value" => value,
"id" => attribute_id as u32,
},
)
.map_err(|_| ReasonCode::DatabaseError)?;
log::debug!("Set attribute {attribute_id:?} to {value}");
} else {
// Try to update the attribute if it is already present
conn.exec_drop(
r"UPDATE awu_attrib SET Value=:value, Changed=NOT Changed WHERE ID=:id;",
params! {
"value" => value,
"id" => attribute_id as u32,
},
)
.map_err(|_| ReasonCode::DatabaseError)?;
log::debug!("Updated attribute {attribute_id:?} to {value}");
}
Ok(())
} I notice that |
This is caused by a bug in the ActiveWorlds client that makes it send the server a malformed packet. The AW protocol has a concept of data types, such as integer, float and string. One of these data types is simply a raw buffer of data, i.e., a byte array. Core ActiveWorlds code forgets to set the data type field if the buffer is empty or greater than 4095 bytes. The resulting malformed packet was rejected by my server as a result. This event occurs, at least, when the object password for CAVs/PAVs is empty. 25d373f stops this from failing. While I haven't fully tested attributes yet, this catastrophic failure should be fixed. |
Hi @coremaze I am @phillipwgardner, I lost access to my account unfortunately. Thanks for the response on that, I will report back on the catastrophic failure I believe it was indeed fixed as last I checked. |
This is indeed fixed. You should be able to resolve this issue. 👍 |
Hi there @ChrisMiuchiz, thanks for this project!
I've got things running so far, but have run into a small problem. It seems so far I have been unable to figure out how to set properly my start world, welcome message and to allow tourist entry. When I try to apply these attributes in the browser they don't take.
Also out of curiosity, would this work with the 5.2 browser or later? I've tried with 5.2 but have been unsuccessful thus far.
Thanks so much! Everything else seems to be working.
@KimRosebush
The text was updated successfully, but these errors were encountered: