Implemented teleports and 3d map

This commit is contained in:
traffic95 2025-05-27 17:04:35 +02:00
parent 1753612e98
commit 0a9582fc29
47 changed files with 2335 additions and 670 deletions

View file

@ -0,0 +1,23 @@
table TeleportConfigTemplate {
teleport_id: int;
unk_1: int;
client_visible: int;
unlock_condition: string;
teleport_name: string;
teleport_icon: string;
unk_2: int;
section_id: int;
transform_id: int;
unk_3: string;
unk_4: [int];
unk_5: [int];
unk_6: [int];
unk_7: int;
unk_8: int;
unk_9: [int];
unk_10: int;
}
table TeleportConfigTemplateTb {
data: [TeleportConfigTemplate];
}

View file

@ -0,0 +1,14 @@
table UrbanAreaMapGroupTemplate {
area_group_id: uint;
unk_1: [bool];
unk_2: int;
unk_3: int;
unk_4: [int];
group_name: string;
unk_6: bool;
is_map_visible: bool;
}
table UrbanAreaMapGroupTemplateTb {
data: [UrbanAreaMapGroupTemplate];
}

View file

@ -0,0 +1,31 @@
table UrbanAreaMapTemplate {
area_id: uint;
unk_1: int;
unk_2: int;
unk_3: int;
unk_4: string;
unk_5: int;
unk_6: bool;
unk_7: int;
unk_8: int;
unk_9: int;
unk_10: int;
unk_11: int;
icon: string;
group_name: string;
unk_14: int;
unk_15: bool;
unk_16: int;
unk_17: int;
unk_18: int;
unk_19: int;
unk_20: int;
unk_21: int;
unk_22: int;
unk_23: int;
unk_24: string;
}
table UrbanAreaMapTemplateTb {
data: [UrbanAreaMapTemplate];
}

View file

@ -0,0 +1,477 @@
// automatically generated by the FlatBuffers compiler, do not modify
// @generated
use core::mem;
use core::cmp::Ordering;
extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};
pub enum TeleportConfigTemplateOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct TeleportConfigTemplate<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for TeleportConfigTemplate<'a> {
type Inner = TeleportConfigTemplate<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> TeleportConfigTemplate<'a> {
pub const VT_TELEPORT_ID: flatbuffers::VOffsetT = 4;
pub const VT_UNK_1: flatbuffers::VOffsetT = 6;
pub const VT_CLIENT_VISIBLE: flatbuffers::VOffsetT = 8;
pub const VT_UNLOCK_CONDITION: flatbuffers::VOffsetT = 10;
pub const VT_TELEPORT_NAME: flatbuffers::VOffsetT = 12;
pub const VT_TELEPORT_ICON: flatbuffers::VOffsetT = 14;
pub const VT_UNK_2: flatbuffers::VOffsetT = 16;
pub const VT_SECTION_ID: flatbuffers::VOffsetT = 18;
pub const VT_TRANSFORM_ID: flatbuffers::VOffsetT = 20;
pub const VT_UNK_3: flatbuffers::VOffsetT = 22;
pub const VT_UNK_4: flatbuffers::VOffsetT = 24;
pub const VT_UNK_5: flatbuffers::VOffsetT = 26;
pub const VT_UNK_6: flatbuffers::VOffsetT = 28;
pub const VT_UNK_7: flatbuffers::VOffsetT = 30;
pub const VT_UNK_8: flatbuffers::VOffsetT = 32;
pub const VT_UNK_9: flatbuffers::VOffsetT = 34;
pub const VT_UNK_10: flatbuffers::VOffsetT = 36;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
TeleportConfigTemplate { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args TeleportConfigTemplateArgs<'args>
) -> flatbuffers::WIPOffset<TeleportConfigTemplate<'bldr>> {
let mut builder = TeleportConfigTemplateBuilder::new(_fbb);
builder.add_unk_10(args.unk_10);
if let Some(x) = args.unk_9 { builder.add_unk_9(x); }
builder.add_unk_8(args.unk_8);
builder.add_unk_7(args.unk_7);
if let Some(x) = args.unk_6 { builder.add_unk_6(x); }
if let Some(x) = args.unk_5 { builder.add_unk_5(x); }
if let Some(x) = args.unk_4 { builder.add_unk_4(x); }
if let Some(x) = args.unk_3 { builder.add_unk_3(x); }
builder.add_transform_id(args.transform_id);
builder.add_section_id(args.section_id);
builder.add_unk_2(args.unk_2);
if let Some(x) = args.teleport_icon { builder.add_teleport_icon(x); }
if let Some(x) = args.teleport_name { builder.add_teleport_name(x); }
if let Some(x) = args.unlock_condition { builder.add_unlock_condition(x); }
builder.add_client_visible(args.client_visible);
builder.add_unk_1(args.unk_1);
builder.add_teleport_id(args.teleport_id);
builder.finish()
}
#[inline]
pub fn teleport_id(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_TELEPORT_ID, Some(0)).unwrap()}
}
#[inline]
pub fn unk_1(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_1, Some(0)).unwrap()}
}
#[inline]
pub fn client_visible(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_CLIENT_VISIBLE, Some(0)).unwrap()}
}
#[inline]
pub fn unlock_condition(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(TeleportConfigTemplate::VT_UNLOCK_CONDITION, None)}
}
#[inline]
pub fn teleport_name(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(TeleportConfigTemplate::VT_TELEPORT_NAME, None)}
}
#[inline]
pub fn teleport_icon(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(TeleportConfigTemplate::VT_TELEPORT_ICON, None)}
}
#[inline]
pub fn unk_2(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_2, Some(0)).unwrap()}
}
#[inline]
pub fn section_id(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_SECTION_ID, Some(0)).unwrap()}
}
#[inline]
pub fn transform_id(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_TRANSFORM_ID, Some(0)).unwrap()}
}
#[inline]
pub fn unk_3(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(TeleportConfigTemplate::VT_UNK_3, None)}
}
#[inline]
pub fn unk_4(&self) -> Option<flatbuffers::Vector<'a, i32>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(TeleportConfigTemplate::VT_UNK_4, None)}
}
#[inline]
pub fn unk_5(&self) -> Option<flatbuffers::Vector<'a, i32>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(TeleportConfigTemplate::VT_UNK_5, None)}
}
#[inline]
pub fn unk_6(&self) -> Option<flatbuffers::Vector<'a, i32>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(TeleportConfigTemplate::VT_UNK_6, None)}
}
#[inline]
pub fn unk_7(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_7, Some(0)).unwrap()}
}
#[inline]
pub fn unk_8(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_8, Some(0)).unwrap()}
}
#[inline]
pub fn unk_9(&self) -> Option<flatbuffers::Vector<'a, i32>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(TeleportConfigTemplate::VT_UNK_9, None)}
}
#[inline]
pub fn unk_10(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_10, Some(0)).unwrap()}
}
}
impl flatbuffers::Verifiable for TeleportConfigTemplate<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<i32>("teleport_id", Self::VT_TELEPORT_ID, false)?
.visit_field::<i32>("unk_1", Self::VT_UNK_1, false)?
.visit_field::<i32>("client_visible", Self::VT_CLIENT_VISIBLE, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("unlock_condition", Self::VT_UNLOCK_CONDITION, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("teleport_name", Self::VT_TELEPORT_NAME, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("teleport_icon", Self::VT_TELEPORT_ICON, false)?
.visit_field::<i32>("unk_2", Self::VT_UNK_2, false)?
.visit_field::<i32>("section_id", Self::VT_SECTION_ID, false)?
.visit_field::<i32>("transform_id", Self::VT_TRANSFORM_ID, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_3", Self::VT_UNK_3, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_4", Self::VT_UNK_4, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_5", Self::VT_UNK_5, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_6", Self::VT_UNK_6, false)?
.visit_field::<i32>("unk_7", Self::VT_UNK_7, false)?
.visit_field::<i32>("unk_8", Self::VT_UNK_8, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_9", Self::VT_UNK_9, false)?
.visit_field::<i32>("unk_10", Self::VT_UNK_10, false)?
.finish();
Ok(())
}
}
pub struct TeleportConfigTemplateArgs<'a> {
pub teleport_id: i32,
pub unk_1: i32,
pub client_visible: i32,
pub unlock_condition: Option<flatbuffers::WIPOffset<&'a str>>,
pub teleport_name: Option<flatbuffers::WIPOffset<&'a str>>,
pub teleport_icon: Option<flatbuffers::WIPOffset<&'a str>>,
pub unk_2: i32,
pub section_id: i32,
pub transform_id: i32,
pub unk_3: Option<flatbuffers::WIPOffset<&'a str>>,
pub unk_4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_5: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_6: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_7: i32,
pub unk_8: i32,
pub unk_9: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub unk_10: i32,
}
impl<'a> Default for TeleportConfigTemplateArgs<'a> {
#[inline]
fn default() -> Self {
TeleportConfigTemplateArgs {
teleport_id: 0,
unk_1: 0,
client_visible: 0,
unlock_condition: None,
teleport_name: None,
teleport_icon: None,
unk_2: 0,
section_id: 0,
transform_id: 0,
unk_3: None,
unk_4: None,
unk_5: None,
unk_6: None,
unk_7: 0,
unk_8: 0,
unk_9: None,
unk_10: 0,
}
}
}
pub struct TeleportConfigTemplateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TeleportConfigTemplateBuilder<'a, 'b, A> {
#[inline]
pub fn add_teleport_id(&mut self, teleport_id: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_TELEPORT_ID, teleport_id, 0);
}
#[inline]
pub fn add_unk_1(&mut self, unk_1: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_1, unk_1, 0);
}
#[inline]
pub fn add_client_visible(&mut self, client_visible: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_CLIENT_VISIBLE, client_visible, 0);
}
#[inline]
pub fn add_unlock_condition(&mut self, unlock_condition: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNLOCK_CONDITION, unlock_condition);
}
#[inline]
pub fn add_teleport_name(&mut self, teleport_name: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_TELEPORT_NAME, teleport_name);
}
#[inline]
pub fn add_teleport_icon(&mut self, teleport_icon: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_TELEPORT_ICON, teleport_icon);
}
#[inline]
pub fn add_unk_2(&mut self, unk_2: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_2, unk_2, 0);
}
#[inline]
pub fn add_section_id(&mut self, section_id: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_SECTION_ID, section_id, 0);
}
#[inline]
pub fn add_transform_id(&mut self, transform_id: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_TRANSFORM_ID, transform_id, 0);
}
#[inline]
pub fn add_unk_3(&mut self, unk_3: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_3, unk_3);
}
#[inline]
pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_4, unk_4);
}
#[inline]
pub fn add_unk_5(&mut self, unk_5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_5, unk_5);
}
#[inline]
pub fn add_unk_6(&mut self, unk_6: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_6, unk_6);
}
#[inline]
pub fn add_unk_7(&mut self, unk_7: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_7, unk_7, 0);
}
#[inline]
pub fn add_unk_8(&mut self, unk_8: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_8, unk_8, 0);
}
#[inline]
pub fn add_unk_9(&mut self, unk_9: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_9, unk_9);
}
#[inline]
pub fn add_unk_10(&mut self, unk_10: i32) {
self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_10, unk_10, 0);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TeleportConfigTemplateBuilder<'a, 'b, A> {
let start = _fbb.start_table();
TeleportConfigTemplateBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<TeleportConfigTemplate<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for TeleportConfigTemplate<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("TeleportConfigTemplate");
ds.field("teleport_id", &self.teleport_id());
ds.field("unk_1", &self.unk_1());
ds.field("client_visible", &self.client_visible());
ds.field("unlock_condition", &self.unlock_condition());
ds.field("teleport_name", &self.teleport_name());
ds.field("teleport_icon", &self.teleport_icon());
ds.field("unk_2", &self.unk_2());
ds.field("section_id", &self.section_id());
ds.field("transform_id", &self.transform_id());
ds.field("unk_3", &self.unk_3());
ds.field("unk_4", &self.unk_4());
ds.field("unk_5", &self.unk_5());
ds.field("unk_6", &self.unk_6());
ds.field("unk_7", &self.unk_7());
ds.field("unk_8", &self.unk_8());
ds.field("unk_9", &self.unk_9());
ds.field("unk_10", &self.unk_10());
ds.finish()
}
}
pub enum TeleportConfigTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct TeleportConfigTemplateTb<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for TeleportConfigTemplateTb<'a> {
type Inner = TeleportConfigTemplateTb<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> TeleportConfigTemplateTb<'a> {
pub const VT_DATA: flatbuffers::VOffsetT = 4;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
TeleportConfigTemplateTb { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args TeleportConfigTemplateTbArgs<'args>
) -> flatbuffers::WIPOffset<TeleportConfigTemplateTb<'bldr>> {
let mut builder = TeleportConfigTemplateTbBuilder::new(_fbb);
if let Some(x) = args.data { builder.add_data(x); }
builder.finish()
}
#[inline]
pub fn data(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<TeleportConfigTemplate<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<TeleportConfigTemplate>>>>(TeleportConfigTemplateTb::VT_DATA, None)}
}
}
impl flatbuffers::Verifiable for TeleportConfigTemplateTb<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<TeleportConfigTemplate>>>>("data", Self::VT_DATA, false)?
.finish();
Ok(())
}
}
pub struct TeleportConfigTemplateTbArgs<'a> {
pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<TeleportConfigTemplate<'a>>>>>,
}
impl<'a> Default for TeleportConfigTemplateTbArgs<'a> {
#[inline]
fn default() -> Self {
TeleportConfigTemplateTbArgs {
data: None,
}
}
}
pub struct TeleportConfigTemplateTbBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TeleportConfigTemplateTbBuilder<'a, 'b, A> {
#[inline]
pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<TeleportConfigTemplate<'b >>>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplateTb::VT_DATA, data);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TeleportConfigTemplateTbBuilder<'a, 'b, A> {
let start = _fbb.start_table();
TeleportConfigTemplateTbBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<TeleportConfigTemplateTb<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for TeleportConfigTemplateTb<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("TeleportConfigTemplateTb");
ds.field("data", &self.data());
ds.finish()
}
}

