Ejemplo n.º 1
0
        public static bool GetCurrentWaymarksAsPresetData(ref byte[] presetData)
        {
            if (mPluginInterface != null && true /*TODO: found the right sigs*/)
            {
                byte currentContentLinkType = mdGetCurrentContentFinderLinkType.Invoke();
                if (currentContentLinkType > 0 && currentContentLinkType < 4)
                {
                    byte[] rawWaymarkData = new byte[104];
                    unsafe
                    {
                        fixed(byte *pRawWaymarkData = rawWaymarkData)
                        {
                            mdGetCurrentWaymarkData.Invoke(mpWaymarksObj, new IntPtr(pRawWaymarkData));
                        }
                    }

                    presetData = ConvertWaymarkObjDataToSavedPresetFormat(rawWaymarkData);

                    UInt16 currentZone      = ZoneInfoHandler.GetContentFinderIDFromTerritoryTypeID(mPluginInterface.ClientState.TerritoryType);
                    UInt32 currentTimestamp = (UInt32)DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                    Array.Copy(BitConverter.GetBytes(currentZone), 0, presetData, 98, 2);
                    Array.Copy(BitConverter.GetBytes(currentTimestamp), 0, presetData, 100, 4);
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static bool GetCurrentWaymarksAsPresetData(ref GamePreset rPresetData)
        {
            if (mPluginInterface != null && FoundDirectSaveSigs())
            {
                byte currentContentLinkType = mdGetCurrentContentFinderLinkType.Invoke();
                if (currentContentLinkType >= 0 && currentContentLinkType < 4)                  //	Same as the game check, but let it do overworld maps too.
                {
                    GamePreset_Placement rawWaymarkData = new GamePreset_Placement();
                    unsafe
                    {
                        mdGetCurrentWaymarkData.Invoke(mpWaymarksObj, new IntPtr(&rawWaymarkData));
                    }

                    rPresetData = new GamePreset(rawWaymarkData);
                    rPresetData.ContentFinderConditionID = ZoneInfoHandler.GetContentFinderIDFromTerritoryTypeID(mPluginInterface.ClientState.TerritoryType);                           //*****TODO: How do we get this as a territory type for non-instanced zones? The return type might need to be changed, or pass in another ref paramter or something. *****
                    rPresetData.UnixTime = (Int32)DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                    return(true);
                }
            }

            return(false);
        }