Diarkis Inc.

Top > Blog > Make Reservations With A Room

Make Reservations With A Room

Room Reservation

Room module’s rooms allow their owners to make reservations with selected user IDs.

The users with reservations will have guaranteed access (join) to the rooms.

If all available slots in a room are reserved, users without reservations will be rejected to join.

Making Reservations

// This event is raised when reservations are made
room.OnReserve += HandleDiarkisOnRoomReserve;

// List of user IDs to make reservations with
List<string> memberIDs new = List<string>();
memberIDs.Add("uid-123");
memberIDs.Add("uid-456");

room.Reserve(roomID, memberIDs);

private void HandleDiarkisOnRoomReserve(bool success, byte[] msg)
{
       if (!success)
       {
               // Failed to make reservations
       }
}

Cancel Reservations

// This event is raised when reservations are made
room.OnReserve += HandleDiarkisOnRoomCancelReserve;

// List of user IDs to make reservations with
List<string> memberIDs new = List<string>();
memberIDs.Add("uid-123");
memberIDs.Add("uid-456");

room.CancelReservation(roomID, memberIDs);

private void HandleDiarkisOnRoomCancelReserve(bool success, byte[] msg)
{
       if (!success)
       {
               // Failed to cancel reservations
       }
}

C# Client SDK v0.1.13 and above.

Conclusion

Controlling the user join is very important in many cases.

There are other ways to control this flow such as setting specific custom conditions etc. This is one of the simplest methods.

For more details on the Dirakis Room module, please read here.

Diarkis enables massive multiplayer network communications.

Contact Us
このエントリーをはてなブックマークに追加

Recommendations

If you are interested in learning more about Diarkis, please contact us here.

Contact Us Request Documents
PAGE TOP