Skip to content

A universal unique ID generator module for Garry's Mod.

License

Notifications You must be signed in to change notification settings

viral32111/gm_uuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UUID

A module for Garry's Mod that allows the generation of version 4 UUID strings using the Boost library.

Download

I only release prebuilt binaries for x64 on Linux & Windows. However, feel free to modify and build the code if you need x86 or macOS support. I don't offer support for these myself because x86 is old and I can't afford to test my code on macOS.

After downloading the binary of your choice, rename the gm_ prefix appropriately depending on which realm you'll be using it in. For more information, check this wiki article.

Downloads for the latest binaries:

Usage

Here's a simple example of how you would use this:

require( "uuid" )

-- The only argument is a boolean for including the dashes, it defaults to true.
print( GenerateUUID() ) -- 123e4567-e89b-12d3-a456-426655440000
print( GenerateUUID( true ) ) -- 123e4567-e89b-12d3-a456-426655440000
print( GenerateUUID( false ) ) -- 123e4567e89b12d3a456426655440000

Building

Windows

  1. Download a copy of the repository and extract it into a folder.
  2. Download and extract Premake 5 (for Windows) into the repository folder (or add it to your environment path, if you're going to use it again later).
  3. Open Command Prompt in the repository folder (cd into the folder).
  4. Run premake5 --file=scripts/premake5.lua vs2019 to generate a Visual Studio 2019 project.
  5. Open the Visual Studio 2019 solution file created at projects/windows/uuid.sln.
  6. Press Build > Build Solution to build the project (the module will be placed in deploy/gm_uuid_win64.dll).

Linux

  1. Download a copy of the repository and extract it into a folder.
  2. Download and extract Premake 5 (for Linux) into the repository folder (or add it to your environment path, if you're going to use it again later).
  3. Open your favourite terminal in the repository folder (cd into the folder).
  4. Make the extracted premake5 file executable (chmod +x premake5).
  5. Run premake5 --file=scripts/premake5.lua gmake to generate a Make project.
  6. Navigate to project/linux/ (cd /project/linux).
  7. Run make to build the project (the module will be placed in deploy/gm_uuid_linux64.dll).

Licence

Copyright (C) 2020 - 2022 viral32111. Licenced under GNU AGPLv3.