I'm making a chat server with a bunch of different rooms. Chat rooms will be stored in a "tree hierarchy" form, like this (think of a message board like this one):
I will be storing and using them from a UDT array, similar to this:Code:Category 1
Room 1
Room 2
Room 3
Category 2
Sub category 1
Room 1
Room 2
Room 3
There's actually a lot more properties than that, but that's the basic form.Code:Type CHAT_ROOM
dblID As Double 'ID of chat room.
dblParentID As Double 'ID of parent room/category.
strName As String 'Name of chat room/category.
IsRoom As Boolean 'To tell if it is a chat room or a category.
End Type
Private udtRooms() As CHAT_ROOM 'Array to store all chat rooms.
I'm getting confused on how to set the parent ID for each item. I'm making a dialog in the server so I can create/edit the default chat rooms.
When someone joins a room the client will refer to the room's ID instead of the name, ie:
"JOIN #room number"
I attached a screenshot.