View file

@ -0,0 +1,324 @@
// automatically generated by the FlatBuffers compiler, do not modify
// @generated
use core::mem;
use core::cmp::Ordering;
extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};
pub enum UrbanAreaMapGroupTemplateOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct UrbanAreaMapGroupTemplate<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for UrbanAreaMapGroupTemplate<'a> {
type Inner = UrbanAreaMapGroupTemplate<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> UrbanAreaMapGroupTemplate<'a> {
pub const VT_AREA_GROUP_ID: flatbuffers::VOffsetT = 4;
pub const VT_UNK_1: flatbuffers::VOffsetT = 6;
pub const VT_UNK_2: flatbuffers::VOffsetT = 8;
pub const VT_UNK_3: flatbuffers::VOffsetT = 10;
pub const VT_UNK_4: flatbuffers::VOffsetT = 12;
pub const VT_GROUP_NAME: flatbuffers::VOffsetT = 14;
pub const VT_UNK_6: flatbuffers::VOffsetT = 16;
pub const VT_IS_MAP_VISIBLE: flatbuffers::VOffsetT = 18;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
UrbanAreaMapGroupTemplate { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args UrbanAreaMapGroupTemplateArgs<'args>
) -> flatbuffers::WIPOffset<UrbanAreaMapGroupTemplate<'bldr>> {
let mut builder = UrbanAreaMapGroupTemplateBuilder::new(_fbb);
if let Some(x) = args.group_name { builder.add_group_name(x); }
if let Some(x) = args.unk_4 { builder.add_unk_4(x); }
builder.add_unk_3(args.unk_3);
builder.add_unk_2(args.unk_2);
if let Some(x) = args.unk_1 { builder.add_unk_1(x); }
builder.add_area_group_id(args.area_group_id);
builder.add_is_map_visible(args.is_map_visible);
builder.add_unk_6(args.unk_6);
builder.finish()
}
#[inline]
pub fn area_group_id(&self) -> u32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<u32>(UrbanAreaMapGroupTemplate::VT_AREA_GROUP_ID, Some(0)).unwrap()}
}
#[inline]
pub fn unk_1(&self) -> Option<flatbuffers::Vector<'a, bool>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, bool>>>(UrbanAreaMapGroupTemplate::VT_UNK_1, None)}
}
#[inline]
pub fn unk_2(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapGroupTemplate::VT_UNK_2, Some(0)).unwrap()}
}
#[inline]
pub fn unk_3(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapGroupTemplate::VT_UNK_3, Some(0)).unwrap()}
}
#[inline]
pub fn unk_4(&self) -> Option<flatbuffers::Vector<'a, i32>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(UrbanAreaMapGroupTemplate::VT_UNK_4, None)}
}
#[inline]
pub fn group_name(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(UrbanAreaMapGroupTemplate::VT_GROUP_NAME, None)}
}
#[inline]
pub fn unk_6(&self) -> bool {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<bool>(UrbanAreaMapGroupTemplate::VT_UNK_6, Some(false)).unwrap()}
}
#[inline]
pub fn is_map_visible(&self) -> bool {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<bool>(UrbanAreaMapGroupTemplate::VT_IS_MAP_VISIBLE, Some(false)).unwrap()}
}
}
impl flatbuffers::Verifiable for UrbanAreaMapGroupTemplate<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<u32>("area_group_id", Self::VT_AREA_GROUP_ID, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, bool>>>("unk_1", Self::VT_UNK_1, false)?
.visit_field::<i32>("unk_2", Self::VT_UNK_2, false)?
.visit_field::<i32>("unk_3", Self::VT_UNK_3, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_4", Self::VT_UNK_4, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("group_name", Self::VT_GROUP_NAME, false)?
.visit_field::<bool>("unk_6", Self::VT_UNK_6, false)?
.visit_field::<bool>("is_map_visible", Self::VT_IS_MAP_VISIBLE, false)?
.finish();
Ok(())
}
}
pub struct UrbanAreaMapGroupTemplateArgs<'a> {
pub area_group_id: u32,
pub unk_1: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, bool>>>,
pub unk_2: i32,
pub unk_3: i32,
pub unk_4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
pub group_name: Option<flatbuffers::WIPOffset<&'a str>>,
pub unk_6: bool,
pub is_map_visible: bool,
}
impl<'a> Default for UrbanAreaMapGroupTemplateArgs<'a> {
#[inline]
fn default() -> Self {
UrbanAreaMapGroupTemplateArgs {
area_group_id: 0,
unk_1: None,
unk_2: 0,
unk_3: 0,
unk_4: None,
group_name: None,
unk_6: false,
is_map_visible: false,
}
}
}
pub struct UrbanAreaMapGroupTemplateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UrbanAreaMapGroupTemplateBuilder<'a, 'b, A> {
#[inline]
pub fn add_area_group_id(&mut self, area_group_id: u32) {
self.fbb_.push_slot::<u32>(UrbanAreaMapGroupTemplate::VT_AREA_GROUP_ID, area_group_id, 0);
}
#[inline]
pub fn add_unk_1(&mut self, unk_1: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplate::VT_UNK_1, unk_1);
}
#[inline]
pub fn add_unk_2(&mut self, unk_2: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapGroupTemplate::VT_UNK_2, unk_2, 0);
}
#[inline]
pub fn add_unk_3(&mut self, unk_3: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapGroupTemplate::VT_UNK_3, unk_3, 0);
}
#[inline]
pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplate::VT_UNK_4, unk_4);
}
#[inline]
pub fn add_group_name(&mut self, group_name: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplate::VT_GROUP_NAME, group_name);
}
#[inline]
pub fn add_unk_6(&mut self, unk_6: bool) {
self.fbb_.push_slot::<bool>(UrbanAreaMapGroupTemplate::VT_UNK_6, unk_6, false);
}
#[inline]
pub fn add_is_map_visible(&mut self, is_map_visible: bool) {
self.fbb_.push_slot::<bool>(UrbanAreaMapGroupTemplate::VT_IS_MAP_VISIBLE, is_map_visible, false);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UrbanAreaMapGroupTemplateBuilder<'a, 'b, A> {
let start = _fbb.start_table();
UrbanAreaMapGroupTemplateBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<UrbanAreaMapGroupTemplate<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for UrbanAreaMapGroupTemplate<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("UrbanAreaMapGroupTemplate");
ds.field("area_group_id", &self.area_group_id());
ds.field("unk_1", &self.unk_1());
ds.field("unk_2", &self.unk_2());
ds.field("unk_3", &self.unk_3());
ds.field("unk_4", &self.unk_4());
ds.field("group_name", &self.group_name());
ds.field("unk_6", &self.unk_6());
ds.field("is_map_visible", &self.is_map_visible());
ds.finish()
}
}
pub enum UrbanAreaMapGroupTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct UrbanAreaMapGroupTemplateTb<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for UrbanAreaMapGroupTemplateTb<'a> {
type Inner = UrbanAreaMapGroupTemplateTb<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> UrbanAreaMapGroupTemplateTb<'a> {
pub const VT_DATA: flatbuffers::VOffsetT = 4;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
UrbanAreaMapGroupTemplateTb { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args UrbanAreaMapGroupTemplateTbArgs<'args>
) -> flatbuffers::WIPOffset<UrbanAreaMapGroupTemplateTb<'bldr>> {
let mut builder = UrbanAreaMapGroupTemplateTbBuilder::new(_fbb);
if let Some(x) = args.data { builder.add_data(x); }
builder.finish()
}
#[inline]
pub fn data(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<UrbanAreaMapGroupTemplate<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<UrbanAreaMapGroupTemplate>>>>(UrbanAreaMapGroupTemplateTb::VT_DATA, None)}
}
}
impl flatbuffers::Verifiable for UrbanAreaMapGroupTemplateTb<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<UrbanAreaMapGroupTemplate>>>>("data", Self::VT_DATA, false)?
.finish();
Ok(())
}
}
pub struct UrbanAreaMapGroupTemplateTbArgs<'a> {
pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<UrbanAreaMapGroupTemplate<'a>>>>>,
}
impl<'a> Default for UrbanAreaMapGroupTemplateTbArgs<'a> {
#[inline]
fn default() -> Self {
UrbanAreaMapGroupTemplateTbArgs {
data: None,
}
}
}
pub struct UrbanAreaMapGroupTemplateTbBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UrbanAreaMapGroupTemplateTbBuilder<'a, 'b, A> {
#[inline]
pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<UrbanAreaMapGroupTemplate<'b >>>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplateTb::VT_DATA, data);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UrbanAreaMapGroupTemplateTbBuilder<'a, 'b, A> {
let start = _fbb.start_table();
UrbanAreaMapGroupTemplateTbBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<UrbanAreaMapGroupTemplateTb<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for UrbanAreaMapGroupTemplateTb<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("UrbanAreaMapGroupTemplateTb");
ds.field("data", &self.data());
ds.finish()
}
}

