Skip to content

WebS 2.0.0

Latest

Choose a tag to compare

@AllahPower AllahPower released this 09 Jan 13:33
· 2 commits to master since this release

What's New

  • OOP Architecture: Complete rewrite with Singleton pattern
  • Dynamic Events: WebS.On("EventName", callback) / WebS.Off()
  • Auto-Reconnect: Exponential backoff with configurable parameters
  • New Events: OnReconnecting, OnReconnected
  • Security Fixes: Race conditions, memory leaks, stack overflow protection
  • Simplified Installation: All DLLs now go to single folder

Installation

All files now go to one folder - no more splitting between game root and moonloader!

Step-by-step:

  1. Extract archive to moonloader/lib/ folder.
    Full path: .../GTA San Andreas/moonloader/lib/

  2. Verify structure:
    moonloader/lib/
    ├── WebS.dll
    ├── microsoft-signalr.dll
    ├── cpprest_2_10.dll
    ├── jsoncpp.dll
    ├── libcrypto-3.dll
    ├── libssl-3.dll
    ├── zlib1.dll
    ├── brotlicommon.dll
    ├── brotlidec.dll
    └── brotlienc.dll

  3. Done! Use require("WebS") in your scripts.


Quick Example

require("WebS")

WebS.On("OnConnect", function()
    print("Connected!")
end)

WebS.On("OnError", function(err)
    print("Error: " .. err)
end)

WebS.SetReconnect({ enabled = true, maxAttempts = 5 })

WebS.Connect("https://your-server.com/hub")

function main()
    while true do
        wait(50)
        WebS.ProcessEvents()
    end
end

Upgrading from 1.0.0

  1. Delete old DLLs from game root folder (gta_sa.exe directory)
  2. Delete old moonloader/lib/WebS.dll
  3. Install fresh using instructions above
  4. Update scripts: Replace WebS.OnConnect = function() with WebS.On("OnConnect", function() ... end)

Full Documentation

See https://github.com/AllahPower/WebS/blob/master/README.md for complete API reference.

Full Changelog: 1.0.0...2.0.0