Rotur
  • Getting Started
  • Your Connection
    • What is a websocket?
    • Connecting
      • Handshake
      • SetID
      • Link
    • Authentication
      • Get User Data
      • Login
    • Rotur Designations
    • Websocket Commands
      • Global Message (gmsg)
      • Private Message (pmsg)
      • Login to rotur (auth)
  • My Account
    • Rotur Account Objects
      • originOS specific keys
    • Requesting my ofsf storage
    • Rotur Badges
    • Transactions and Taxes
  • Assorted APIs
    • rMail
    • avatars.rotur.dev
      • .banners
    • rotur.dev/auth
    • Keys
  • languages
    • RWL
      • Basics
      • Structure
      • Attributes
        • Text
        • Frame
        • Section
      • Alignments and Anchors
    • RTR
      • Basics
      • Structure
      • Functions
        • Mathematical Functions
        • String Functions
        • Array Functions
        • Object Functions
        • Logical Functions
        • Utility Functions
      • Events
      • Examples
    • RDF
  • Claw
    • What is claw
    • Api Endpoints
      • /feed
      • /post
      • /follow
      • /unfollow
      • /followers
      • /following
      • /profile
      • /delete
      • /rate
      • /following_feed
      • /reply
      • /repost
      • /top_posts
      • /search_posts
      • /search_users
  • Web Standard
    • What is this
  • Addons / Extensions
    • Basic Structure
    • Events
      • onload
      • page_load
      • page_focus
    • API
      • Classes
        • Page
          • (static) .new()
          • .getTitle()
        • URL
          • (static) .new()
          • (static) .parse()
          • .format()
          • .getAsyncData()
          • .getFetchUrl()
          • .getTitle()
    • Commands
      • redirect
      • opentab
    • Variables
      • tab_info
      • page_width / height
      • scroll_x / y
Powered by GitBook
On this page
  • Global Messaging (gmsg)
  • Client Request
  • Server Response
Edit on GitHub
  1. Your Connection
  2. Websocket Commands

Global Message (gmsg)

Global Messaging (gmsg)

The gmsg command allows a client to send a broadcast message to all users in every room that the client is currently a member of.

Client Request

To send a global message, the client should format the JSON message as follows:

{
  "cmd": "gmsg",
  "val": "Hello World"
}

Field Descriptions:

  • cmd: Must be "gmsg". This tells the server the type of message.

  • val: A string containing the message content that you wish to broadcast.

Server Response

After processing the global message, the server responds with a status confirmation:

{
  "cmd": "statuscode",
  "code": "I:100 | OK",
  "code_id": 100
}

In addition, the server broadcasts the message to all users in the rooms that the sender is a member of. The broadcasted message will have the following format:

{
  "cmd": "gmsg",
  "val": "Hello World",
  "origin": { "username": "sender_username" },
  "rooms": "room_name"
}

Notes:

  • The origin field indicates the username of the sender.

  • The rooms field specifies which room the message is being sent to. If the sender is in multiple rooms, each room will receive its own broadcasted message.

PreviousWebsocket CommandsNextPrivate Message (pmsg)

Last updated 3 months ago