刃直海角骨入
) that look different depending on the language of the content being Japanese, Simplified Chinese, Traditional Chinese and Hangul, because Unicode uses the same codepoint for characters regardless of the language.
This is how it looks with DDNet client currently on all languages:
2023-07-17 18:05:35 I assert: /home/deen/isos/ddnet/ddnet-source/src/engine/client/graphics_threaded.cpp(895): Texture handle was not invalid, but also did not correlate to an existing texture.
Crash Log:
``` -------------------
Error occurred on Monday, July 17, 2023 at 18:05:53.
DDNet.exe caused an Illegal Instruction at locatio...2023-07-17 18:04:47 I libpng: warning for file "skins/glow_preamy.png": iCCP: known incorrect sRGB profile
m_RenderInfo
in the client array in gameclient ever gets clearedauth_*
commands)let mut lock = ctx.modules.write().await.unwrap().database.write().await;
This looks horrendousmodules
easilyCComponent
it has hooks that the main will call into as needed#[async_trait::async_trait]
pub trait Module {
async fn init(&self, ctx: Arc<BotContext>);
async fn register_commands(&self);
async fn handle_interaction(&self, interaction: &Interaction);
async fn handle_message(&self, message: &Message);
}
(edited)&self
&mut self
Pin<&mut self>
Pin<&self>
modules: ModuleConfig
, and ModuleConfig
is just a struct of the configs from each module#[derive(Deserialize, Debug)]
pub struct Config2 {
pub modules: toml::Table,
}
#[derive(Deserialize, Debug)]
pub struct RyoModule {
pub hello: String,
}
pub fn parse_config2(path: &Path) -> anyhow::Result<Config2> {
let mut file = File::open(path)?;
let mut file_contents = String::new();
file.read_to_string(&mut file_contents)?;
Ok(toml::from_str(&file_contents)?)
}
pub fn parse_config_from_module(config: &toml::Table) -> anyhow::Result<RyoModule> {
Ok(RyoModule::deserialize(config["ryo"].clone())?)
}
(edited)T
.#[derive(Debug, PartialEq)]
pub struct Foo {
name: String,
list: Vec<u8>,
}
let foo = {
let mut uninit: MaybeUninit<Foo> = MaybeUninit::uninit();
let ptr = uninit.as_mut_ptr();
// Initializing the `name` field
// Using `write` instead of assignment via `=` to not call `drop` on the
// old, uninitialized value.
unsafe { addr_of_mut!((*ptr).name).write("Bob".to_string()); }
// Initializing the `list` field
// If there is a panic here, then the `String` in the `name` field leaks.
unsafe { addr_of_mut!((*ptr).list).write(vec![0, 1, 2]); }
// All the fields are initialized, so we call `assume_init` to get an initialized Foo.
unsafe { uninit.assume_init() }
};
&toml::Value
can't be deserialized from? I can clone just fine, just interested why it can't borrowDeserialize
I wonder what that implementsDeserialize
I wonder what that implements .clone()
there and it kinda works you haven't understood shit&toml::Value
, I should be able to deserialize out of this, no? It gives access to all the data needed to deserialize&toml::Value
, I should be able to deserialize out of this, no? It gives access to all the data needed to deserialize /// Interpret a `toml::Value` as an instance of type `T`.
///
/// This conversion can fail if the structure of the `Value` does not match the
/// structure expected by `T`, for example if `T` is a struct type but the
/// `Value` contains something other than a TOML table. It can also fail if the
/// structure is correct but `T`'s implementation of `Deserialize` decides that
/// something is wrong with the data, for example required struct fields are
/// missing from the TOML map or some number is too big to fit in the expected
/// primitive type.
pub fn try_into<'de, T>(self) -> Result<T, crate::de::Error>
where
T: de::Deserialize<'de>,
{
d
4ae0928b47c91a84dff6168f7b5119d70537d0d4 is the first bad commit
commit 4ae0928b47c91a84dff6168f7b5119d70537d0d4
Author: Robert Müller
Date: Mon Apr 24 23:21:44 2023 +0200
Support bezier envelope curves in maps and editor
Port map and editor support for
CURVETYPE_BEZIER` from upstream, i.e. support bezier curves with configurable in- and out-tangents for every envelope point.
The in- and out-tangents are represented by triangles and can be dragged in the envel...