class GetCmsMissionsRequest(SerializableMessage):
    def __init__(self):
        self.quest_type_id: ObjectID = None
        self.hierarchies: list[str] = None
        self.return_locked: bool = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.quest_type_id = ObjectID()
        self.quest_type_id.deserialize(bit_stream)
        self.hierarchies = []
        for _ in range(bit_stream.read_int()):
            self.hierarchies.append(bit_stream.read_str())
        self.return_locked = bit_stream.read_bool()

    def to_dict(self):
        return {
            'quest_type_id': self.quest_type_id.to_dict(),
            'hierarchies': self.hierarchies,
            'return_locked': self.return_locked,
        }
Beispiel #2
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.uid = ObjectID()
     self.uid.deserialize(bit_stream)
     self.token = bit_stream.read_str()
     self.max_vis_size = bit_stream.read_int()
Beispiel #3
0
 def serialize(self, bit_stream: BitStream):
     bit_stream.write_start()
     self.id = ObjectID()
     self.id.serialize(bit_stream)
     self.parent_id = ObjectID()
     self.parent_id.serialize(bit_stream)
     bit_stream.write_int(len(self.components))
     for item in self.components:
         bit_stream.write_str(item)
     bit_stream.write_int(len(self.parent_components))
     for item in self.parent_components:
         bit_stream.write_str(item)
     bit_stream.write_dt(self.create_time)
     bit_stream.write_dt(self.modified_time)
     bit_stream.write_int(len(self.properties))
     for key in self.properties:
         bit_stream.write_str(key)
         bit_stream.write_int(len(self.properties[key]))
         for item in self.properties[key]:
             bit_stream.write_str(item)
     bit_stream.write_int(len(self.children_group))
     for key in self.children_group:
         bit_stream.write_str(key)
         bit_stream.write_int(len(self.children_group[key]))
         for item in self.children_group[key]:
             bit_stream.write_int(len(item))
             for list_item in item:
                 list_item.serialize(bit_stream)
Beispiel #4
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.player_avatar_id = ObjectID()
     self.player_avatar_id.deserialize(bit_stream)
     self.player_id = ObjectID()
     self.player_id.deserialize(bit_stream)
class GetInventoryObjectsRequest(SerializableMessage):
    def __init__(self):
        self.container_id: ObjectID = None
        self.item_category_ids: list[ObjectID] = None
        self.player_item_ids: list[ObjectID] = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.container_id = ObjectID()
        self.container_id.deserialize(bit_stream)
        self.item_category_ids = []
        for _ in range(bit_stream.read_int()):
            item = ObjectID()
            item.deserialize(bit_stream)
            self.item_category_ids.append(item)
        self.player_item_ids = []
        for _ in range(bit_stream.read_int()):
            item = ObjectID()
            item.deserialize(bit_stream)
            self.player_item_ids.append(item)

    def to_dict(self):
        return {
            'container_id':
            self.container_id.to_dict(),
            'item_category_ids':
            [item.to_dict() for item in self.item_category_ids],
            'player_item_ids':
            [item.to_dict() for item in self.player_item_ids],
        }
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.player_id = ObjectID()
     self.player_id.deserialize(bit_stream)
     self.is_host = bit_stream.read_bool()
     self.is_status_pending = bit_stream.read_bool()
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.quest_type_id = ObjectID()
     self.quest_type_id.deserialize(bit_stream)
     self.hierarchies = []
     for _ in range(bit_stream.read_int()):
         self.hierarchies.append(bit_stream.read_str())
     self.return_locked = bit_stream.read_bool()
Beispiel #8
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.start = bit_stream.read_int()
     self.max = bit_stream.read_int()
     self.filter_ids = []
     for _ in range(bit_stream.read_int()):
         item = ObjectID()
         item.deserialize(bit_stream)
         self.filter_ids.append(item)
