This commit is contained in:
Nishi 2025-12-20 12:11:57 +09:00
commit 8e82909923
Signed by: nishi
GPG key ID: 27EF69B208EB9343
9 changed files with 180 additions and 19 deletions

View file

@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <fishsoup.h>
@ -22,13 +23,36 @@
#define AF_COPYRIGHT "Copyright (C) 2025 Fishsoup"
enum AF_USER_PACKETS {
AF_PACKET_JOIN = FISHSOUP_PACKET_USER
AF_PACKET_HELLO = FISHSOUP_PACKET_USER,
AF_PACKET_OK,
AF_PACKET_ERROR,
AF_PACKET_JOIN
};
#pragma pack(1)
typedef struct af_packet_hello {
unsigned char major;
unsigned char minor;
unsigned char patch;
} af_packet_hello_t;
typedef struct af_packet_ok {
char reason[256];
} af_packet_ok_t;
typedef struct af_packet_error {
char reason[256];
} af_packet_error_t;
typedef struct af_packet_join {
char name[256];
char username[256];
} af_packet_join_t;
#pragma pack()
/* version.c */
void af_common_version(unsigned char* v_major, unsigned char* v_minor, unsigned char* v_patch);
/* log.c */
void af_common_log_info(const char* fmt, ...);
#endif

View file

@ -1,4 +1,8 @@
#ifndef __AF_SERVER_H__
#define __AF_SERVER_H__
/* net.c */
void net_start(int port);
void net_loop(void);
#endif