pub struct OverlordState {Show 16 fields
pub character_state: CharacterState,
pub blocked_character_ids: Vec<Uuid>,
pub active_fight: Option<ActiveFight>,
pub pvp_state: Option<PVPState>,
pub connection_store: HashMap<String, i64>,
pub quest_groups: QuestsGroups,
pub incoming_gifts: Vec<Gift>,
pub incoming_mails: Vec<Mail>,
pub patron: Option<Patron>,
pub referral_daily_reward_claimed: Option<bool>,
pub auto_chest: AutoChest,
pub arena: Arena,
pub dungeons: Dungeons,
pub offers_info: OffersInfo,
pub permissions: Vec<UserPermissions>,
pub party: Party,
}Fields§
§character_state: CharacterState§blocked_character_ids: Vec<Uuid>§active_fight: Option<ActiveFight>§pvp_state: Option<PVPState>§connection_store: HashMap<String, i64>§quest_groups: QuestsGroups§incoming_gifts: Vec<Gift>§incoming_mails: Vec<Mail>§patron: Option<Patron>§referral_daily_reward_claimed: Option<bool>§auto_chest: AutoChest§arena: Arena§dungeons: Dungeons§offers_info: OffersInfo§permissions: Vec<UserPermissions>§party: PartyImplementations§
Source§impl OverlordState
impl OverlordState
pub fn claim_vassal_reward( &mut self, vassal_id: Uuid, claim_time: DateTime<Utc>, ) -> Result<()>
pub fn claim_suzerain_reward(&mut self, claim_time: DateTime<Utc>) -> Result<()>
pub fn compute_description_values_for_ability( &self, ability: &Ability, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, config: &GameConfig, ) -> Vec<f64>
pub fn compute_description_values_for_talent( &self, talent_template: &TalentTemplate, level: i64, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, ) -> Vec<f64>
pub fn compute_description_values_template( &self, ability_template: &AbilityTemplate, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, config: &GameConfig, ) -> Vec<f64>
pub fn compute_afk_reward( &self, game_config: &GameConfig, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, ) -> Vec<BundleElement>
pub fn compute_afk_instant_reward( &self, game_config: &GameConfig, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, ) -> Vec<BundleElement>
pub fn compute_bundle_reward( &self, game_config: &GameConfig, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, bundle_id: BundleId, ) -> Vec<BundleElement>
pub fn calculate_item_power( &self, item: Item, game_config: &GameConfig, script_runner: &ScriptRunner<OverlordEvent, OverlordState>, ) -> Result<i64>
pub fn get_active_fight_player(&self) -> Option<&Entity>
pub fn get_active_fight_player_mut(&mut self) -> Option<&mut Entity>
Trait Implementations§
Source§impl AsyncEventHandler<OverlordEvent, OverlordState> for OverlordAsyncEventHandler
impl AsyncEventHandler<OverlordEvent, OverlordState> for OverlordAsyncEventHandler
fn handle_event( &mut self, event: &OverlordEvent, state: OverlordState, rand_gen: StdRng, current_tick: u64, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§fn compute_fields(
&self,
state: &mut OverlordState,
prev_state: &OverlordState,
) -> Vec<OverlordEvent>
fn compute_fields( &self, state: &mut OverlordState, prev_state: &OverlordState, ) -> Vec<OverlordEvent>
Can be used to compute fields that arent stored in database, but computed from stored data.
Also can emit events on some logical data changes. This events eventually can change state.
Source§impl Clone for OverlordState
impl Clone for OverlordState
Source§fn clone(&self) -> OverlordState
fn clone(&self) -> OverlordState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CustomType for OverlordState
impl CustomType for OverlordState
Source§impl Debug for OverlordState
impl Debug for OverlordState
Source§impl Default for OverlordState
impl Default for OverlordState
Source§fn default() -> OverlordState
fn default() -> OverlordState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OverlordState
impl<'de> Deserialize<'de> for OverlordState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<OverlordState> for JsValuewhere
OverlordState: Serialize,
impl From<OverlordState> for JsValuewhere
OverlordState: Serialize,
Source§fn from(value: OverlordState) -> Self
fn from(value: OverlordState) -> Self
Converts to this type from the input type.
Source§impl IntoWasmAbi for OverlordStatewhere
OverlordState: Serialize,
impl IntoWasmAbi for OverlordStatewhere
OverlordState: Serialize,
Source§impl JsonSchema for OverlordState
impl JsonSchema for OverlordState
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl OptionIntoWasmAbi for OverlordStatewhere
OverlordState: Serialize,
impl OptionIntoWasmAbi for OverlordStatewhere
OverlordState: Serialize,
Source§impl PartialEq for OverlordState
impl PartialEq for OverlordState
Source§impl Serialize for OverlordState
impl Serialize for OverlordState
Source§impl State for OverlordState
impl State for OverlordState
Source§fn cmp_db_updated(&self, db_updated: &Self) -> bool
fn cmp_db_updated(&self, db_updated: &Self) -> bool
Compares version from database with local
fn register_rhai_type(engine: &mut Engine)
fn is_ticker_paused(&self) -> bool
Source§impl SyncEventHandler<OverlordEvent, OverlordState> for NoopSyncEventHandler
impl SyncEventHandler<OverlordEvent, OverlordState> for NoopSyncEventHandler
type Context = ()
Source§fn handles_event(&self, _event: &OverlordEvent) -> bool
fn handles_event(&self, _event: &OverlordEvent) -> bool
Returns true if this event should be handled by the sync handler (requires DB context).
async fn create_context_for_batch( &self, _state: &OverlordState, ) -> Result<Self::Context>
async fn handle_event( &self, _context: &Self::Context, _event: &OverlordEvent, _meta: SyncEventMeta, state: OverlordState, ) -> Result<EventHandleResult<OverlordEvent, OverlordState>>
async fn handle_side_effect_event( &self, _context: &Self::Context, _event: &OverlordEvent, _output_events: &[OverlordEvent], _new_state: &OverlordState, ) -> Result<()>
async fn finalize_state( &self, _context: &Self::Context, _state: &mut OverlordState, ) -> Result<()>
Source§async fn persist_in_memory_state(
&self,
_context: &Self::Context,
_state: &OverlordState,
) -> Result<()>
async fn persist_in_memory_state( &self, _context: &Self::Context, _state: &OverlordState, ) -> Result<()>
Persist in-memory state to DB context before commit.
Called by flush_state to save changes accumulated without DB context (e.g. fight ticks).
Source§impl Tsify for OverlordState
impl Tsify for OverlordState
const DECL: &'static str = "export interface OverlordState {\n character_state: CharacterState;\n blocked_character_ids: Uuid[];\n active_fight: ActiveFight | null;\n pvp_state: PVPState | null;\n connection_store: Record<string, number>;\n quest_groups: QuestsGroups;\n incoming_gifts: Gift[];\n incoming_mails: Mail[];\n patron: Patron | null;\n referral_daily_reward_claimed: boolean | null;\n auto_chest: AutoChest;\n arena: Arena;\n dungeons: Dungeons;\n offers_info: OffersInfo;\n permissions: UserPermissions[];\n party: Party;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorIntoWasmAbi for OverlordStatewhere
OverlordState: Serialize,
impl VectorIntoWasmAbi for OverlordStatewhere
OverlordState: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for OverlordState
impl WasmDescribeVector for OverlordState
impl Eq for OverlordState
impl StructuralPartialEq for OverlordState
Auto Trait Implementations§
impl Freeze for OverlordState
impl RefUnwindSafe for OverlordState
impl Send for OverlordState
impl Sync for OverlordState
impl Unpin for OverlordState
impl UnwindSafe for OverlordState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.