Beispiel #9
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.loc_id = ObjectID()
     self.loc_id.deserialize(bit_stream)
     self.building_id = ObjectID()
     self.building_id.deserialize(bit_stream)
     self.pos = Position()
     self.pos.deserialize(bit_stream)
     self.orientation = Orientation()
     self.orientation.deserialize(bit_stream)
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.player_ids = []
     for _ in range(bit_stream.read_int()):
         item = ObjectID()
         item.deserialize(bit_stream)
         self.player_ids.append(item)
     self.is_invite_or_accept = bit_stream.read_bool()
     self.is_host = bit_stream.read_bool()
     self.permanent = bit_stream.read_bool()
Beispiel #11
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.type_value = bit_stream.read_int()
     self.lang_locale_pair_id = ObjectID()
     self.lang_locale_pair_id.deserialize(bit_stream)
     self.tier_id = ObjectID()
     self.tier_id.deserialize(bit_stream)
     self.birth_date = bit_stream.read_dt()
     self.registration_date = bit_stream.read_dt()
     self.preview_date = bit_stream.read_dt()
     self.is_preview_enabled = bit_stream.read_bool()
Beispiel #12
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.login_id = bit_stream.read_str()
     self.password = bit_stream.read_str()
     self.site_pin = bit_stream.read_int()
     self.language_local_pair_id = ObjectID()
     self.language_local_pair_id.deserialize(bit_stream)
     self.user_queueing_token = bit_stream.read_str()
     self.client_environment = ClientEnvironment()
     self.client_environment.deserialize(bit_stream)
     self.token = bit_stream.read_str()
     self.login_type = bit_stream.read_int()
     self.cnl = bit_stream.read_str()
Beispiel #13
0
class RegisterPlayerRequest(SerializableMessage):
    def __init__(self):
        self.token: str = None
        self.password: str = None
        self.parent_email_address: str = None
        self.birth_date: dt.datetime = None
        self.gender: str = None
        self.location_id: ObjectID = None
        self.username: str = None
        self.worldname: str = None
        self.chat_allowed: bool = None
        self.cnl: str = None
        self.referred_by_worldname: str = None
        self.login_type: int = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.token = bit_stream.read_str()
        self.password = bit_stream.read_str()
        self.parent_email_address = bit_stream.read_str()
        self.birth_date = bit_stream.read_dt()
        self.gender = bit_stream.read_str()
        self.location_id = ObjectID()
        self.location_id.deserialize(bit_stream)
        self.username = bit_stream.read_str()
        self.worldname = bit_stream.read_str()
        self.chat_allowed = bit_stream.read_bool()
        self.cnl = bit_stream.read_str()
        self.referred_by_worldname = bit_stream.read_str()
        self.login_type = bit_stream.read_int()

    def to_dict(self):
        return {
            'token': self.token,
            'password': self.password,
            'parent_email_address': self.parent_email_address,
            'birth_date': self.birth_date,
            'gender': self.gender,
            'location_id': self.location_id.to_dict(),
            'username': self.username,
            'worldname': self.worldname,
            'chat_allowed': self.chat_allowed,
            'cnl': self.cnl,
            'referred_by_worldname': self.referred_by_worldname,
            'login_type': self.login_type,
        }
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.container_id = ObjectID()
     self.container_id.deserialize(bit_stream)
     self.item_category_ids = []
     for _ in range(bit_stream.read_int()):
         item = ObjectID()
         item.deserialize(bit_stream)
         self.item_category_ids.append(item)
     self.player_item_ids = []
     for _ in range(bit_stream.read_int()):
         item = ObjectID()
         item.deserialize(bit_stream)
         self.player_item_ids.append(item)
Beispiel #15
0
class GetNpcRelationshipsRequest(SerializableMessage):
    def __init__(self):
        self.zone_id: ObjectID = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.zone_id = ObjectID()
        self.zone_id.deserialize(bit_stream)

    def to_dict(self):
        return {'zone_id': self.zone_id.to_dict()}
