0d4b0b2279
- $ann implemented - concurrency removed; server is now single-threaded, event-driven and much more stable - rare seed is no longer the game id; ids are sequential from server startup so they weren't random at all before - supports dropping privileges; now you can run it as root so it can open a sockets on low ports, then it will switch to the given user before serving any traffic - newserv now behaves like a proxy if you run it with the --proxy-destination=<IP_OR_HOSTNAME> argument; there's also an (invisible) shell in this mode where you can inject commands to the server or client. e.g. it can always be christmas in the lobby if you do `sc DA 01 00 00` - increased the mtu on PSODolphinConfig's tap0 configuration; this seems to make the connection more stable - fixed some uninitialized memory bugs - the shell is now event-driven and now uses libevent too; unfortunately this means readline doesn't work anymore (no history and vim-like shortcuts) - made network command display consistent for input vs. output (the header appears in both cases now) - fixed bugs in some subcommand handling (the BB logic was being applied to non-BB clients erroneously, causing most item drops not to work at all) - fixed player tags in the short lobby data struct. unclear if this was actually a problem but it was inconsistent with other servers - fixed "unused" field in game join command (actually it appears to be disable_udp and should be 1, not 0) - cleaned up Server abstraction a bit - rewrote some text functions; asan was complaining about the built-in ones for some reason - added an optional welcome message
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
enum class GameVersion {
|
|
DC = 0,
|
|
PC,
|
|
Patch,
|
|
GC,
|
|
BB,
|
|
};
|
|
|
|
enum ClientFlag {
|
|
// after joining a lobby, client will no longer send D6 commands when they close message boxes
|
|
NoMessageBoxCloseConfirmationAfterLobbyJoin = 0x0004,
|
|
// client has the above flag and has already joined a lobby
|
|
NoMessageBoxCloseConfirmation = 0x0008,
|
|
// client can see Ep3 lobbies
|
|
CanSeeExtraLobbies = 0x0010,
|
|
// client is episode 3 and should use its game mechanic
|
|
Episode3Games = 0x0020,
|
|
// client is DC v1 (disables some features)
|
|
IsDCv1 = 0x0040,
|
|
// client is loading into a game
|
|
Loading = 0x0080,
|
|
|
|
// client is in the information menu (login server only)
|
|
InInformationMenu = 0x0100,
|
|
// client is at the welcome message (login server only)
|
|
AtWelcomeMessage = 0x0200,
|
|
|
|
DefaultV1 = IsDCv1,
|
|
DefaultV2DC = 0x0000,
|
|
DefaultV2PC = 0x0000,
|
|
DefaultV3GC = 0x0000,
|
|
DefaultV3GCPlus = NoMessageBoxCloseConfirmationAfterLobbyJoin,
|
|
DefaultV3BB = NoMessageBoxCloseConfirmationAfterLobbyJoin | NoMessageBoxCloseConfirmation,
|
|
DefaultV4 = NoMessageBoxCloseConfirmationAfterLobbyJoin | CanSeeExtraLobbies | Episode3Games,
|
|
};
|
|
|
|
uint16_t flags_for_version(GameVersion version, uint8_t sub_version);
|
|
const char* name_for_version(GameVersion version);
|