View file

@ -0,0 +1,613 @@
// automatically generated by the FlatBuffers compiler, do not modify
// @generated
use core::mem;
use core::cmp::Ordering;
extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};
pub enum UrbanAreaMapTemplateOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct UrbanAreaMapTemplate<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for UrbanAreaMapTemplate<'a> {
type Inner = UrbanAreaMapTemplate<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> UrbanAreaMapTemplate<'a> {
pub const VT_AREA_ID: flatbuffers::VOffsetT = 4;
pub const VT_UNK_1: flatbuffers::VOffsetT = 6;
pub const VT_UNK_2: flatbuffers::VOffsetT = 8;
pub const VT_UNK_3: flatbuffers::VOffsetT = 10;
pub const VT_UNK_4: flatbuffers::VOffsetT = 12;
pub const VT_UNK_5: flatbuffers::VOffsetT = 14;
pub const VT_UNK_6: flatbuffers::VOffsetT = 16;
pub const VT_UNK_7: flatbuffers::VOffsetT = 18;
pub const VT_UNK_8: flatbuffers::VOffsetT = 20;
pub const VT_UNK_9: flatbuffers::VOffsetT = 22;
pub const VT_UNK_10: flatbuffers::VOffsetT = 24;
pub const VT_UNK_11: flatbuffers::VOffsetT = 26;
pub const VT_ICON: flatbuffers::VOffsetT = 28;
pub const VT_GROUP_NAME: flatbuffers::VOffsetT = 30;
pub const VT_UNK_14: flatbuffers::VOffsetT = 32;
pub const VT_UNK_15: flatbuffers::VOffsetT = 34;
pub const VT_UNK_16: flatbuffers::VOffsetT = 36;
pub const VT_UNK_17: flatbuffers::VOffsetT = 38;
pub const VT_UNK_18: flatbuffers::VOffsetT = 40;
pub const VT_UNK_19: flatbuffers::VOffsetT = 42;
pub const VT_UNK_20: flatbuffers::VOffsetT = 44;
pub const VT_UNK_21: flatbuffers::VOffsetT = 46;
pub const VT_UNK_22: flatbuffers::VOffsetT = 48;
pub const VT_UNK_23: flatbuffers::VOffsetT = 50;
pub const VT_UNK_24: flatbuffers::VOffsetT = 52;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
UrbanAreaMapTemplate { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args UrbanAreaMapTemplateArgs<'args>
) -> flatbuffers::WIPOffset<UrbanAreaMapTemplate<'bldr>> {
let mut builder = UrbanAreaMapTemplateBuilder::new(_fbb);
if let Some(x) = args.unk_24 { builder.add_unk_24(x); }
builder.add_unk_23(args.unk_23);
builder.add_unk_22(args.unk_22);
builder.add_unk_21(args.unk_21);
builder.add_unk_20(args.unk_20);
builder.add_unk_19(args.unk_19);
builder.add_unk_18(args.unk_18);
builder.add_unk_17(args.unk_17);
builder.add_unk_16(args.unk_16);
builder.add_unk_14(args.unk_14);
if let Some(x) = args.group_name { builder.add_group_name(x); }
if let Some(x) = args.icon { builder.add_icon(x); }
builder.add_unk_11(args.unk_11);
builder.add_unk_10(args.unk_10);
builder.add_unk_9(args.unk_9);
builder.add_unk_8(args.unk_8);
builder.add_unk_7(args.unk_7);
builder.add_unk_5(args.unk_5);
if let Some(x) = args.unk_4 { builder.add_unk_4(x); }
builder.add_unk_3(args.unk_3);
builder.add_unk_2(args.unk_2);
builder.add_unk_1(args.unk_1);
builder.add_area_id(args.area_id);
builder.add_unk_15(args.unk_15);
builder.add_unk_6(args.unk_6);
builder.finish()
}
#[inline]
pub fn area_id(&self) -> u32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<u32>(UrbanAreaMapTemplate::VT_AREA_ID, Some(0)).unwrap()}
}
#[inline]
pub fn unk_1(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_1, Some(0)).unwrap()}
}
#[inline]
pub fn unk_2(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_2, Some(0)).unwrap()}
}
#[inline]
pub fn unk_3(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_3, Some(0)).unwrap()}
}
#[inline]
pub fn unk_4(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(UrbanAreaMapTemplate::VT_UNK_4, None)}
}
#[inline]
pub fn unk_5(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_5, Some(0)).unwrap()}
}
#[inline]
pub fn unk_6(&self) -> bool {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<bool>(UrbanAreaMapTemplate::VT_UNK_6, Some(false)).unwrap()}
}
#[inline]
pub fn unk_7(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_7, Some(0)).unwrap()}
}
#[inline]
pub fn unk_8(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_8, Some(0)).unwrap()}
}
#[inline]
pub fn unk_9(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_9, Some(0)).unwrap()}
}
#[inline]
pub fn unk_10(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_10, Some(0)).unwrap()}
}
#[inline]
pub fn unk_11(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_11, Some(0)).unwrap()}
}
#[inline]
pub fn icon(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(UrbanAreaMapTemplate::VT_ICON, None)}
}
#[inline]
pub fn group_name(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(UrbanAreaMapTemplate::VT_GROUP_NAME, None)}
}
#[inline]
pub fn unk_14(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_14, Some(0)).unwrap()}
}
#[inline]
pub fn unk_15(&self) -> bool {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<bool>(UrbanAreaMapTemplate::VT_UNK_15, Some(false)).unwrap()}
}
#[inline]
pub fn unk_16(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_16, Some(0)).unwrap()}
}
#[inline]
pub fn unk_17(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_17, Some(0)).unwrap()}
}
#[inline]
pub fn unk_18(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_18, Some(0)).unwrap()}
}
#[inline]
pub fn unk_19(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_19, Some(0)).unwrap()}
}
#[inline]
pub fn unk_20(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_20, Some(0)).unwrap()}
}
#[inline]
pub fn unk_21(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_21, Some(0)).unwrap()}
}
#[inline]
pub fn unk_22(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_22, Some(0)).unwrap()}
}
#[inline]
pub fn unk_23(&self) -> i32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<i32>(UrbanAreaMapTemplate::VT_UNK_23, Some(0)).unwrap()}
}
#[inline]
pub fn unk_24(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(UrbanAreaMapTemplate::VT_UNK_24, None)}
}
}
impl flatbuffers::Verifiable for UrbanAreaMapTemplate<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<u32>("area_id", Self::VT_AREA_ID, false)?
.visit_field::<i32>("unk_1", Self::VT_UNK_1, false)?
.visit_field::<i32>("unk_2", Self::VT_UNK_2, false)?
.visit_field::<i32>("unk_3", Self::VT_UNK_3, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_4", Self::VT_UNK_4, false)?
.visit_field::<i32>("unk_5", Self::VT_UNK_5, false)?
.visit_field::<bool>("unk_6", Self::VT_UNK_6, false)?
.visit_field::<i32>("unk_7", Self::VT_UNK_7, false)?
.visit_field::<i32>("unk_8", Self::VT_UNK_8, false)?
.visit_field::<i32>("unk_9", Self::VT_UNK_9, false)?
.visit_field::<i32>("unk_10", Self::VT_UNK_10, false)?
.visit_field::<i32>("unk_11", Self::VT_UNK_11, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("icon", Self::VT_ICON, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("group_name", Self::VT_GROUP_NAME, false)?
.visit_field::<i32>("unk_14", Self::VT_UNK_14, false)?
.visit_field::<bool>("unk_15", Self::VT_UNK_15, false)?
.visit_field::<i32>("unk_16", Self::VT_UNK_16, false)?
.visit_field::<i32>("unk_17", Self::VT_UNK_17, false)?
.visit_field::<i32>("unk_18", Self::VT_UNK_18, false)?
.visit_field::<i32>("unk_19", Self::VT_UNK_19, false)?
.visit_field::<i32>("unk_20", Self::VT_UNK_20, false)?
.visit_field::<i32>("unk_21", Self::VT_UNK_21, false)?
.visit_field::<i32>("unk_22", Self::VT_UNK_22, false)?
.visit_field::<i32>("unk_23", Self::VT_UNK_23, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_24", Self::VT_UNK_24, false)?
.finish();
Ok(())
}
}
pub struct UrbanAreaMapTemplateArgs<'a> {
pub area_id: u32,
pub unk_1: i32,
pub unk_2: i32,
pub unk_3: i32,
pub unk_4: Option<flatbuffers::WIPOffset<&'a str>>,
pub unk_5: i32,
pub unk_6: bool,
pub unk_7: i32,
pub unk_8: i32,
pub unk_9: i32,
pub unk_10: i32,
pub unk_11: i32,
pub icon: Option<flatbuffers::WIPOffset<&'a str>>,
pub group_name: Option<flatbuffers::WIPOffset<&'a str>>,
pub unk_14: i32,
pub unk_15: bool,
pub unk_16: i32,
pub unk_17: i32,
pub unk_18: i32,
pub unk_19: i32,
pub unk_20: i32,
pub unk_21: i32,
pub unk_22: i32,
pub unk_23: i32,
pub unk_24: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for UrbanAreaMapTemplateArgs<'a> {
#[inline]
fn default() -> Self {
UrbanAreaMapTemplateArgs {
area_id: 0,
unk_1: 0,
unk_2: 0,
unk_3: 0,
unk_4: None,
unk_5: 0,
unk_6: false,
unk_7: 0,
unk_8: 0,
unk_9: 0,
unk_10: 0,
unk_11: 0,
icon: None,
group_name: None,
unk_14: 0,
unk_15: false,
unk_16: 0,
unk_17: 0,
unk_18: 0,
unk_19: 0,
unk_20: 0,
unk_21: 0,
unk_22: 0,
unk_23: 0,
unk_24: None,
}
}
}
pub struct UrbanAreaMapTemplateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UrbanAreaMapTemplateBuilder<'a, 'b, A> {
#[inline]
pub fn add_area_id(&mut self, area_id: u32) {
self.fbb_.push_slot::<u32>(UrbanAreaMapTemplate::VT_AREA_ID, area_id, 0);
}
#[inline]
pub fn add_unk_1(&mut self, unk_1: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_1, unk_1, 0);
}
#[inline]
pub fn add_unk_2(&mut self, unk_2: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_2, unk_2, 0);
}
#[inline]
pub fn add_unk_3(&mut self, unk_3: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_3, unk_3, 0);
}
#[inline]
pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapTemplate::VT_UNK_4, unk_4);
}
#[inline]
pub fn add_unk_5(&mut self, unk_5: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_5, unk_5, 0);
}
#[inline]
pub fn add_unk_6(&mut self, unk_6: bool) {
self.fbb_.push_slot::<bool>(UrbanAreaMapTemplate::VT_UNK_6, unk_6, false);
}
#[inline]
pub fn add_unk_7(&mut self, unk_7: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_7, unk_7, 0);
}
#[inline]
pub fn add_unk_8(&mut self, unk_8: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_8, unk_8, 0);
}
#[inline]
pub fn add_unk_9(&mut self, unk_9: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_9, unk_9, 0);
}
#[inline]
pub fn add_unk_10(&mut self, unk_10: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_10, unk_10, 0);
}
#[inline]
pub fn add_unk_11(&mut self, unk_11: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_11, unk_11, 0);
}
#[inline]
pub fn add_icon(&mut self, icon: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapTemplate::VT_ICON, icon);
}
#[inline]
pub fn add_group_name(&mut self, group_name: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapTemplate::VT_GROUP_NAME, group_name);
}
#[inline]
pub fn add_unk_14(&mut self, unk_14: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_14, unk_14, 0);
}
#[inline]
pub fn add_unk_15(&mut self, unk_15: bool) {
self.fbb_.push_slot::<bool>(UrbanAreaMapTemplate::VT_UNK_15, unk_15, false);
}
#[inline]
pub fn add_unk_16(&mut self, unk_16: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_16, unk_16, 0);
}
#[inline]
pub fn add_unk_17(&mut self, unk_17: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_17, unk_17, 0);
}
#[inline]
pub fn add_unk_18(&mut self, unk_18: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_18, unk_18, 0);
}
#[inline]
pub fn add_unk_19(&mut self, unk_19: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_19, unk_19, 0);
}
#[inline]
pub fn add_unk_20(&mut self, unk_20: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_20, unk_20, 0);
}
#[inline]
pub fn add_unk_21(&mut self, unk_21: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_21, unk_21, 0);
}
#[inline]
pub fn add_unk_22(&mut self, unk_22: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_22, unk_22, 0);
}
#[inline]
pub fn add_unk_23(&mut self, unk_23: i32) {
self.fbb_.push_slot::<i32>(UrbanAreaMapTemplate::VT_UNK_23, unk_23, 0);
}
#[inline]
pub fn add_unk_24(&mut self, unk_24: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapTemplate::VT_UNK_24, unk_24);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UrbanAreaMapTemplateBuilder<'a, 'b, A> {
let start = _fbb.start_table();
UrbanAreaMapTemplateBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<UrbanAreaMapTemplate<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for UrbanAreaMapTemplate<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("UrbanAreaMapTemplate");
ds.field("area_id", &self.area_id());
ds.field("unk_1", &self.unk_1());
ds.field("unk_2", &self.unk_2());
ds.field("unk_3", &self.unk_3());
ds.field("unk_4", &self.unk_4());
ds.field("unk_5", &self.unk_5());
ds.field("unk_6", &self.unk_6());
ds.field("unk_7", &self.unk_7());
ds.field("unk_8", &self.unk_8());
ds.field("unk_9", &self.unk_9());
ds.field("unk_10", &self.unk_10());
ds.field("unk_11", &self.unk_11());
ds.field("icon", &self.icon());
ds.field("group_name", &self.group_name());
ds.field("unk_14", &self.unk_14());
ds.field("unk_15", &self.unk_15());
ds.field("unk_16", &self.unk_16());
ds.field("unk_17", &self.unk_17());
ds.field("unk_18", &self.unk_18());
ds.field("unk_19", &self.unk_19());
ds.field("unk_20", &self.unk_20());
ds.field("unk_21", &self.unk_21());
ds.field("unk_22", &self.unk_22());
ds.field("unk_23", &self.unk_23());
ds.field("unk_24", &self.unk_24());
ds.finish()
}
}
pub enum UrbanAreaMapTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct UrbanAreaMapTemplateTb<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for UrbanAreaMapTemplateTb<'a> {
type Inner = UrbanAreaMapTemplateTb<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> UrbanAreaMapTemplateTb<'a> {
pub const VT_DATA: flatbuffers::VOffsetT = 4;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
UrbanAreaMapTemplateTb { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args UrbanAreaMapTemplateTbArgs<'args>
) -> flatbuffers::WIPOffset<UrbanAreaMapTemplateTb<'bldr>> {
let mut builder = UrbanAreaMapTemplateTbBuilder::new(_fbb);
if let Some(x) = args.data { builder.add_data(x); }
builder.finish()
}
#[inline]
pub fn data(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<UrbanAreaMapTemplate<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<UrbanAreaMapTemplate>>>>(UrbanAreaMapTemplateTb::VT_DATA, None)}
}
}
impl flatbuffers::Verifiable for UrbanAreaMapTemplateTb<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<UrbanAreaMapTemplate>>>>("data", Self::VT_DATA, false)?
.finish();
Ok(())
}
}
pub struct UrbanAreaMapTemplateTbArgs<'a> {
pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<UrbanAreaMapTemplate<'a>>>>>,
}
impl<'a> Default for UrbanAreaMapTemplateTbArgs<'a> {
#[inline]
fn default() -> Self {
UrbanAreaMapTemplateTbArgs {
data: None,
}
}
}
pub struct UrbanAreaMapTemplateTbBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UrbanAreaMapTemplateTbBuilder<'a, 'b, A> {
#[inline]
pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<UrbanAreaMapTemplate<'b >>>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapTemplateTb::VT_DATA, data);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UrbanAreaMapTemplateTbBuilder<'a, 'b, A> {
let start = _fbb.start_table();
UrbanAreaMapTemplateTbBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<UrbanAreaMapTemplateTb<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for UrbanAreaMapTemplateTb<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("UrbanAreaMapTemplateTb");
ds.field("data", &self.data());
ds.finish()
}
}

