You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently SDK returns nullptr if it fails to create some base object, in some cases not even printing reason of it to console.
Suggestion
Make use of Expected in ICore base objects create methods, so modules implementing alt:V API can provide more info right in code to server developers.
Rust API example (Rust's Result<Ok, Err> is very similar to Expected type in SDK)
let result = altv::VoiceChannel::new(...);match(result){Ok(channel) => {// ...}Err(altv::VoiceChannelCreationError::VoiceChatIsNotEnabled) => {// ...}}
SDK example
auto expected = alt::ICore::Instance().CreateVoiceChannel(...);
if(expected.success) {
// using expected.value
} else {
switch(expected.error) {
case alt::VoiceChannelCreationError::VoiceChatIsNotEnabled:
// ...break;
}
}
The text was updated successfully, but these errors were encountered:
Currently SDK returns
nullptr
if it fails to create some base object, in some cases not even printing reason of it to console.Suggestion
Make use of
Expected
in ICore base objects create methods, so modules implementing alt:V API can provide more info right in code to server developers.Rust API example (Rust's
Result<Ok, Err>
is very similar toExpected
type in SDK)SDK example
The text was updated successfully, but these errors were encountered: