Rocket Networking Docs🚀
  • About this Documentation
  • Basics of Rocket Networking
    • Room based multiplayer (Auto State Sharing)
      • Clients and clientId
      • Entities
      • Smart Entities
    • Single Message Sharing
    • Persistent Objects on the Server
    • Easy Matchmaking
    • Discord Server Integration
    • Database for your Account
    • Server Side Scripting
    • Global Multiplayer(Cross play)
  • Rocket Networking Code
    • Connecting and Disconnecting
      • ConnectToServer()
      • callback_ConnectToServer()
      • DisconnectFromServer()
      • callback_DisconnectFromServer()
    • Rooms
      • ChangeRoom( new_room_name )
      • callback_ChangeRoom()
      • LeaveRoom()
      • callback_LeaveRoom()
      • ShowAllClientsInRoom(room_name ) and callback_ShowAllClientsInRoom()
      • ShowAllRooms() and callback_ShowAllRooms()
    • Private Messaging
      • SendEventToClient
      • callback_ReceivedEvent
      • SendMessageToClient
      • callback_ReceivedMessage
    • Persistent Objects
      • CreatePersistentObject(roomId , persistentObjectStruct)
      • callback_CreatedPersistentObject()
      • EditPersistentObject(persistentObjectId , new_persistentObjectStruct)
      • DestroyPersistentObject(persistentObjectId)
      • ShowPersistentObjectsInRoom(room_name)
      • callback_ShowAllPersistentObjectsInRoom(array_of_persistent_objects)
    • Database Functions
      • SetSimpleData()
      • callback_SetSimpleData()
      • ReadSimpleData()
      • callback_ReadSimpleData()
      • AddToSimpleData()
      • callback_AddToSimpleData()
      • DeleteSimpleData()
    • Discord Integration
      • SendDiscordMessage()
      • callback_DiscordMessageReceived()
    • AI Functions
      • CallSimpleAI
      • callback_CallSimpleAI
      • CallGeneralAI
      • callback_CallGeneralAI
  • KickPlayer(client_id)
  • ViewServerActivity()
    • callback_ViewServerActivity()
  • oBrain - ping and pseudoHost
  • Admin Callbacks
  • API
    • Database
    • AI
  • Server Side Scripting
    • Basics
    • Understand the heirarchy on the server
    • Create a Persistent Object from Server
    • Important Scripts
      • "step" Script format
      • "client_sent_event" Script format
      • "game_server_created" Script format
    • Send Event to a Client from Server
    • Database Functions on Server
    • AI Functions on the Server
Powered by GitBook
On this page
  1. Server Side Scripting

Important Scripts

PreviousCreate a Persistent Object from ServerNext"step" Script format

Last updated 1 year ago

These are the scripts that are allowed to run on your RNet server.

You have to first add a new game name, that matches the game name in your gamemaker project in Options.gml. By default this was set to "default".

After that you have to ADD NEW SCRIPT and give it a name. There are only particular script names allowed which actually do something on your server. They are

  1. "step" - This code runs every frame of the server in the "game" scope

  2. "client_sent_event" - This code runs in the server at the "game" scope when some client calls SentEventToServer()

  3. "game_server_created" - This code runs in the server at the "game" scope when the server is first created

  4. "room_created" - This code runs in the server at the "room" scope whenever a new room is created ie when a client joins a room that did not exist before or when you add a persistent object to a room which did not exist before

  5. "client_created" - This code runs in the server at the "client" scope whenever a new client is created ie whenever a new client calls ConnectToServer()

  6. "entity_created" - This code runs in the server at the "entity" scope whenever a new entity is created by a client

  7. "persistent_object_created" - This code runs in the server at the "persistent object" scope whenever a new persistent object is created

You can make more scripts with other names, but they won't actually do anything in your game. Please back up all your code!!