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
  • Description
  • What happens after I join this new room?
  • How do I know I’ve joined the new room successfully?
  1. Rocket Networking Code
  2. Rooms

ChangeRoom( new_room_name )

Description

This function removes your client from the room it is in to the new room in the argument. This is exactly the same as joining a room so join room / change room can be used interchangeably.

⚠️ The new room name has to be a string. Please understand that and do not pass any other values. That could severely crash your server and will have to restart. Room names are case sensitive and overall just really sensitive. Also do not use emojis and other such characters. We 💕 emojis but they complicate code a lot.

📌 The new room name also can’t be a numeric string like “3” , “234” “1010”. This is because all private rooms are going to be numbers right? So we don’t want to join anyone’s private room. There is a workaround however. Instead of room id “67” you can put “ 67”. That extra space allows you to bypass this rule.

Syntax

ChangeRoom(new_room_name);
Argument
Description

new_room_name

The name of the room you intend the client to join. This must be a String.

Returns

N/A

What happens after I join this new room?

  1. All instances of other players from your previous room, if there were any are destroyed, and now ones from this room are created.

  2. Now your shared properties are only shared with members of this room.

How do I know I’ve joined the new room successfully?

After a successful room change, the callback function callback_ChangeRoom() is called.

PreviousRoomsNextcallback_ChangeRoom()

Last updated 1 year ago