Example #1
0
        static void ReadMOPT(BinaryReader br, WMORoot wmo)
        {
            wmo.PortalInformation = new PortalInformation[wmo.Header.PortalCount];

            for (var i = 0; i < wmo.Header.PortalCount; i++)
            {
                var p = new PortalInformation
                {
                    Vertices = new VertexSpan
                    {
                        StartVertex = br.ReadInt16(),
                        VertexCount = br.ReadInt16(),
                    },
                    Plane = br.ReadPlane()
                };
                wmo.PortalInformation[i] = p;
            }
        }
Example #2
0
        public static void ZNet_LoadWorld_Postfix(ref ZNet __instance, ref ZDOMan ___m_zdoMan)
        {
            if (Game.instance == null)
            {
                LogManager.Instance.Log(BepInEx.Logging.LogLevel.Error, $"[LoadWorld] Game.instance == null");
                return;
            }
            if (Game.instance.m_portalPrefab == null)
            {
                LogManager.Instance.Log(BepInEx.Logging.LogLevel.Error, $"[LoadWorld] Game.instance.m_portalPrefab == null");
                return;
            }
            if (___m_zdoMan == null)
            {
                LogManager.Instance.Log(BepInEx.Logging.LogLevel.Error, $"[LoadWorld] this.m_zdoMan == null");
                return;
            }
            GameObject portalPrefab         = Game.instance.m_portalPrefab;
            int        portalPrefabHashcode = portalPrefab.name.GetStableHashCode();

            PortalInformation?.Invoke(null, new PortalInformationEventArgs(portalPrefab, portalPrefabHashcode));
        }
 public override void Deserialize(IDataReader reader)
 {
     base.Deserialize(reader);
     m_portal = ProtocolTypeManager.GetInstance <PortalInformation>((short)reader.ReadUShort());
     m_portal.Deserialize(reader);
 }
 public GameRolePlayPortalInformations(PortalInformation portal)
 {
     m_portal = portal;
 }