Beispiel #16
0
 def deserialize(self, bit_stream: BitStream):
     if not bit_stream.read_start():
         return
     self.token = bit_stream.read_str()
     self.password = bit_stream.read_str()
     self.parent_email_address = bit_stream.read_str()
     self.birth_date = bit_stream.read_dt()
     self.gender = bit_stream.read_str()
     self.location_id = ObjectID()
     self.location_id.deserialize(bit_stream)
     self.username = bit_stream.read_str()
     self.worldname = bit_stream.read_str()
     self.chat_allowed = bit_stream.read_bool()
     self.cnl = bit_stream.read_str()
     self.referred_by_worldname = bit_stream.read_str()
     self.login_type = bit_stream.read_int()
Beispiel #17
0
    async def process(self, message_header: MessageHeader):
        message_header.result_code = ResultCode.OK
        message_header.app_code = AppCode.OK

        # HardCodedZoneId: LoadNPCsCommand.cs -> SpawnPoints.Instance.ParseZone(NPCManager.HardCodedZoneId)
        hardcoded_zone_id = ObjectID(4, 16, 0, 2937912)

        rule_property = RuleProperty(ObjectID(0, 0, 0, 0), ObjectID(
            0, 0, 0, 0), [], [], None, None, {}, {})

        dimensions = Dimensions(1, 1, 1, 1, 1, 1)

        npc_zone = Zone(hardcoded_zone_id, {}, [], rule_property, False,
                        False, True, False, dimensions, [], 'ptag', 28)

        self.response.zones = [npc_zone]
Beispiel #18
0
class LoginRequest(SerializableMessage):
    def __init__(self):
        self.login_id: str = None
        self.password: str = None
        self.site_pin: int = None
        self.language_local_pair_id: ObjectID = None
        self.user_queueing_token: str = None
        self.client_environment: ClientEnvironment = None
        self.token: str = None
        self.login_type: int = None
        self.cnl: str = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.login_id = bit_stream.read_str()
        self.password = bit_stream.read_str()
        self.site_pin = bit_stream.read_int()
        self.language_local_pair_id = ObjectID()
        self.language_local_pair_id.deserialize(bit_stream)
        self.user_queueing_token = bit_stream.read_str()
        self.client_environment = ClientEnvironment()
        self.client_environment.deserialize(bit_stream)
        self.token = bit_stream.read_str()
        self.login_type = bit_stream.read_int()
        self.cnl = bit_stream.read_str()

    def to_dict(self):
        return {
            'login_id': self.login_id,
            'password': self.password,
            'site_pin': self.site_pin,
            'language_local_pair_id': self.language_local_pair_id.to_dict(),
            'user_queueing_token': self.user_queueing_token,
            'client_environment': self.client_environment.to_dict(),
            'token': self.token,
            'login_type': self.login_type,
            'cnl': self.cnl,
        }
Beispiel #19
0
class EnterBuildingRequest(SerializableMessage):
    def __init__(self):
        self.loc_id: ObjectID = None
        self.building_id: ObjectID = None
        self.pos: Position = None
        self.orientation: Orientation = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.loc_id = ObjectID()
        self.loc_id.deserialize(bit_stream)
        self.building_id = ObjectID()
        self.building_id.deserialize(bit_stream)
        self.pos = Position()
        self.pos.deserialize(bit_stream)
        self.orientation = Orientation()
        self.orientation.deserialize(bit_stream)

    def to_dict(self):
        return {
            'loc_id':
            self.loc_id.to_dict() if self.loc_id else None,
            'building_id':
            self.building_id.to_dict() if self.building_id else None,
            'pos':
            self.pos.to_dict() if self.pos else None,
            'orientation':
            self.orientation.to_dict() if self.orientation else None,
        }