View file

@ -36,6 +36,9 @@ file_cfg! {
PostGirlConfigTemplate;
HollowEventTemplate;
HollowChallengeTemplate;
TeleportConfigTemplate;
UrbanAreaMapGroupTemplate;
UrbanAreaMapTemplate;
}
macro_rules! file_cfg {

View file

@ -61,7 +61,7 @@ impl AvatarUnit {
self.add_property(
EPropertyType::SkipDefAtk,
self.get_property(EPropertyType::Atk) * 30 / 100
self.get_property(EPropertyType::Atk) * 30 / 100,
);
assign!(
@ -126,8 +126,8 @@ impl AvatarUnit {
EPropertyType::SkipDefAtk,
EPropertyType::HpMax,
[10, 10, 10, 10, 10, 10, 10],
)
)
),
),
])
});
@ -171,12 +171,7 @@ impl AvatarUnit {
ElementAbnormalPowerRatio,
ElementAbnormalPowerDelta,
);
self.set_dynamic_property(
AddedDamageRatio,
AddedDamageRatio1,
None,
AddedDamageRatio3,
);
self.set_dynamic_property(AddedDamageRatio, AddedDamageRatio1, None, AddedDamageRatio3);
self.set_dynamic_property(
AddedDamageRatioPhysics,
AddedDamageRatioPhysics1,

View file

@ -6,16 +6,16 @@ use config::{
use npc::{Interact, InteractTarget, SceneUnit};
use tracing::{error, warn};
use vivian_proto::{
common::TimePeriodType, EnterSceneScNotify, EventGraphOwnerType, FinishEventGraphScNotify,
SectionEventScNotify,
EnterSceneScNotify, EventGraphOwnerType, FinishEventGraphScNotify, SectionEventScNotify,
common::TimePeriodType,
};
use crate::{
event::{event_util, ActionListener, Event, EventState, EventUID},
LogicResources,
event::{ActionListener, Event, EventState, EventUID, event_util},
listener::{LogicEventListener, NotifyListener},
math::{Scale, Transform},
scene::SceneType,
LogicResources,
};
pub mod npc;

View file

@ -1,4 +1,7 @@
use vivian_logic::{item::{AvatarItem, EAvatarSkillType}, listener::{NotifyListener, NotifyListenerExt}};
use vivian_logic::{
item::{AvatarItem, EAvatarSkillType},
listener::{NotifyListener, NotifyListenerExt},
};
use super::*;
@ -12,8 +15,6 @@ pub struct AvatarModel {
}
impl AvatarModel {
pub fn send_add_avatar_notify(&self, listener: &mut dyn NotifyListener) {
self.add_avatar_perform_map
.iter_changed_items()
@ -66,8 +67,6 @@ impl AvatarModel {
add_avatar_perform_map: PropertyHashMap::default(),
}
}
}
impl Saveable for AvatarModel {

View file

@ -1,5 +1,5 @@
use super::*;
use property::{Property, PrimitiveProperty};
use property::{PrimitiveProperty, Property};
#[derive(Model)]
pub struct PlayerBasicModel {

View file

@ -1,5 +1,5 @@
use super::*;
use property::{PropertyHashMap, PropertyHashSet, Property};
use property::{Property, PropertyHashMap, PropertyHashSet};
#[derive(Model)]
pub struct HollowModel {

View file

@ -1,7 +1,7 @@
use std::collections::HashMap;
use super::*;
use property::{Property, PropertyHashMap, PrimitiveProperty};
use property::{PrimitiveProperty, Property, PropertyHashMap};
use vivian_logic::item::{EquipItem, WeaponItem};
#[derive(Model)]

View file

@ -9,6 +9,7 @@ mod gacha;
mod hollow;
mod item;
mod main_city;
mod map;
mod misc;
mod quest;
mod scene;
@ -22,9 +23,10 @@ pub use gacha::{GachaModel, GachaStatistics};
pub use hollow::{Hollow, HollowModel};
pub use item::ItemModel;
pub use main_city::MainCityModel;
pub use map::{AreaGroupInfo, AreaStreetInfo, MapModel};
pub use misc::{
MiscModel, PropertyNewbieData, PropertyNewsStandData, PropertyPostGirlData, PropertySwitchData,
PropertyUnlockData, QuickAccess
PropertyUnlockData, QuickAccess,
};
pub use quest::{MainCityQuestExt, Quest, QuestCollection, QuestModel};
pub use scene::*;

View file

@ -1,5 +1,5 @@
use super::*;
use property::{Property, PropertyTransform, PrimitiveProperty};
use property::{PrimitiveProperty, Property, PropertyTransform};
use vivian_logic::{hall::HallPosition, math::Transform};
#[derive(Model)]

85
lib/models/src/map.rs Normal file
View file

@ -0,0 +1,85 @@
use super::*;
use property::{Property, PropertyHashMap};
#[derive(Default)]
pub struct AreaGroupInfo {
pub is_unlocked: bool,
pub area_progress: u32,
}
#[derive(Default)]
pub struct AreaStreetInfo {
pub is_unlocked: bool,
pub area_progress: u32,
pub location_pop_showed: bool,
pub new_area_showed: bool,
}
#[derive(Model)]
pub struct MapModel {
pub area_group_map: PropertyHashMap<u32, AreaGroupInfo>,
pub area_street_map: PropertyHashMap<u32, AreaStreetInfo>,
}
impl MapModel {
pub fn load_from_pb(pb: MapData) -> Self {
Self {
area_group_map: pb
.area_group_list
.into_iter()
.map(|group| {
(
group.group_id,
AreaGroupInfo {
is_unlocked: group.is_unlocked.into(),
area_progress: group.area_progress.into(),
},
)
})
.collect(),
area_street_map: pb
.area_street_list
.into_iter()
.map(|street| {
(
street.area_id,
AreaStreetInfo {
is_unlocked: street.is_unlocked.into(),
area_progress: street.area_progress.into(),
location_pop_showed: street.location_pop_showed.into(),
new_area_showed: street.new_area_showed.into(),
},
)
})
.collect(),
}
}
}
impl Saveable for MapModel {
fn save_to_pb(&self, root: &mut vivian_proto::server_only::PlayerData) {
root.map = Some(MapData {
area_group_list: self
.area_group_map
.iter()
.map(|(&group_id, group)| MapAreaGroupInfo {
group_id,
is_unlocked: group.is_unlocked,
area_progress: group.area_progress,
})
.collect(),
area_street_list: self
.area_street_map
.iter()
.map(|(&area_id, street)| MapAreaStreetInfo {
area_id,
is_unlocked: street.is_unlocked,
area_progress: street.area_progress,
location_pop_showed: street.location_pop_showed,
new_area_showed: street.new_area_showed,
})
.collect(),
});
}
}

View file

@ -1,7 +1,7 @@
use super::*;
use vivian_codegen::Property;
use property::{PropertyHashMap, PropertyHashSet, Property, PrimitiveProperty};
use property::{PrimitiveProperty, Property, PropertyHashMap, PropertyHashSet};
#[derive(Property, Default)]
pub struct PropertyUnlockData {
@ -15,6 +15,11 @@ pub struct QuickAccess {
pub quick_access_type: i32,
}
#[derive(Property, Default)]
pub struct PropertyTeleportUnlockData {
pub unlocked_id: PropertyHashSet<i32>,
}
#[derive(Property, Default)]
pub struct PropertyPostGirlData {
pub unlocked_items: PropertyHashMap<u32, i64>,
@ -51,6 +56,7 @@ pub struct PropertySwitchData {
pub struct MiscModel {
pub switch: PropertySwitchData,
pub unlock: PropertyUnlockData,
pub teleport: PropertyTeleportUnlockData,
pub newbie: PropertyNewbieData,
pub news_stand: PropertyNewsStandData,
pub post_girl: PropertyPostGirlData,
@ -104,6 +110,12 @@ impl MiscModel {
random_toggle: data.post_girl_random_toggle.into(),
})
.unwrap_or_default(),
teleport: pb
.teleport
.map(|data| PropertyTeleportUnlockData {
unlocked_id: data.unlocked_id_list.into_iter().collect(),
})
.unwrap_or_default(),
}
}
}
@ -141,6 +153,9 @@ impl Saveable for MiscModel {
selected_id_list: self.post_girl.selected_id.iter().copied().collect(),
post_girl_random_toggle: self.post_girl.random_toggle.get(),
}),
teleport: Some(TeleportUnlockData {
unlocked_id_list: self.teleport.unlocked_id.iter().copied().collect(),
}),
});
}
}
@ -191,4 +206,3 @@ impl PropertyNewsStandData {
}
}
}

