This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 21841 for ps


Ignore:
Timestamp:
06/06/18 23:17:01 (7 years ago)
Author:
elexis
Message:

In preparation of D1513, allow the NetClientSession to find out if it's the "Local Client", refs #5163.

For good practice, mention all members in the affected member initializer list:
Add booelan m_IsLocalClient and u32 m_HostID to the member initializer list (to not have them undefined, even though they are not read from until they are set).
Add the strings m_GUID and m_UserName for completeness (even though the default constructor is already called for strings).
Use nullptr instead of NULL for pointers.

Comments By: Vladislav

Location:
ps/trunk/source/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/network/NetSession.cpp

    r19703 r21841  
    1 /* Copyright (C) 2017 Wildfire Games.
     1/* Copyright (C) 2018 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    3434
    3535CNetClientSession::CNetClientSession(CNetClient& client) :
    36     m_Client(client), m_FileTransferer(this), m_Host(NULL), m_Server(NULL), m_Stats(NULL)
     36    m_Client(client), m_FileTransferer(this), m_Host(nullptr), m_Server(nullptr), m_Stats(nullptr), m_IsLocalClient(false)
    3737{
    3838}
     
    8181    m_Host = host;
    8282    m_Server = peer;
     83    m_IsLocalClient = isLocalClient;
    8384
    8485    // Prevent the local client of the host from timing out too quickly.
     
    201202}
    202203
    203 
    204 
    205204CNetServerSession::CNetServerSession(CNetServerWorker& server, ENetPeer* peer) :
    206     m_Server(server), m_FileTransferer(this), m_Peer(peer)
     205    m_Server(server), m_FileTransferer(this), m_Peer(peer), m_IsLocalClient(false), m_HostID(0), m_GUID(), m_UserName()
    207206{
    208207}
  • ps/trunk/source/network/NetSession.h

    r19703 r21841  
    1 /* Copyright (C) 2017 Wildfire Games.
     1/* Copyright (C) 2018 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
     
    116116    ENetPeer* m_Server;
    117117    CNetStatsTable* m_Stats;
     118
     119    bool m_IsLocalClient;
    118120};
    119121
Note: See TracChangeset for help on using the changeset viewer.