Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port NetCli/NetGameLib to standard C++ containers #1487

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ struct NetCli {
NetMsgChannel * channel;
bool server;

// message queue
LINK(NetCli) link;
NetCliQueue * queue;

// message send/recv
const NetMsgInitRecv * recvMsg;
const NetMsgField * recvField;
Expand All @@ -147,20 +143,14 @@ struct NetCli {
std::vector<uint8_t> recvBuffer;

NetCli()
: sock(), protocol(), channel(), server(), queue(), recvMsg()
: sock(), protocol(), channel(), server(), recvMsg()
, recvField(), recvFieldBytes(), recvDispatch(), sendCurr(), mode()
, encryptFcn(), seed(), cryptIn(), cryptOut(), encryptParam()
, sendBuffer()
{
}
};

struct NetCliQueue {
LISTDECL(NetCli, link) list;
unsigned lastSendMs;
unsigned flushTimeMs;
};


namespace pnNetCli {

Expand Down Expand Up @@ -419,10 +409,6 @@ static void BufferedSendData (
DEFAULT_FATAL(cmd->type);
}
}

// prepare to flush this connection
if (cli->queue)
cli->queue->list.Link(cli);
}

//===========================================================================
Expand Down Expand Up @@ -1027,14 +1013,6 @@ void NetCliClearSocket (NetCli * cli) {
cli->sock = nullptr;
}

//============================================================================
void NetCliSetQueue (
NetCli * cli,
NetCliQueue * queue
) {
cli->queue = queue;
}

//============================================================================
void NetCliDisconnect (
NetCli * cli,
Expand Down
31 changes: 1 addition & 30 deletions Sources/Plasma/NucleusLib/pnNetCli/pnNetCli.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,8 @@ struct NetMsg {
unsigned count;
};

// Opaque types
// Opaque type
struct NetCli;
struct NetCliQueue;


/*****************************************************************************
Expand Down Expand Up @@ -337,29 +336,6 @@ void NetMsgProtocolDestroy (
);


/*****************************************************************************
*
* NetCliQueue
*
***/

NetCliQueue * NetCliQueueCreate (
unsigned flushTimeMs
);

void NetCliQueueDestroy (
NetCliQueue * queue
);

void NetCliQueueFlush (
NetCliQueue * queue
);

float NetCliQueueQueryFlush (
NetCliQueue * queue
);


/*****************************************************************************
*
* NetCli
Expand All @@ -385,11 +361,6 @@ void NetCliClearSocket (
NetCli * cli
);

void NetCliSetQueue (
NetCli * cli,
NetCliQueue * queue
);

void NetCliDisconnect (
NetCli * cli,
bool hardClose
Expand Down
2 changes: 0 additions & 2 deletions Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ set(pnUtils_HEADERS
pnUtCoreLib.h
pnUtAllIncludes.h
pnUtCrypt.h
pnUtList.h
pnUtStr.h
pnUtTime.h
)

set(pnUtils_SOURCES
pnUtCrypt.cpp
pnUtList.cpp
pnUtStr.cpp
pnUtTime.cpp
)
Expand Down
1 change: 0 additions & 1 deletion Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ You can contact Cyan Worlds, Inc. by email [email protected]


#include "pnUtCoreLib.h" // must be first in list
#include "pnUtList.h"
#include "pnUtTime.h"
#include "pnUtStr.h"
#include "pnUtCrypt.h"
Expand Down
129 changes: 0 additions & 129 deletions Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp

This file was deleted.

Loading