Return Value for GetSocketId.

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Return Value for GetSocketId.

      Hi,
      While going over the code in Events.h I noticed that the return type of the GetSocketId() function for the class EvtData_Network_Player_Actor_Assignment was ActorId,should it not be an int?
      I guess the compilers not complaining since ActorId is an unsigned int, and m_SocketId is an int.

      Should be? ( about line 586 )

      Source Code

      1. int GetSocketId(void) const
      2. {
      3. return m_SocketId;
      4. }


      instead of

      Source Code

      1. ActorId GetSocketId(void) const
      2. {
      3. return m_SocketId;
      4. }


      Finally why not have m_SocketId as an unsigned int ?
    • Yes, that shouldn't be an ActorId. m_SocketId is a signed int so that -1 can indicate an error or unset data (take a look in that same file to see some examples where it's initialized).

      In general, I tend to use unsigned int's for unique id's so I have a larger pool of numbers to draw from.

      -Rez