Database FunctionsSummary | | | Locate a replica with a matching mother and room. | | Locate all the replicas with a matching mother and room. | | Locate a replica using an object name. | | Search for a replica in a given room, with a given object. | | Search for a replica in a given room, with a given object. | | Find an object with the given name. | | Find a persona with the given name. | | Find an online player with the given name. | | Find a room with the given name. | | Locate the next active player. | | Decrement a given replica data, returning any record that reaches 0. | | Decrement a given replica variable, returning any record that reaches 0. | | Decrement a given replica byte, returning any record that reaches 0. | | Search for for a replica with the given flag enabled. |
find_replicaLocate a replica with a matching mother and room. This is used to iterate through the replica database, finding each replica that has either the given mother, the given room, or both. This is much like <search_replica_room>() except that here you specify an exact mother to match, not a mother name. If mother is 0, then match any mother. If room is 0, then match any room. The search will start on the replica immediately after the specified start replica. (Note, this does not imply ordered progression. Due to indexing, replica are likely going to be returned out of order.) A start value of 0 will always return the first match found (and should be used to begin an iteration). Paramsmother | the exact mother to match (or 0 for any) | start | begin searching immediately after this record | room | the exact room to match (or 0 for any) |
ReturnsA replica record number of the next replica to match in this iteration search, or 0 if no more have been found.
find_replica@Locate all the replicas with a matching mother and room. This is used to iterate through the replica database, finding each replica that has either the given mother, the given room, or both. This is much like <search_replica_room>() except that here you specify an exact mother to match, not a mother name. If mother is 0, then match any mother. If room is 0, then match any room. Unlike find_replica, all matches are found at once. Paramsmother | the exact mother to match (or 0 for any) | room | the exact room to match (or 0 for any) |
ReturnsA list of all matching replicas.
search_replicaLocate a replica using an object name. This is for compatibility only. It is exactly equivalent to <search_replica_room>(0, str$, start) which provides the same functionality but with more search options (namely the room). Paramsobject$ | object name to search for (e.g. “sword”) | start | begin searching immediately after this record |
ReturnsThe next replica in the search or 0 if no more are found.
search_replica_roomSearch for a replica in a given room, with a given object. This is the meat of powerful replica searching. It takes an object name (e.g. “sword”) and searches for any replica that has an object with that name. So, for instance, if you have two sword objects, one with names [“longsword”,”sword”] and the other with [“shortsword”,”sword”], it will match both those objects in the search for “sword”. It will also optionally limit the search to only a given room if the specified room is non-zero. This routine is highly indexed and optimized for performance. Paramsroom | room to match (or 0 for any) | object$ | object name to search for (e.g. “sword”) | start | begin searching immediately after this record |
ReturnsThe next replica in the search or 0 if no more are found.
search_replica_room@Search for a replica in a given room, with a given object. This is the meat of powerful replica searching. It takes an object name (e.g. “sword”) and searches for any replica that has an object with that name. So, for instance, if you have two sword objects, one with names [“longsword”,”sword”] and the other with [“shortsword”,”sword”], it will match both those objects in the search for “sword”. It will also optionally limit the search to only a given room if the specified room is non-zero. This routine is highly indexed and optimized for performance. Paramsroom | room to match (or 0 for any) | object$ | object name to search for (e.g. “sword”) |
ReturnsAll matching replicas, or an empty vector if none are found.
search_objectFind an object with the given name. This will search through the object database, returning the next object that has the given name in its list of names. Paramsobject$ | object name to search for (e.g.”sword”) | start | begin searching immediately after this record |
ReturnsThe next object in the search or 0 if no more are found.
search_personaFind a persona with the given name. This will search through the persona database, returning the persona with the given name. Note that the lack of ‘start’ parameter implies that names should be unique (this is not actually enforced however). Contrast this with <search_player>(). Paramsname$ | persona name to search for (e.g.”Frodo”) |
ReturnsThe matching persona or 0 if no persona record matches.
search_playerFind an online player with the given name. Search through the persona database finding a persona record that matches the name (or partial name) given and is currently online (has a node pointing to it). This routine does partial name matching. This means that for every online player, if the search name is “fr” then it will return the nodes on which “Frodo”, “Frumpy”, and “Frobozz” are playing (assuming they are online of course). Contrast with <search_persona>(). Paramsname$ | persona name (or partial name) to match (e.g. “frodo” or “fr”) | start | begin searching immediately after this record |
ReturnsThe next online player to match, or 0 if no more are found.
search_roomFind a room with the given name. This will lookup a room number given its unique name (uniqueness is enforced here, unlike for personas). ParamsReturnsThe room record number or 0 if not found.
next_playerLocate the next active player. This will check all the online players and return the next one who has as an active node (node[].status of either 1 or 2) and a valid persona (between 1 and persona.maxrecord and who’s name is not empty). Paramsstart | begin searching immediately after this record |
ReturnsThe next player, or 0 if no more are found.
decrement_replica_dataDecrement a given replica data, returning any record that reaches 0. This is a strange routine it will iterate over the replica database, decrementing the specified data field by 1. If, after decrementing, it causes that value to be 0, the loop ends, and the record is returned. It can be continued by calling again, with the last value returned given as the start record. This was used to implement timers in older games. Note: this will not wrap around (values of 0 are not decremented below 0). Paramsindex | index into data field to decrement (e.g. 5 for data[5]) | start | begin immediately after this record |
ReturnsThe next replica to reach 0, or 0 if none are found to do so.
decrement_replica_varDecrement a given replica variable, returning any record that reaches 0. This is just like <decrement_replica_data>() but operates on the replica[].variable field instead. Paramsindex | index into data field to decrement (e.g. 5 for variable[5]) | start | begin immediately after this record |
ReturnsThe next replica to reach 0, or 0 if none are found to do so.
decrement_replica_varDecrement a given replica byte, returning any record that reaches 0. This is just like <decrement_replica_data>() but operates on the replica[].byte field instead. Paramsindex | index into data field to decrement (e.g. 5 for byte[5]) | start | begin immediately after this record |
ReturnsThe next replica to reach 0, or 0 if none are found to do so.
find_repflagSearch for for a replica with the given flag enabled. This routine is for compatibility and find_repflag(f,0) can be rewritten as replica.flag[f].search(1, 0); Paramsflag | which flag to search (e.g. 5 for flag[5]) | start | begin immediately after this record |
ReturnsThe next matching replica, or 0 if none are found.
|