Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 10 and Version 11 of code/doc/Identifier


Ignore:
Timestamp:
Sep 28, 2008, 7:20:55 PM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/Identifier

    v10 v11  
    161161// Assigns the Identifier of the class with name "A2"
    162162std::string name = "A2";
    163 Identifier* other = ID(name);
     163Identifier* other = ClassByString(name);
    164164}}}
    165165
     
    180180Because [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.
    181181
    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(). So ID(5) might be different on each client. That's why the server has to synchronize the network ID's.
     182The 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.
    183183
    184184You can retrieve the network ID of an [wiki:Identifier] with getNetworkID().[[br]]
    185185You can set the network ID of an [wiki:Identifier] with setNetworkID(int).
    186186
    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.
     187After 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.
    188188
    189189Read the Wiki-page of [wiki:Factory] to get more information about how to iterate through all [wiki:Identifier Identifiers].