Skip to content

Commit

Permalink
fix: small corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed Mar 31, 2024
1 parent ff72f65 commit 62dbb68
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion include/sk_gametypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#pragma once

#include <raylib.h>
#include <sk_player.h>

typedef enum {
Expand Down
1 change: 1 addition & 0 deletions include/sk_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define SK_SERVER_NAME "sparky-server"
#define SK_SERVER_PORT 27015
#define SK_SERVER_TICK_RATE 128
#define SK_SERVER_MSG_MAX_SIZE 1024
#define SK_SERVER_MSG_CONN_REQ "ping::" SK_SERVER_NAME
#define SK_SERVER_MSG_CONN_RES "pong::" SK_SERVER_NAME

Expand Down
2 changes: 1 addition & 1 deletion src/sk_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ u8 sk_client_run(const char *ip) {
close(sock_fd);
return 1;
}
char pong_msg[1024];
char pong_msg[SK_SERVER_MSG_MAX_SIZE];
int pong_msg_n = recv(sock_fd, pong_msg, sizeof(pong_msg), MSG_WAITALL);
if (pong_msg_n == -1) {
TraceLog(LOG_ERROR, "recv(2) :: %s", strerror(errno));
Expand Down
4 changes: 1 addition & 3 deletions src/sk_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include <time.h>
#endif

#define MAX_CLIENTS 2

static volatile u8 running = 1;
static volatile u8 clients = 0;

Expand Down Expand Up @@ -80,7 +78,7 @@ u8 sk_server_run(void) {
signal(SIGINT, handle_interrupt);
struct sockaddr_in client_addr;
socklen_t client_addr_len = sizeof(client_addr);
char msg[1024];
char msg[SK_SERVER_MSG_MAX_SIZE];
int msg_n = 0;
while (running) {
client_addr = (struct sockaddr_in) {0};
Expand Down

0 comments on commit 62dbb68

Please sign in to comment.