1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-04 07:30:03 +00:00

Lib: Minor refactoring, boilerplate content packet handlers

- content contexts now have events
- minor comments
This commit is contained in:
2022-05-18 12:04:19 -05:00
parent 83002faa62
commit 3e60cc3c0f
5 changed files with 130 additions and 80 deletions

View File

@@ -39,6 +39,8 @@ void laikaS_freePeer(struct sLaika_peer *peer) {
laikaM_free(peer);
}
/* ===========================================[[ Start/End Packets ]]============================================ */
void laikaS_emptyOutPacket(struct sLaika_peer *peer, LAIKAPKT_ID id) {
struct sLaika_socket *sock = &peer->sock;
@@ -158,6 +160,8 @@ void laikaS_setSecure(struct sLaika_peer *peer, bool flag) {
peer->useSecure = flag;
}
/* ===========================================[[ Handle Poll Events ]]=========================================== */
bool laikaS_handlePeerIn(struct sLaika_socket *sock) {
struct sLaika_peer *peer = (struct sLaika_peer*)sock;
int recvd;