Changes between Version 10 and Version 11 of code/doc/Identifier
- Timestamp:
- Sep 28, 2008, 7:20:55 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/doc/Identifier
v10 v11 161 161 // Assigns the Identifier of the class with name "A2" 162 162 std::string name = "A2"; 163 Identifier* other = ID(name);163 Identifier* other = ClassByString(name); 164 164 }}} 165 165 … … 180 180 Because [wiki:Identifier Identifiers] use pointers, they are not qualified for networking. It's possible to just send the classname and use the [wiki:Factory], but this is expensive. That's why there's a network ID. 181 181 182 The network ID is an unsigned integer. You can retrieve an [wiki:Identifier] with a given network ID by using the macro ID(int) (include [wiki:CoreIncludes CoreIncludes.h] to use it). It's not determined which network ID belongs to which Identifier. This changes from version to version and from system to system, depending on the number of existing classes and the code executed before main(). SoID(5) might be different on each client. That's why the server has to synchronize the network ID's.182 The network ID is an unsigned integer. You can retrieve an [wiki:Identifier] with a given network ID by using the macro ClassByID(int) (include [wiki:CoreIncludes CoreIncludes.h] to use it). It's not determined which network ID belongs to which Identifier. This changes from version to version and from system to system, depending on the number of existing classes and the code executed before main(). So ClassByID(5) might be different on each client. That's why the server has to synchronize the network ID's. 183 183 184 184 You can retrieve the network ID of an [wiki:Identifier] with getNetworkID().[[br]] 185 185 You can set the network ID of an [wiki:Identifier] with setNetworkID(int). 186 186 187 After changing the network ID of an Identifier to ''newid'', there might be two Identifiers with the ID ''newid''. ID(''newid'') will then return the changed Identifier and not the old one.187 After changing the network ID of an Identifier to ''newid'', there might be two Identifiers with the ID ''newid''. ClassByID(''newid'') will then return the changed Identifier and not the old one. 188 188 189 189 Read the Wiki-page of [wiki:Factory] to get more information about how to iterate through all [wiki:Identifier Identifiers].