Beispiel #20
0
    async def process(self, message_header: MessageHeader):
        message_header.result_code = ResultCode.OK
        message_header.app_code = AppCode.OK

        self.response.site_frame = SiteFrame(
            aw_object_id=ObjectID(0, 0, 0, 0),
            asset_map={
                # this is used to load hardcoded assets (instead of using Resources.Load())
                'Amazing_Core': [
                    # LoadLoginScene.cs -> LoadAvatar -> DownloadManager.LoadAsset("Player_Base.unity3d")
                    Asset(ObjectID(0, 0, 0, 0), 'asset_type',
                          'assets/OTU2NTAzNTgyMzExOA', 'Player_Base.unity3d',
                          'asset_group', 565066),
                    # OutdoorMazeLoader.cs -> LoadSharedPrefabsCommand -> DownloadManager.LoadAsset("PlayerCamera.unity3d")
                    Asset(ObjectID(0, 0, 0, 0), 'asset_type',
                          'assets/OTQyNDc5ODIyMDMwMg', 'PlayerCamera.unity3d',
                          'asset_group', 1878),
                    # ClientManager.cs -> LoadPreloadAssetsCommand -> DownloadManager.LoadAsset("ShadersList.unity3d")
                    Asset(ObjectID(0, 0, 0, 0), 'asset_type',
                          'assets/OTYyNDQwNDA5OTA4Ng', 'ShadersList.unity3d',
                          'asset_group', 91142),
                ],

                # LoadLoginScene.cs -> AvatarLoadedHandler() -> LoadSlotIds()
                # DressAvatarManager.cs -> LoadSlotIds -> ClientManager.Instance.configList
                'Config_Text': [],

                # preload objects are downloaded to the Cached folder ClientManager.cs -> LoadPreloadedAssets()
                # also used to pass AWLoadingScreen: OutdoorMazeLoader.cs -> LoadPreloadAssetsCommand() -> preloadList
                'Preload_PrefabUnity3D': [],

                # also used to pass AWLoadingScreen: OutdoorMazeLoader.cs -> LoadPreloadAssetsCommand() -> audioClipList
                'Audio': [],
            },
            asset_packages=[],
            type_value=1)

        self.response.asset_delivery_url = 'http://localhost:8080/'  # + asset.cdn_id
class GetHomeInvitationsRequest(SerializableMessage):
    def __init__(self):
        self.player_id: ObjectID = None
        self.is_host: bool = None
        self.is_status_pending: bool = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.player_id = ObjectID()
        self.player_id.deserialize(bit_stream)
        self.is_host = bit_stream.read_bool()
        self.is_status_pending = bit_stream.read_bool()

    def to_dict(self):
        return {
            'player_id': self.player_id.to_dict(),
            'is_host': self.is_host,
            'is_status_pending': self.is_status_pending,
        }
Beispiel #22
0
    async def process(self, message_header: MessageHeader):
        message_header.result_code = ResultCode.OK
        message_header.app_code = AppCode.OK

        object_id = ObjectID(0, 0, 0, 0)

        avatar = Avatar(
            aw_object_id=object_id,
            asset_map={
                "Prefab_Unity3D": [
                    Asset(ObjectID(0, 0, 0, 0), 'asset_type', 'assets/Player_Avatar.unity3d',
                          'Player_Avatar.unity3d', 'asset_group', 59109),  # !(item.resName == "PF__Avatar.unity3d")
                ],
            },
            asset_packages=[],
            dimensions='1',
            weight=1,
            height=1,
            max_outfits=1,
            name='avatar_name')

        # activePlayerAvatar should be in AvatarManager.Instance.GSFPlayerAvatars: LoadAvatarsCommand.cs -> Step2()
        self.response.avatars = [
            PlayerAvatar(
                aw_object_id=object_id,
                avatar=avatar,
                player_id=object_id,
                name='player_name',
                bio='player_bio',
                secret_code='1234',
                create_ts=dt.datetime.now(),
                player_avatar_outfit_id=object_id,
                outfit_no=10,
                play_time=11,
                last_play=dt.datetime.now())
        ]