View file

@ -1,14 +1,14 @@
mod map;
mod math_ext;
mod primitive;
mod set;
mod random;
mod set;
pub use map::PropertyHashMap;
pub use math_ext::PropertyTransform;
pub use primitive::PrimitiveProperty;
pub use set::PropertyHashSet;
pub use random::GachaRandom;
pub use set::PropertyHashSet;
pub trait Property {
fn is_changed(&self) -> bool;

View file

@ -152,5 +152,3 @@ impl Saveable for QuestModel {
});
}
}

View file

@ -1,10 +1,19 @@
use std::{collections::{HashMap, HashSet}, str::FromStr};
use std::{
collections::{HashMap, HashSet},
str::FromStr,
};
use super::*;
use config::{GraphReference, SectionEvent};
use property::{Property, PropertyHashMap, PrimitiveProperty};
use property::{PrimitiveProperty, Property, PropertyHashMap};
use tracing::warn;
use vivian_logic::{dungeon::{Dungeon, DungeonEquipment}, event::{EventState, EventUID}, hall::npc::InteractTarget, math::Scale, scene::ELocalPlayType};
use vivian_logic::{
dungeon::{Dungeon, DungeonEquipment},
event::{EventState, EventUID},
hall::npc::InteractTarget,
math::Scale,
scene::ELocalPlayType,
};
#[derive(Model)]
pub struct SceneModel {

View file

@ -1,9 +1,9 @@
use anyhow::{bail, Error};
use anyhow::{Error, bail};
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
use quote::{ToTokens, quote};
use syn::Meta;
use crate::field::{set_bool, set_option, tag_attr, word_attr, Label};
use crate::field::{Label, set_bool, set_option, tag_attr, word_attr};
#[derive(Clone)]
pub struct Field {

View file

@ -1,7 +1,7 @@
use anyhow::{bail, Error};
use anyhow::{Error, bail};
use proc_macro2::TokenStream;
use quote::quote;
use syn::{parse_str, Expr, ExprLit, Ident, Lit, Meta, MetaNameValue, Path};
use syn::{Expr, ExprLit, Ident, Lit, Meta, MetaNameValue, Path, parse_str};
use crate::field::{set_option, tags_attr};

View file

@ -1,22 +1,19 @@
// This file is @generated by prost-build.
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct Transform {
#[prost(double, repeated, tag = "1")]
pub position: ::prost::alloc::vec::Vec<f64>,
#[prost(double, repeated, tag = "2")]
pub rotation: ::prost::alloc::vec::Vec<f64>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct Vector2Int {
#[prost(int32, tag = "1")]
pub x: i32,
#[prost(int32, tag = "2")]
pub y: i32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct HollowGridState {
#[prost(int32, tag = "1")]
pub node_state: i32,
@ -27,8 +24,7 @@ pub struct HollowGridState {
#[prost(int32, tag = "4")]
pub sub_state: i32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct LogSkillUseInfo {
#[prost(int32, tag = "1")]
pub skill_id: i32,
@ -43,8 +39,7 @@ pub struct LogSkillUseInfo {
#[prost(string, tag = "6")]
pub skill_name: ::prost::alloc::string::String,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct LogBattleAvatarInfo {
#[prost(int32, tag = "1")]
pub avatar_id: i32,
@ -73,8 +68,7 @@ pub struct LogBattleAvatarInfo {
#[prost(message, repeated, tag = "14")]
pub skill_use: ::prost::alloc::vec::Vec<LogSkillUseInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct LogBattleStatistics {
#[prost(int64, tag = "1")]
pub battle_uid: i64,
@ -93,8 +87,7 @@ pub struct LogBattleStatistics {
#[prost(int32, tag = "11")]
pub star: i32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct FightResult {
#[prost(int32, tag = "1")]
pub result: i32,
@ -192,9 +185,7 @@ impl HollowGridFlag {
Self::SyncToClient => "HOLLOW_GRID_FLAG_SYNC_TO_CLIENT",
Self::Door => "HOLLOW_GRID_FLAG_DOOR",
Self::CanTriggerMultiTimes => "HOLLOW_GRID_FLAG_CAN_TRIGGER_MULTI_TIMES",
Self::TemporaryVisibleAtAround => {
"HOLLOW_GRID_FLAG_TEMPORARY_VISIBLE_AT_AROUND"
}
Self::TemporaryVisibleAtAround => "HOLLOW_GRID_FLAG_TEMPORARY_VISIBLE_AT_AROUND",
Self::Unlocked => "HOLLOW_GRID_FLAG_UNLOCKED",
Self::Brighten => "HOLLOW_GRID_FLAG_BRIGHTEN",
Self::Guide => "HOLLOW_GRID_FLAG_GUIDE",
@ -222,17 +213,11 @@ impl HollowGridFlag {
"HOLLOW_GRID_FLAG_CAN_TRIGGER_EVENT" => Some(Self::CanTriggerEvent),
"HOLLOW_GRID_FLAG_VISIBLE" => Some(Self::Visible),
"HOLLOW_GRID_FLAG_VISIBLE_AT_GRID_AROUND" => Some(Self::VisibleAtGridAround),
"HOLLOW_GRID_FLAG_VISIBLE_BY_TRIGGER_EVENT" => {
Some(Self::VisibleByTriggerEvent)
}
"HOLLOW_GRID_FLAG_VISIBLE_BY_TRIGGER_EVENT" => Some(Self::VisibleByTriggerEvent),
"HOLLOW_GRID_FLAG_SYNC_TO_CLIENT" => Some(Self::SyncToClient),
"HOLLOW_GRID_FLAG_DOOR" => Some(Self::Door),
"HOLLOW_GRID_FLAG_CAN_TRIGGER_MULTI_TIMES" => {
Some(Self::CanTriggerMultiTimes)
}
"HOLLOW_GRID_FLAG_TEMPORARY_VISIBLE_AT_AROUND" => {
Some(Self::TemporaryVisibleAtAround)
}
"HOLLOW_GRID_FLAG_CAN_TRIGGER_MULTI_TIMES" => Some(Self::CanTriggerMultiTimes),
"HOLLOW_GRID_FLAG_TEMPORARY_VISIBLE_AT_AROUND" => Some(Self::TemporaryVisibleAtAround),
"HOLLOW_GRID_FLAG_UNLOCKED" => Some(Self::Unlocked),
"HOLLOW_GRID_FLAG_BRIGHTEN" => Some(Self::Brighten),
"HOLLOW_GRID_FLAG_GUIDE" => Some(Self::Guide),
@ -344,9 +329,7 @@ impl NodeVisible {
"NODE_VISIBLE_VISIBLE" => Some(Self::Visible),
"NODE_VISIBLE_VISIBLE_AT_GRID_AROUND" => Some(Self::VisibleAtGridAround),
"NODE_VISIBLE_VISIBLE_BY_TRIGGER_EVENT" => Some(Self::VisibleByTriggerEvent),
"NODE_VISIBLE_TEMPORARY_VISIBLE_AT_AROUND" => {
Some(Self::TemporaryVisibleAtAround)
}
"NODE_VISIBLE_TEMPORARY_VISIBLE_AT_AROUND" => Some(Self::TemporaryVisibleAtAround),
"NODE_VISIBLE_BLOCKED" => Some(Self::Blocked),
_ => None,
}

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,5 @@
// This file is @generated by prost-build.
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct PlayerData {
#[prost(message, optional, tag = "1")]
pub basic: ::core::option::Option<BasicData>,
@ -26,9 +25,10 @@ pub struct PlayerData {
pub scene: ::core::option::Option<SceneData>,
#[prost(message, optional, tag = "12")]
pub gacha: ::core::option::Option<GachaData>,
#[prost(message, optional, tag = "13")]
pub map: ::core::option::Option<MapData>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct BasicData {
#[prost(string, tag = "1")]
pub nick_name: ::prost::alloc::string::String,
@ -49,14 +49,12 @@ pub struct BasicData {
#[prost(uint32, tag = "9")]
pub portrait_id: u32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct AvatarData {
#[prost(message, repeated, tag = "1")]
pub avatar_list: ::prost::alloc::vec::Vec<AvatarItemInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct AvatarItemInfo {
#[prost(uint32, tag = "1")]
pub id: u32,
@ -89,8 +87,7 @@ pub struct AvatarItemInfo {
#[prost(bool, tag = "15")]
pub is_favorite: bool,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct ItemData {
#[prost(message, repeated, tag = "1")]
pub item_list: ::prost::alloc::vec::Vec<GenericItemInfo>,
@ -103,16 +100,14 @@ pub struct ItemData {
#[prost(uint32, tag = "5")]
pub item_uid_counter: u32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct GenericItemInfo {
#[prost(uint32, tag = "1")]
pub id: u32,
#[prost(int32, tag = "2")]
pub count: i32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct WeaponItemInfo {
#[prost(uint32, tag = "1")]
pub uid: u32,
@ -129,8 +124,7 @@ pub struct WeaponItemInfo {
#[prost(bool, tag = "7")]
pub lock: bool,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct EquipPropertyInfo {
#[prost(uint32, tag = "1")]
pub property_type: u32,
@ -139,8 +133,7 @@ pub struct EquipPropertyInfo {
#[prost(uint32, tag = "3")]
pub add_value: u32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct EquipItemInfo {
#[prost(uint32, tag = "1")]
pub uid: u32,
@ -159,28 +152,24 @@ pub struct EquipItemInfo {
#[prost(message, repeated, tag = "8")]
pub sub_properties: ::prost::alloc::vec::Vec<EquipPropertyInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct AutoRecoveryItemInfo {
#[prost(uint32, tag = "1")]
pub buy_times: u32,
#[prost(int64, tag = "2")]
pub last_recovery_timestamp: i64,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct QuestData {
#[prost(message, repeated, tag = "1")]
pub quest_collection_list: ::prost::alloc::vec::Vec<QuestCollectionInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct MainCityQuestInfo {
#[prost(uint32, repeated, tag = "1")]
pub track_npc_id_list: ::prost::alloc::vec::Vec<u32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct QuestInfo {
#[prost(uint32, tag = "1")]
pub id: u32,
@ -197,8 +186,7 @@ pub struct QuestInfo {
#[prost(message, optional, tag = "7")]
pub main_city_quest_info: ::core::option::Option<MainCityQuestInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct QuestCollectionInfo {
#[prost(uint32, tag = "1")]
pub quest_type: u32,
@ -207,24 +195,21 @@ pub struct QuestCollectionInfo {
#[prost(uint32, repeated, tag = "3")]
pub finish_quest_id_list: ::prost::alloc::vec::Vec<u32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct ArchiveData {
#[prost(uint32, repeated, tag = "1")]
pub hollow_archive_id_list: ::prost::alloc::vec::Vec<u32>,
#[prost(message, repeated, tag = "2")]
pub videotape_list: ::prost::alloc::vec::Vec<VideotapeInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct VideotapeInfo {
#[prost(uint32, tag = "1")]
pub archive_file_id: u32,
#[prost(bool, tag = "2")]
pub finished: bool,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct HollowData {
#[prost(uint32, repeated, tag = "1")]
pub hollow_group_list: ::prost::alloc::vec::Vec<u32>,
@ -239,8 +224,7 @@ pub struct HollowData {
#[prost(uint32, repeated, tag = "6")]
pub executed_hollow_event_id_list: ::prost::alloc::vec::Vec<u32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct HollowInfo {
#[prost(uint32, tag = "1")]
pub hollow_quest_id: u32,
@ -249,17 +233,14 @@ pub struct HollowInfo {
#[prost(uint32, tag = "3")]
pub acquired_hollow_challenge_reward: u32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct AbyssData {}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct BuddyData {
#[prost(message, repeated, tag = "1")]
pub buddy_list: ::prost::alloc::vec::Vec<BuddyItemInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct BuddyItemInfo {
#[prost(uint32, tag = "1")]
pub id: u32,
@ -278,8 +259,7 @@ pub struct BuddyItemInfo {
#[prost(uint32, repeated, tag = "8")]
pub taken_rank_up_reward_list: ::prost::alloc::vec::Vec<u32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct MiscData {
#[prost(message, optional, tag = "1")]
pub switch: ::core::option::Option<SwitchData>,
@ -291,15 +271,15 @@ pub struct MiscData {
pub news_stand: ::core::option::Option<NewsStandData>,
#[prost(message, optional, tag = "5")]
pub post_girl: ::core::option::Option<PostGirlData>,
#[prost(message, optional, tag = "6")]
pub teleport: ::core::option::Option<TeleportUnlockData>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct SwitchData {
#[prost(uint32, repeated, tag = "1")]
pub open_system_id_list: ::prost::alloc::vec::Vec<u32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct QuickAccessItem {
#[prost(uint32, tag = "1")]
pub quick_access_id: u32,
@ -308,22 +288,19 @@ pub struct QuickAccessItem {
#[prost(int32, tag = "3")]
pub quick_access_type: i32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct UnlockData {
#[prost(int32, repeated, tag = "1")]
pub unlocked_id_list: ::prost::alloc::vec::Vec<i32>,
#[prost(message, repeated, tag = "2")]
pub quick_access_list: ::prost::alloc::vec::Vec<QuickAccessItem>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct NewbieData {
#[prost(int32, repeated, tag = "1")]
pub finished_group_id_list: ::prost::alloc::vec::Vec<i32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct NewsStandData {
#[prost(int32, tag = "1")]
pub cur_style: i32,
@ -346,16 +323,14 @@ pub struct NewsStandData {
#[prost(int64, tag = "10")]
pub last_sign_time: i64,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct PostGirlItem {
#[prost(uint32, tag = "1")]
pub id: u32,
#[prost(int64, tag = "2")]
pub unlock_time: i64,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct PostGirlData {
#[prost(message, repeated, tag = "1")]
pub post_girl_item_list: ::prost::alloc::vec::Vec<PostGirlItem>,
@ -364,8 +339,12 @@ pub struct PostGirlData {
#[prost(bool, tag = "3")]
pub post_girl_random_toggle: bool,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct TeleportUnlockData {
#[prost(int32, repeated, tag = "1")]
pub unlocked_id_list: ::prost::alloc::vec::Vec<i32>,
}
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct MainCityData {
#[prost(uint32, tag = "3")]
pub bgm_id: u32,
@ -388,8 +367,7 @@ pub mod main_city_data {
TransformId(::prost::alloc::string::String),
}
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct SceneData {
#[prost(uint64, tag = "1")]
pub cur_scene_uid: u64,
@ -400,8 +378,7 @@ pub struct SceneData {
#[prost(map = "uint64, message", tag = "4")]
pub dungeons: ::std::collections::HashMap<u64, DungeonInfo>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct SceneInfo {
#[prost(uint32, tag = "1")]
pub id: u32,
@ -430,8 +407,7 @@ pub mod scene_info {
LongFight(super::LongFightSceneInfo),
}
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct HallSceneInfo {
#[prost(uint32, tag = "1")]
pub cur_section_id: u32,
@ -440,8 +416,7 @@ pub struct HallSceneInfo {
#[prost(map = "int32, int32", tag = "3")]
pub main_city_objects_state: ::std::collections::HashMap<i32, i32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct UnitInteract {
#[prost(int32, tag = "1")]
pub tag_id: i32,
@ -462,8 +437,7 @@ pub struct UnitInteract {
#[prost(int32, repeated, tag = "9")]
pub interact_target_list: ::prost::alloc::vec::Vec<i32>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct HallSceneUnit {
#[prost(uint32, tag = "1")]
pub npc_tag_id: u32,
@ -472,16 +446,14 @@ pub struct HallSceneUnit {
#[prost(map = "uint32, message", tag = "3")]
pub interacts: ::std::collections::HashMap<u32, UnitInteract>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct AttachedGraphInfo {
#[prost(uint32, tag = "1")]
pub reference_id: u32,
#[prost(enumeration = "GraphReferenceType", tag = "2")]
pub reference_type: i32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct EventStateInfo {
#[prost(uint64, tag = "1")]
pub event_uid: u64,
@ -498,8 +470,7 @@ pub struct EventStateInfo {
#[prost(uint32, tag = "7")]
pub tag: u32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct HallSectionInfo {
#[prost(uint32, tag = "1")]
pub section_id: u32,
@ -512,35 +483,30 @@ pub struct HallSectionInfo {
#[prost(uint64, repeated, tag = "5")]
pub already_executed_event_uid_list: ::prost::alloc::vec::Vec<u64>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct HollowSceneInfo {}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct FightSceneInfo {
#[prost(string, tag = "1")]
pub time_period: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub weather: ::prost::alloc::string::String,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct LongFightSceneInfo {
#[prost(string, tag = "1")]
pub time_period: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub weather: ::prost::alloc::string::String,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct DungeonInfo {
#[prost(uint32, tag = "1")]
pub quest_id: u32,
#[prost(uint32, tag = "2")]
pub quest_type: u32,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct GachaStatisticsInfo {
#[prost(uint32, tag = "1")]
pub gacha_id: u32,
@ -555,14 +521,42 @@ pub struct GachaStatisticsInfo {
#[prost(bool, tag = "6")]
pub optional_up_item_state: bool,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct GachaData {
#[prost(message, repeated, tag = "1")]
pub gacha_statistics_list: ::prost::alloc::vec::Vec<GachaStatisticsInfo>,
#[prost(uint32, tag = "2")]
pub gacha_random: u32,
}
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct MapAreaGroupInfo {
#[prost(uint32, tag = "1")]
pub group_id: u32,
#[prost(bool, tag = "2")]
pub is_unlocked: bool,
#[prost(uint32, tag = "3")]
pub area_progress: u32,
}
#[derive(::proto_derive::NetCmd, Clone, Copy, PartialEq, ::prost::Message)]
pub struct MapAreaStreetInfo {
#[prost(uint32, tag = "1")]
pub area_id: u32,
#[prost(bool, tag = "2")]
pub is_unlocked: bool,
#[prost(uint32, tag = "3")]
pub area_progress: u32,
#[prost(bool, tag = "4")]
pub location_pop_showed: bool,
#[prost(bool, tag = "5")]
pub new_area_showed: bool,
}
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct MapData {
#[prost(message, repeated, tag = "1")]
pub area_group_list: ::prost::alloc::vec::Vec<MapAreaGroupInfo>,
#[prost(message, repeated, tag = "2")]
pub area_street_list: ::prost::alloc::vec::Vec<MapAreaStreetInfo>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GraphReferenceType {
@ -614,8 +608,7 @@ pub struct PlayerGetDataRsp {
#[prost(message, optional, tag = "2")]
pub player_data: ::core::option::Option<PlayerData>,
}
#[derive(::proto_derive::NetCmd)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(::proto_derive::NetCmd, Clone, PartialEq, ::prost::Message)]
pub struct NetCommand {
#[prost(uint32, tag = "1")]
pub cmd_id: u32,
@ -662,4 +655,4 @@ pub struct StopPlayerLogicReq {
pub struct StopPlayerLogicRsp {
#[prost(int32, tag = "1")]
pub retcode: i32,
}
}

View file

@ -71,3 +71,8 @@ CREATE TABLE t_gacha_data (
uid INT PRIMARY KEY NOT NULL,
data BYTEA NOT NULL
);
CREATE TABLE t_map_data (
uid INT PRIMARY KEY NOT NULL,
data BYTEA NOT NULL
);

View file

@ -135,7 +135,8 @@ impl DbConnection {
misc,
main_city,
scene,
gacha
gacha,
map
);
Ok(())

View file

@ -2,8 +2,8 @@ use std::collections::HashMap;
use vivian_proto::server_only::{
AbyssData, ArchiveData, AvatarData, BuddyData, GachaData, HollowData, ItemData, MainCityData,
MiscData, NewbieData, NewsStandData, PostGirlData, QuestData, SceneData, SwitchData,
UnlockData,
MapData, MiscData, NewbieData, NewsStandData, PostGirlData, QuestData, SceneData, SwitchData,
TeleportUnlockData, UnlockData,
};
pub trait ModelData {
@ -99,6 +99,7 @@ impl ModelData for MiscData {
newbie: Some(NewbieData::default()),
news_stand: Some(NewsStandData::default()),
post_girl: Some(PostGirlData::default()),
teleport: Some(TeleportUnlockData::default()),
}
}
}
@ -140,3 +141,14 @@ impl ModelData for GachaData {
}
}
}
impl ModelData for MapData {
const TABLE: &str = "t_map_data";
fn create_default(_uid: i32) -> Self {
MapData {
area_group_list: Vec::new(),
area_street_list: Vec::new(),
}
}
}

View file

@ -190,5 +190,6 @@ async fn fetch_player_data(
main_city: Some(db.fetch_model_data(uid).await?),
scene: Some(db.fetch_model_data(uid).await?),
gacha: Some(db.fetch_model_data(uid).await?),
map: Some(db.fetch_model_data(uid).await?),
})
}

View file

@ -32,11 +32,8 @@ pub async fn query_dispatch(
State(state): State<&'static SharedState>,
Query(param): Query<QueryDispatchParam>,
) -> Json<QueryDispatchRsp<'static>> {
debug!(
"query_dispatch - version: {}",
param.version,
);
let server_list : Vec<_> = state
debug!("query_dispatch - version: {}", param.version,);
let server_list: Vec<_> = state
.server_list
.servers
.iter()
@ -90,9 +87,7 @@ pub async fn query_gateway(
) -> Json<QueryGatewayRsp> {
debug!(
"query_dispatch - rsa_ver: {}, seed: {}, version: {}",
param.rsa_ver,
param.seed,
param.version,
param.rsa_ver, param.seed, param.version,
);
let Some(rsa_version) = state.config.rsa_versions.get(&param.rsa_ver) else {
error!("Unknown RSA version");

View file

@ -60,12 +60,7 @@ async fn main() -> Result<(), StartupError> {
state.server_list.servers.iter().for_each(|s| {
debug!(
"{}: {} ({}) with seed {} @ {}:{}",
s.sid,
s.name,
s.bind_version,
s.dispatch_seed,
s.gateway_ip,
s.gateway_port,
s.sid, s.name, s.bind_version, s.dispatch_seed, s.gateway_ip, s.gateway_port,
)
});

View file

@ -77,4 +77,4 @@ pub struct FirstLoginWeaponConfig {
pub level: u32,
pub star: u32,
pub refine_level: u32,
}
}

View file

@ -0,0 +1,75 @@
use vivian_codegen::handlers;
use vivian_proto::{
AreaGroupInfo, AreaMapData, AreaMapModStateCsReq, AreaMapModStateScRsp, AreaStreetInfo, GetAreaMapDataCsReq, GetAreaMapDataScRsp
};
use super::NetContext;
pub struct MapHandler;
#[handlers]
impl MapHandler {
pub fn on_get_area_map_data_cs_req(
context: &mut NetContext<'_>,
_request: GetAreaMapDataCsReq,
) -> GetAreaMapDataScRsp {
let mut sorted_groups: Vec<_> = context
.player
.map_model
.area_group_map
.iter()
.map(|(&group_id, group)| AreaGroupInfo {
group_id,
area_progress: group.area_progress,
is_unlocked: group.is_unlocked,
})
.collect();
sorted_groups.sort_by_key(|g| g.group_id);
let mut sorted_streets: Vec<_> = context
.player
.map_model
.area_street_map
.iter()
.map(|(&area_id, street)| AreaStreetInfo {
area_id,
area_progress: street.area_progress,
is_unlocked: street.is_unlocked,
location_pop_showed: street.location_pop_showed,
new_area_showed: street.new_area_showed,
})
.collect();
sorted_streets.sort_by_key(|s| s.area_id);
GetAreaMapDataScRsp {
retcode: 0,
data: Some(AreaMapData {
group: sorted_groups,
street: sorted_streets,
..Default::default()
})
}
}
pub fn on_area_map_mod_state_cs_req(
context: &mut NetContext<'_>,
request: AreaMapModStateCsReq,
) -> AreaMapModStateScRsp {
let Some(area) = context
.player
.map_model
.area_street_map
.get_mut(&request.area_id)
else {
return AreaMapModStateScRsp { retcode: 1 };
};
area.location_pop_showed |= request.location_pop_showed;
area.new_area_showed |= request.new_area_showed;
AreaMapModStateScRsp {
retcode: 0,
}
}
}

View file

@ -29,6 +29,7 @@ handlers! {
Training;
PhotoWall;
MonthReward;
Map;
}
#[derive(Default)]

View file

@ -12,14 +12,14 @@ use vivian_service::{
network::{NetworkEntityManager, NetworkServer, client::NetworkClient},
};
mod cluster;
mod config;
mod handlers;
mod player;
mod resources;
mod session;
mod util;
mod player;
mod sync;
mod cluster;
mod util;
const SERVICE_TYPE: ServiceType = ServiceType::Game;
const CONFIG_DIR: &str = "config/40-game-server/";

View file

@ -8,6 +8,7 @@ use config::{BoundConditions, Condition, EQuestState, GraphReference, HollowQues
use rand::RngCore;
use vivian_codegen::ModelManager;
use vivian_logic::{
GameState, LogicResources,
dungeon::{DungeonEquipment, EQuestType},
event::Event,
fight::GameFightState,
@ -16,16 +17,15 @@ use vivian_logic::{
listener::LogicEventListener,
long_fight::GameLongFightState,
scene::ELocalPlayType,
GameState, LogicResources,
};
use vivian_proto::{server_only::PlayerData, PlayerSyncScNotify};
use vivian_proto::{PlayerSyncScNotify, server_only::PlayerData};
use tracing::{error, info, warn};
use vivian_models::{property::GachaRandom, *};
use crate::{
resources::NapResources,
util::{avatar_util, basic_util, item_util, misc_util, quest_util},
util::{avatar_util, basic_util, item_util, map_util, misc_util, quest_util},
};
use super::sync::{DataSyncHelper, LoginDataSyncComponent, PlayerSyncComponent};
@ -70,6 +70,8 @@ pub struct Player {
pub scene_model: SceneModel,
#[model]
pub gacha_model: GachaModel,
#[model]
pub map_model: MapModel,
}
#[derive(Debug, Clone, Copy)]
@ -101,6 +103,7 @@ impl Player {
main_city_model: MainCityModel::load_from_pb(pb.main_city.unwrap()),
scene_model: SceneModel::load_from_pb(pb.scene.unwrap()),
gacha_model: GachaModel::load_from_pb(pb.gacha.unwrap()),
map_model: MapModel::load_from_pb(pb.map.unwrap()),
}
}
@ -134,6 +137,7 @@ impl Player {
item_util::add_items_on_first_login(self);
misc_util::init_misc_structs_on_first_login(self);
map_util::init_map_structs_on_first_login(self);
self.gacha_model.gacha_random = GachaRandom::new(rand::thread_rng().next_u32());
let mut main_city_quest_id = 10020001;

View file

@ -2,7 +2,7 @@ use std::sync::Arc;
use vivian_service::{CreatableServiceModule, ServiceModule};
use crate::cluster::{PlayerLogicClusterManager, PlayerLogicCluster};
use crate::cluster::{PlayerLogicCluster, PlayerLogicClusterManager};
use tokio::sync::{mpsc, oneshot};
use tracing::{error, info, warn};

View file

@ -86,11 +86,7 @@ impl LoginDataSyncComponent for AvatarModel {
}
impl LoginDataSyncComponent for QuestModel {
fn prepare_responses(
&self,
sync_helper: &mut DataSyncHelper,
_: &NapResources,
) {
fn prepare_responses(&self, sync_helper: &mut DataSyncHelper, _: &NapResources) {
sync_helper.add_response(
SyncType::BasicData,
vivian_proto::GetQuestDataScRsp {
@ -127,11 +123,7 @@ impl LoginDataSyncComponent for QuestModel {
}
impl LoginDataSyncComponent for ArchiveModel {
fn prepare_responses(
&self,
sync_helper: &mut DataSyncHelper,
_: &NapResources,
) {
fn prepare_responses(&self, sync_helper: &mut DataSyncHelper, _: &NapResources) {
sync_helper.add_response(
SyncType::BasicData,
vivian_proto::GetArchiveDataScRsp {
@ -157,11 +149,7 @@ impl LoginDataSyncComponent for ArchiveModel {
}
impl LoginDataSyncComponent for HollowModel {
fn prepare_responses(
&self,
sync_helper: &mut DataSyncHelper,
_res: &NapResources,
) {
fn prepare_responses(&self, sync_helper: &mut DataSyncHelper, _res: &NapResources) {
sync_helper.add_response(
SyncType::BasicData,
vivian_proto::GetHollowDataScRsp {
@ -187,11 +175,7 @@ impl LoginDataSyncComponent for HollowModel {
}
impl LoginDataSyncComponent for AbyssModel {
fn prepare_responses(
&self,
sync_helper: &mut DataSyncHelper,
_: &NapResources,
) {
fn prepare_responses(&self, sync_helper: &mut DataSyncHelper, _: &NapResources) {
sync_helper.add_response(
SyncType::BasicData,
vivian_proto::AbyssGetDataScRsp {
@ -210,11 +194,7 @@ impl LoginDataSyncComponent for AbyssModel {
}
impl LoginDataSyncComponent for BuddyModel {
fn prepare_responses(
&self,
sync_helper: &mut DataSyncHelper,
_res: &NapResources,
) {
fn prepare_responses(&self, sync_helper: &mut DataSyncHelper, _res: &NapResources) {
sync_helper.add_response(
SyncType::BasicData,
vivian_proto::GetBuddyDataScRsp {
@ -257,6 +237,9 @@ impl LoginDataSyncComponent for MiscModel {
})
.collect(),
}),
teleport: Some(vivian_proto::TeleportUnlockInfo {
unlocked_list: self.teleport.unlocked_id.iter().copied().collect(),
}),
news_stand: Some(self.news_stand.to_client_proto()),
post_girl: Some(vivian_proto::PostGirlInfo {
post_girl_item_list: self

View file

@ -63,4 +63,3 @@ impl DataSyncHelper {
.any(|&(ty, _)| ty == SyncType::BasicData)
}
}

View file

@ -1,5 +1,5 @@
use vivian_proto::*;
use vivian_models::*;
use vivian_proto::*;
use vivian_models::property::Property;
@ -183,7 +183,6 @@ impl PlayerSyncComponent for BuddyModel {
}
}
impl PlayerSyncComponent for MiscModel {
fn supports_player_sync(&self) -> bool {
true
@ -240,6 +239,14 @@ impl PlayerSyncComponent for GachaModel {
fn add_changes_to_player_sync_notify(&self, _: &mut vivian_proto::PlayerSyncScNotify) {}
}
impl PlayerSyncComponent for MapModel {
fn supports_player_sync(&self) -> bool {
false
}
fn add_changes_to_player_sync_notify(&self, _: &mut vivian_proto::PlayerSyncScNotify) {}
}
impl PlayerSyncComponent for MainCityModel {
fn supports_player_sync(&self) -> bool {
false

View file

@ -135,7 +135,10 @@ fn next_special_rare_item(
.up_item_state = true;
if model.gacha_random.rand(100_000) > 25_000 {
GachaModel::COMMON_AVATAR_ID[model.gacha_random.rand(GachaModel::COMMON_AVATAR_ID.len() as u32) as usize]
GachaModel::COMMON_AVATAR_ID[model
.gacha_random
.rand(GachaModel::COMMON_AVATAR_ID.len() as u32)
as usize]
} else {
let candidates = res
.templates

View file

@ -9,33 +9,41 @@ pub fn add_items_on_first_login(player: &mut Player) {
player.item_model.item_count_map.insert(501, 240);
// Unlock all skins by default for now
player.resources.templates
player
.resources
.templates
.avatar_skin_base_template_tb()
.for_each(|tmpl| player.item_model.item_count_map.insert(tmpl.id(), 1));
let weapon_cfg = &player.resources.gameplay.first_login.weapon;
if weapon_cfg.unlock_all {
player.resources.templates.weapon_template_tb().for_each(|tmpl| {
let uid = player.item_model.next_uid();
player.item_model.weapon_map.insert(
uid,
WeaponItem {
id: tmpl.item_id(),
level: weapon_cfg.level,
exp: 0,
star: weapon_cfg.star,
refine_level: weapon_cfg.refine_level,
lock: false,
},
);
});
player
.resources
.templates
.weapon_template_tb()
.for_each(|tmpl| {
let uid = player.item_model.next_uid();
player.item_model.weapon_map.insert(
uid,
WeaponItem {
id: tmpl.item_id(),
level: weapon_cfg.level,
exp: 0,
star: weapon_cfg.star,
refine_level: weapon_cfg.refine_level,
lock: false,
},
);
});
} else {
weapon_cfg
.unlock_id_list
.iter()
.filter_map(|id| {
player.resources.templates
player
.resources
.templates
.weapon_template_tb()
.find(|tmpl| tmpl.item_id() == *id)
})

View file

@ -0,0 +1,40 @@
use vivian_models::{AreaGroupInfo, AreaStreetInfo};
use crate::player::Player;
pub fn init_map_structs_on_first_login(player: &mut Player) {
// Unlock everything by default for now
let model = &mut player.map_model;
player
.resources
.templates
.urban_area_map_group_template_tb()
.for_each(|tmpl| {
model.area_group_map.insert(
tmpl.area_group_id(),
AreaGroupInfo {
is_unlocked: true.into(),
area_progress: ((rand::RngCore::next_u32(&mut rand::thread_rng()) % 100) * 100)
.into(),
},
);
});
player
.resources
.templates
.urban_area_map_template_tb()
.for_each(|tmpl| {
model.area_street_map.insert(
tmpl.area_id(),
AreaStreetInfo {
is_unlocked: true.into(),
area_progress: ((rand::RngCore::next_u32(&mut rand::thread_rng()) % 100) * 100)
.into(),
location_pop_showed: false.into(),
new_area_showed: false.into(),
},
);
});
}

View file

@ -29,4 +29,12 @@ pub fn init_misc_structs_on_first_login(player: &mut Player) {
model.news_stand.advertisement_id = PropertyHashSet::from_iter([9, 14]);
model.news_stand.head_lines_id = PropertyHashSet::from_iter([1000004, 2000001]);
model.news_stand.normal_news_id = PropertyHashSet::from_iter([37, 12, 7]);
player
.resources
.templates
.teleport_config_template_tb()
.for_each(|tmpl| {
model.teleport.unlocked_id.insert(tmpl.teleport_id());
});
}

View file

@ -1,6 +1,7 @@
pub mod avatar_util;
pub mod item_util;
pub mod gacha_util;
pub mod quest_util;
pub mod misc_util;
pub mod basic_util;
pub mod gacha_util;
pub mod item_util;
pub mod map_util;
pub mod misc_util;
pub mod quest_util;

View file

@ -69,7 +69,9 @@ fn add_hollow_challenges(player: &mut Player, hollow_quest_id: u32) {
.quest_model
.get_or_insert_collection(EQuestType::HollowChallenge);
player.resources.templates
player
.resources
.templates
.hollow_challenge_template_tb()
.filter(|c| c.hollow_quest_id() == hollow_quest_id)
.for_each(|c| {
@ -89,7 +91,8 @@ fn add_hollow_challenges(player: &mut Player, hollow_quest_id: u32) {
}
pub fn add_main_city_quest(player: &mut Player, id: u32) {
let main_city_quest_template = player.resources
let main_city_quest_template = player
.resources
.templates
.main_city_quest_template_tb()
.find(|tmpl| tmpl.id() == id)
@ -151,7 +154,8 @@ pub fn finish_main_city_quest(player: &mut Player, id: u32) -> Vec<u32> {
collection.finished_quests.insert(id);
let mut newly_added_quests = Vec::new();
for next_quest_template in player.resources
for next_quest_template in player
.resources
.templates
.quest_config_template_tb()
.filter(|quest| {
@ -170,7 +174,8 @@ pub fn finish_main_city_quest(player: &mut Player, id: u32) -> Vec<u32> {
add_main_city_quest(player, next_quest_template.quest_id());
}
let main_city_quest_template = player.resources
let main_city_quest_template = player
.resources
.templates
.main_city_quest_template_tb()
.find(|tmpl| tmpl.id() == id)

View file

@ -117,7 +117,11 @@ pub fn bytes_as_hex(bytes: &[u8]) -> String {
}
async fn handle_cmd(scope: &ServiceScope, packet: NetPacket) -> Result<(), GetProtoError> {
debug!("handle_cmd - cmd_id: {}, size: {}", packet.cmd_id, packet.body.len());
debug!(
"handle_cmd - cmd_id: {}, size: {}",
packet.cmd_id,
packet.body.len()
);
match packet.cmd_id {
PlayerGetTokenCsReq::CMD_ID => {
handle_player_get_token(scope, packet.head, packet.get_proto()?).await
@ -148,7 +152,7 @@ async fn handle_cmd(scope: &ServiceScope, packet: NetPacket) -> Result<(), GetPr
_ => {
warn!("unhandled: {}", packet.cmd_id);
debug!("{}", bytes_as_hex(packet.body.as_slice()));
},
}
}
Ok(())