[Request] Convert GUID to packed GUID [LUA] menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    R4zyel's Avatar Active Member
    Reputation
    26
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    12/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Request] Convert GUID to packed GUID [LUA]

    Hello, i'm seeking for a working function to convert 128bit string GUID into packed GUID as it sends client to server in movement packets

    Let's see this example:
    Raw GUID = 94 F3 57 07 00 00 00 00 00 00 00 00 00 88 15 08
    PackGUID = 0F E0 94 F3 57 07 88 15 08

    I need it in LUA, but still if you have it in other language i might try to understand it.


    Thanks a lot, i think this is the proper section. <3

    [Request] Convert GUID to packed GUID [LUA]
  2. #2
    culino3's Avatar Member
    Reputation
    1
    Join Date
    Dec 2014
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    0F = low guid bitmask
    E0 = high guid bitmask

    so compress the low guid and then the high guid, it's the same as for 64 bit guids.

    Code:
    procedure TPacket.PutCompressed(const Value: TWoWGuid);
    var
      MaskPos: Integer;
      i: Byte;
    begin
      MaskPos := WritePos;
      Inc(FWritePos, 2); // add space for 2 masks
    
      for i := 0 to SizeOf(Value.Low) - 1 do
      begin
        if (Int64Rec(Value.Low).Bytes[i] > 0) then
        begin
          FBuffer[MaskPos] := FBuffer[MaskPos] or 1 shl i; // low mask
          PutUInt8(Int64Rec(Value.Low).Bytes[i]);
        end;
      end;
    
      for i := 0 to SizeOf(Value.High) - 1 do
      begin
        if (Int64Rec(Value.High).Bytes[i] > 0) then
        begin
          FBuffer[MaskPos+1] := FBuffer[MaskPos+1] or 1 shl i; // high mask
          PutUInt8(Int64Rec(Value.High).Bytes[i]);
        end;
      end;
    end;
    Last edited by culino3; 12-09-2014 at 10:40 PM.

  3. #3
    R4zyel's Avatar Active Member
    Reputation
    26
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    12/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh in Delphi
    I love you Cencil.

    THanks.
    Last edited by R4zyel; 12-11-2014 at 02:23 PM.

Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. [Request] A Guide How to Change the Sky
    By Wolfly in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 11-05-2007, 02:39 PM
  3. Request: Hex guide
    By pyrobladeiac in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 06-09-2007, 06:16 PM
  4. [Request] "Grinding guide addon"
    By NIkjon in forum World of Warcraft General
    Replies: 5
    Last Post: 02-05-2007, 04:08 PM
  5. Requesting a guide
    By Gunnar in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 11-03-2006, 06:22 PM
All times are GMT -5. The time now is 12:16 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search