Beispiel #23
0
class SyncLoginRequest(SerializableMessage):

    def __init__(self):
        self.uid: ObjectID = None
        self.token: str = None
        self.max_vis_size: int = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.uid = ObjectID()
        self.uid.deserialize(bit_stream)
        self.token = bit_stream.read_str()
        self.max_vis_size = bit_stream.read_int()

    def to_dict(self):
        return {
            'uid': self.uid.to_dict(),
            'token': self.token,
            'max_vis_size': self.max_vis_size,
        }
    async def process(self, message_header: MessageHeader):
        message_header.result_code = ResultCode.OK
        message_header.app_code = AppCode.OK

        self.response.invalid_code_count = 0
        self.response.invalid_code_threshold = 0

        object_id = ObjectID(1, 2, 3, 4)

        asset = Asset(
            aw_object_id=object_id,
            asset_type_name='asset_type_name',
            cdn_id='cdn_id',
            res_name='res_name',
            group_name='group_name',
            file_size=1024)

        apc = AssetPackage(
            p_tag='p_tag', create_date=dt.datetime.now())
        apc.container_aw_object_id = object_id
        apc.container_asset_map = {}
        apc.container_asset_pkg = []

        avatar = Avatar(
            aw_object_id=object_id,
            asset_map={'asset_map_key': [asset]},
            asset_packages=[apc],
            dimensions='6',
            weight=7,
            height=8,
            max_outfits=9,
            name='avatar_name')

        self.response.player_avatar = PlayerAvatar(
            aw_object_id=object_id,
            avatar=avatar,
            player_id=object_id,
            name='player_name',
            bio='player_bio',
            secret_code='1234',
            create_ts=dt.datetime.now(),
            player_avatar_outfit_id=object_id,
            outfit_no=10,
            play_time=11,
            last_play=dt.datetime.now())
Beispiel #25
0
    async def process(self, message_header: MessageHeader):
        message_header.result_code = ResultCode.OK
        message_header.app_code = AppCode.OK

        self.response.sync_server_token = '1234'
        self.response.sync_server_ip = 'localhost'
        self.response.sync_server_port = 8182

        object_id = ObjectID(0, 0, 0, 0)

        home_theme = HomeTheme(object_id, {
            # LoadMazeCommand.cs -> LoadMainScene() -> AssetDownloadManager.cs -> LoadMainScene()
            'Scene_Unity3D': [Asset(object_id, 'asset_type', 'non_existing_cdn_id', 'HomeLotSmall.unity3d', 'Main_Scene', 0)]
            # 'Scene_Unity3D': [Asset(object_id, 'asset_type', 'non_existing_cdn_id', 'Springtime003.unity3d', 'Main_Scene', 0)]
        }, [])

        player_maze = PlayerMaze(
            object_id, 'coremaze', 42, None, dt.datetime.now(
            ), 1, 1, 1, False, True, True, False, object_id, [], home_theme, object_id, object_id
        )

        self.response.home = PlayerHome(
            player_maze, 'kek', True, dt.datetime.now(), home_theme, object_id, [player_maze])
class RegisterAvatarForRegistrationRequest(SerializableMessage):
    def __init__(self):
        self.player_id: ObjectID = None
        self.secret_code: str = None
        self.name: str = None
        self.bio: str = None
        self.avatar_id: ObjectID = None
        self.given_inventory_ids: list[ObjectID] = None
        self.given_item_slot_ids: list[ObjectID] = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.player_id = ObjectID()
        self.player_id.deserialize(bit_stream)
        self.secret_code = bit_stream.read_str()
        self.name = bit_stream.read_str()
        self.bio = bit_stream.read_str()
        self.avatar_id = ObjectID()
        self.avatar_id.deserialize(bit_stream)
        self.given_inventory_ids = []
        for _ in range(bit_stream.read_int()):
            object_id = ObjectID()
            object_id.deserialize(bit_stream)
            self.given_inventory_ids.append(object_id)
        self.given_item_slot_ids = []
        for _ in range(bit_stream.read_int()):
            object_id = ObjectID()
            object_id.deserialize(bit_stream)
            self.given_item_slot_ids.append(object_id)

    def to_dict(self):
        return {
            'player_id': self.player_id.to_dict(),
            'secret_code': self.secret_code,
            'name': self.name,
            'bio': self.bio,
            'avatar_id': self.avatar_id.to_dict(),
            'given_inventory_ids': [item.to_dict() for item in self.given_inventory_ids],
            'given_item_slot_ids': [item.to_dict() for item in self.given_item_slot_ids],
        }
