Skip to content
Open
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
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build output
AAServer/AAServer
AAServer/*.o

# macOS
.DS_Store

# VS Code (keep .vscode/ tracked, but ignore local overrides)
.vscode/

# MSVC / Windows build artifacts
AAServer/Debug/
AAServer/Release/
AAServer/ipch/
AAServer/*.sdf
AAServer/*.suo
AAServer/*.opensdf

# Spec / scratch
spec/
.claude
6 changes: 0 additions & 6 deletions AAServer/.gitignore

This file was deleted.

18 changes: 16 additions & 2 deletions AAServer/AAServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#include "stdafx.h"
#include "config.h"
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include "ipxserver.h"
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -333,7 +337,11 @@ bool IPX_StartServer(Bit16u portnum)
// 1 second has gone by
UpdateConnections();
}
#ifdef _WIN32
Sleep(1);
#else
usleep(1000);
#endif
}

return true;
Expand All @@ -343,7 +351,7 @@ bool IPX_StartServer(Bit16u portnum)
return false;
}

int _tmain(int argc, _TCHAR* argv[])
int main(int argc, char* argv[])
{
printf("Amulets & Armor IPX Server v1.00\n");
printf("--------------------------------\n");
Expand All @@ -358,7 +366,13 @@ int _tmain(int argc, _TCHAR* argv[])
exit(2);
}

IPX_StartServer(213);
Bit16u port = 213;
if (argc > 1) {
port = (Bit16u)atoi(argv[1]);
}
printf("Starting on port %d\n", port);
fflush(stdout);
IPX_StartServer(port);
return 0;
}

22 changes: 22 additions & 0 deletions AAServer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CXX = clang++
CC = clang
INCLUDES = -I. -I/usr/local/include/SDL2
CFLAGS = $(INCLUDES) -DNDEBUG
CXXFLAGS = $(CFLAGS) -std=c++14
LDFLAGS = -L/usr/local/lib -lSDL2 -lSDL2_net
TARGET = AAServer
OBJS = AAServer.o PACKETPR.o

$(TARGET): $(OBJS)
$(CXX) $(OBJS) $(LDFLAGS) -o $(TARGET)

AAServer.o: AAServer.cpp
$(CXX) $(CXXFLAGS) -c AAServer.cpp -o AAServer.o

PACKETPR.o: PACKETPR.C
$(CC) $(CFLAGS) -c PACKETPR.C -o PACKETPR.o

clean:
rm -f $(OBJS) $(TARGET)

.PHONY: clean
18 changes: 13 additions & 5 deletions AAServer/config.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
#ifndef _AASERVER_CONFIG_H_
#define _AASERVER_CONFIG_H_

#define GCC_ATTRIBUTE(x) /* attribute not supported */
#define GCC_UNLIKELY(x) (x)
#define GCC_LIKELY(x) (x)

#ifdef _MSC_VER
#define GCC_ATTRIBUTE(x) /* attribute not supported */
#define INLINE __forceinline
#define DB_FASTCALL __fastcall
typedef unsigned __int64 Bit64u;
typedef signed __int64 Bit64s;
#else
#define GCC_ATTRIBUTE(x) __attribute__((x))
#define INLINE inline
#define DB_FASTCALL
typedef unsigned long long Bit64u;
typedef signed long long Bit64s;
#endif

#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#pragma warning(disable : 4996)
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#pragma warning(disable : 4996)
#endif


Expand All @@ -20,8 +30,6 @@ typedef unsigned short Bit16u;
typedef signed short Bit16s;
typedef unsigned long Bit32u;
typedef signed long Bit32s;
typedef unsigned __int64 Bit64u;
typedef signed __int64 Bit64s;
typedef unsigned int Bitu;
typedef signed int Bits;

Expand Down
4 changes: 3 additions & 1 deletion AAServer/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

#pragma once

#ifdef _WIN32
#include "targetver.h"
#include <tchar.h>
#endif

#include <stdio.h>
#include <tchar.h>



Expand Down