Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Johnson <[email protected]>
  • Loading branch information
dgelessus and Hoikas committed Dec 14, 2023
1 parent 2bed559 commit 01faea9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AsyncNotifySocketCallbacks
{
public:
virtual void AsyncNotifySocketConnectFailed(plNetAddress remoteAddr) = 0;
virtual bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr) = 0;
virtual bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr) = 0;
virtual void AsyncNotifySocketDisconnect(AsyncSocket sock) = 0;
virtual std::optional<size_t> AsyncNotifySocketRead(AsyncSocket sock, uint8_t* buffer, size_t bytes) = 0;
};
Expand Down
6 changes: 3 additions & 3 deletions Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct CliAuConn : hsRefCnt, AsyncNotifySocketCallbacks {

// Callbacks
void AsyncNotifySocketConnectFailed(plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr) override;
void AsyncNotifySocketDisconnect(AsyncSocket sock) override;
std::optional<size_t> AsyncNotifySocketRead(AsyncSocket sock, uint8_t* buffer, size_t bytes) override;

Expand Down Expand Up @@ -1361,7 +1361,7 @@ static void SendClientRegisterRequest (CliAuConn * conn) {
}

//============================================================================
bool CliAuConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr)
bool CliAuConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr)
{
bool wasAbandoned;
{
Expand Down Expand Up @@ -4676,7 +4676,7 @@ void NetCliAuthStartConnect (

for (unsigned i = 0; i < authAddrCount; ++i) {
// Do we need to lookup the address?
ST::string name = authAddrList[i];
const ST::string& name = authAddrList[i];
const char* pos;
for (pos = name.begin(); pos != name.end(); ++pos) {
if (!(isdigit(*pos) || *pos == '.' || *pos == ':')) {
Expand Down
6 changes: 3 additions & 3 deletions Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct CliFileConn : hsRefCnt, AsyncNotifySocketCallbacks {

// Callbacks
void AsyncNotifySocketConnectFailed(plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr) override;
void AsyncNotifySocketDisconnect(AsyncSocket sock) override;
std::optional<size_t> AsyncNotifySocketRead(AsyncSocket sock, uint8_t* buffer, size_t bytes) override;

Expand Down Expand Up @@ -308,7 +308,7 @@ static void AbandonConn(CliFileConn* conn) {
}

//============================================================================
bool CliFileConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr)
bool CliFileConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr)
{
{
hsLockGuard(s_critsect);
Expand Down Expand Up @@ -1300,7 +1300,7 @@ void NetCliFileStartConnect (

for (unsigned i = 0; i < fileAddrCount; ++i) {
// Do we need to lookup the address?
ST::string name = fileAddrList[i];
const ST::string& name = fileAddrList[i];
const char* pos;
for (pos = name.begin(); pos != name.end(); ++pos) {
if (!(isdigit(*pos) || *pos == '.' || *pos == ':')) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct CliGmConn : hsRefCnt, AsyncNotifySocketCallbacks {

// Callbacks
void AsyncNotifySocketConnectFailed(plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr) override;
void AsyncNotifySocketDisconnect(AsyncSocket sock) override;
std::optional<size_t> AsyncNotifySocketRead(AsyncSocket sock, uint8_t* buffer, size_t bytes) override;

Expand Down Expand Up @@ -212,7 +212,7 @@ static void AbandonConn(CliGmConn* conn) {
}

//============================================================================
bool CliGmConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr)
bool CliGmConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr)
{
bool wasAbandoned;
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct CliGkConn : hsRefCnt, AsyncNotifySocketCallbacks {

// Callbacks
void AsyncNotifySocketConnectFailed(plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr) override;
bool AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr) override;
void AsyncNotifySocketDisconnect(AsyncSocket sock) override;
std::optional<size_t> AsyncNotifySocketRead(AsyncSocket sock, uint8_t* buffer, size_t bytes) override;

Expand Down Expand Up @@ -242,7 +242,7 @@ static void AbandonConn(CliGkConn* conn) {
}

//============================================================================
bool CliGkConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, plNetAddress localAddr, plNetAddress remoteAddr)
bool CliGkConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAddress& localAddr, const plNetAddress& remoteAddr)
{
bool wasAbandoned;
{
Expand Down Expand Up @@ -906,7 +906,7 @@ void NetCliGateKeeperStartConnect (

for (unsigned i = 0; i < gateKeeperAddrCount; ++i) {
// Do we need to lookup the address?
ST::string name = gateKeeperAddrList[i];
const ST::string& name = gateKeeperAddrList[i];
const char* pos;
for (pos = name.begin(); pos != name.end(); ++pos) {
if (!(isdigit(*pos) || *pos == '.' || *pos == ':')) {
Expand Down

0 comments on commit 01faea9

Please sign in to comment.