Beispiel #27
0
class GetOutfitsRequest(SerializableMessage):
    def __init__(self):
        self.player_avatar_id: ObjectID = None
        self.player_id: ObjectID = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.player_avatar_id = ObjectID()
        self.player_avatar_id.deserialize(bit_stream)
        self.player_id = ObjectID()
        self.player_id.deserialize(bit_stream)

    def to_dict(self):
        return {
            'player_avatar_id': self.player_avatar_id.to_dict(),
            'player_id': self.player_id.to_dict(),
        }
Beispiel #28
0
class GetSiteFrameRequest(SerializableMessage):
    def __init__(self):
        self.type_value: int = None
        self.lang_locale_pair_id: ObjectID = None
        self.tier_id: ObjectID = None
        self.birth_date: dt.datetime = None
        self.registration_date: dt.datetime = None
        self.preview_date: dt.datetime = None
        self.is_preview_enabled: bool = None

    def serialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def deserialize(self, bit_stream: BitStream):
        if not bit_stream.read_start():
            return
        self.type_value = bit_stream.read_int()
        self.lang_locale_pair_id = ObjectID()
        self.lang_locale_pair_id.deserialize(bit_stream)
        self.tier_id = ObjectID()
        self.tier_id.deserialize(bit_stream)
        self.birth_date = bit_stream.read_dt()
        self.registration_date = bit_stream.read_dt()
        self.preview_date = bit_stream.read_dt()
        self.is_preview_enabled = bit_stream.read_bool()

    def to_dict(self):
        return {
            'type_value': self.type_value,
            'lang_locale_pair_id': self.lang_locale_pair_id.to_dict(),
            'tier_id': self.tier_id.to_dict(),
            'birth_date': self.birth_date,
            'registration_date': self.registration_date,
            'preview_date': self.preview_date,
            'is_preview_enabled': self.is_preview_enabled,
        }
Beispiel #29
0
    async def process(self, message_header: MessageHeader):
        message_header.result_code = ResultCode.OK
        message_header.app_code = AppCode.OK

        object_id = ObjectID(0, 0, 0, 0)

        self.response.site_info = SiteInfo(
            site_id=object_id,
            nickname_first='nickname_first',
            nickname_last='nickname_last',
            site_user_id=object_id)

        self.response.session_status = SessionStatus.IN_PROGRESS
        self.response.session_id = object_id
        self.response.conversation_id = 5
        self.response.asset_delivery_url = 'http://localhost:8080/'

        avatar = Avatar(
            aw_object_id=object_id,
            asset_map={
                "Prefab_Unity3D": [
                    Asset(ObjectID(0, 0, 0, 0), 'asset_type', 'assets/Player_Avatar.unity3d',
                          'Player_Avatar.unity3d', 'asset_group', 59109),  # !(item.resName == "PF__Avatar.unity3d")
                ],
            },
            asset_packages=[],
            dimensions='1',
            weight=1,
            height=1,
            max_outfits=1,
            name='avatar_name')

        player_avatar = PlayerAvatar(
            aw_object_id=object_id,
            avatar=avatar,
            player_id=object_id,
            name='AMAZING_CORE',
            bio='player_bio',
            secret_code='1234',
            create_ts=dt.datetime.now(),
            player_avatar_outfit_id=object_id,
            outfit_no=10,
            play_time=11,
            last_play=dt.datetime.now())

        race_mode = RaceMode(aw_object_id=object_id, name='race_name')

        self.response.player = Player(
            aw_object_id=object_id,
            create_date=dt.datetime.now(),
            active_player_avatar=player_avatar,
            home_theme_id=object_id,
            current_race_mode=race_mode,
            workshop_options='workshop_options',
            is_tutorial_completed=False,
            yard_building_id=object_id,
            last_login=dt.datetime.now(),
            play_time=12,
            is_qa=True,
            home_village_plot_id=object_id,
            store_village_plot_id=object_id,
            player_store_id=object_id,
            player_maze_id=object_id,
            village_id=object_id)

        self.response.max_outfit = 13
        self.response.player_stats = []

        crisp_data = CrispData(
            crisp_action_id=object_id,
            crisp_message='crisp_message',
            crisp_expiry_date=dt.datetime.now() + dt.timedelta(days=1),
            crisp_confirmed=True)

        # player_setting_1 = PlayerSetting(
        #     aw_object_id=object_id,
        #     player_id=object_id,
        #     setting_name='setting_name',
        #     value='value')

        self.response.player_info = PlayerInfo(
            tier_id=object_id,
            player_name='omnio',
            world_name='2021',
            crisp_data=crisp_data,
            verified=True,
            verification_expiry=dt.datetime.now() + dt.timedelta(days=1),
            scs_block_expiry=dt.datetime.now() + dt.timedelta(days=1),
            eula_id=object_id,
            current_eula_id=object_id,
            u_13=True,
            chat_blocked_parent=False,
            chat_allowed=True,
            chat_blocked_expiry=dt.datetime.now() + dt.timedelta(days=1),
            findable=True,
            findable_date=dt.datetime.now() + dt.timedelta(days=1),
            user_subscription_expiry_date=dt.datetime.now() + dt.timedelta(days=1),
            qa=True,
            player_settings=[])

        self.response.current_server_time = dt.datetime.now()
        self.response.system_lockout_time = dt.datetime.now() + dt.timedelta(days=1)
        self.response.system_shutdown_time = dt.datetime.now() + dt.timedelta(days=1)
        self.response.client_inactivity_timeout = 365
        self.response.cnl = 'cnl'
Beispiel #30
0
class RuleProperty(SerializableMessage):
    def __init__(self,
                 id: ObjectID = None,
                 parent_id: ObjectID = None,
                 components: list[str] = None,
                 parent_components: list[str] = None,
                 create_time: dt.datetime = None,
                 modified_time: dt.datetime = None,
                 properties: dict[str, str] = None,
                 children_group: dict[str,
                                      list] = None):  # list of RuleProperty
        self.id = id
        self.parent_id = parent_id
        self.components = components
        self.parent_components = parent_components
        self.create_time = create_time
        self.modified_time = modified_time
        self.properties = properties
        self.children_group = children_group

    def serialize(self, bit_stream: BitStream):
        bit_stream.write_start()
        self.id = ObjectID()
        self.id.serialize(bit_stream)
        self.parent_id = ObjectID()
        self.parent_id.serialize(bit_stream)
        bit_stream.write_int(len(self.components))
        for item in self.components:
            bit_stream.write_str(item)
        bit_stream.write_int(len(self.parent_components))
        for item in self.parent_components:
            bit_stream.write_str(item)
        bit_stream.write_dt(self.create_time)
        bit_stream.write_dt(self.modified_time)
        bit_stream.write_int(len(self.properties))
        for key in self.properties:
            bit_stream.write_str(key)
            bit_stream.write_int(len(self.properties[key]))
            for item in self.properties[key]:
                bit_stream.write_str(item)
        bit_stream.write_int(len(self.children_group))
        for key in self.children_group:
            bit_stream.write_str(key)
            bit_stream.write_int(len(self.children_group[key]))
            for item in self.children_group[key]:
                bit_stream.write_int(len(item))
                for list_item in item:
                    list_item.serialize(bit_stream)

    def deserialize(self, bit_stream: BitStream):
        raise NotImplementedError

    def to_dict(self):
        children_group_dict = {}
        for key in self.children_group:
            for item in self.children_group[key]:
                children_group_dict[key] = item.to_dict()

        return {
            'id': self.id.to_dict(),
            'parent_id': self.parent_id.to_dict(),
            'components': [i.to_dict() for i in self.components],
            'parent_components': [i.to_dict() for i in self.parent_components],
            'create_time': self.create_time,
            'modified_time': self.modified_time,
            'properties': self.properties,
            'children_group_dict': children_group_dict,
        }