atrooney-online-2/include/datatypes.h
Salanto f0a5e48f5c
Dual-Stack AO2 Client to handle both TCP and Websocket connections seemlessly (#696)
* Replace TCP Serversocket with Websocket

* Have TCP sockets live harmoniously with WS

"like 5 lines" yeah probably lost a bet.

* Update .gitlab-ci.yml

* hack to fix favorites

* Add support for websockets in the favorites list (serverlist.txt)
Make "add_favorite_server" remember the socket type

* Preserve old serverlist style

This will keep new entries compatible with 2.9 and prior clients. Makes parsing the list easier too.

* Add lookup table and correct write code to use lowercase

* I have no idea what a lookup table is, but this looks close enough

* Fix lookup table

* Otherwise backend selection behaviour is inverted

* clang-tidy had one job

* Yet it did not do it.

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>

* const p_data

* Switch serverlist.txt to an ini format

* Fixes an Omni bug where : would split the servername
* Utilises internally QSettings properly for low parsing effort and clear structure
* Automatically migrates the legacy serverlist.txt to favorite_servers.ini
* Pleases my OCD

* Replace sample serverlist.

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: Alex Noir <Varsash@gmail.com>
2022-06-06 19:14:44 +02:00

126 lines
1.8 KiB
C

#ifndef DATATYPES_H
#define DATATYPES_H
#include <QMap>
#include <QString>
enum connection_type {
TCP,
WEBSOCKETS,
};
static QMap<QString, connection_type> to_connection_type = {
{"tcp", connection_type::TCP},
{"ws", connection_type::WEBSOCKETS}
};
struct server_type {
QString name;
QString desc;
QString ip;
int port;
connection_type socket_type;
};
struct emote_type {
QString comment;
QString preanim;
QString anim;
int mod;
QString sfx_name;
int sfx_delay;
int sfx_duration;
};
struct char_type {
QString name;
QString description;
QString evidence_string;
bool taken;
};
struct evi_type {
QString name;
QString description;
QString image;
};
struct chatmessage_type {
QString message;
QString character;
QString side;
QString sfx_name;
QString pre_emote;
QString emote;
int emote_modifier;
int objection_modifier;
int realization;
int text_color;
int evidence;
int cid;
int sfx_delay;
int flip;
};
struct area_type {
QString name;
QString background;
bool passworded;
};
struct pos_type {
int x;
int y;
};
struct pos_size_type {
int x = 0;
int y = 0;
int width = 0;
int height = 0;
};
enum CHAT_MESSAGE {
DESK_MOD = 0,
PRE_EMOTE,
CHAR_NAME,
EMOTE,
MESSAGE,
SIDE,
SFX_NAME,
EMOTE_MOD,
CHAR_ID,
SFX_DELAY,
OBJECTION_MOD,
EVIDENCE_ID,
FLIP,
REALIZATION,
TEXT_COLOR,
SHOWNAME,
OTHER_CHARID,
OTHER_NAME,
OTHER_EMOTE,
SELF_OFFSET,
OTHER_OFFSET,
OTHER_FLIP,
IMMEDIATE,
LOOPING_SFX,
SCREENSHAKE,
FRAME_SCREENSHAKE,
FRAME_REALIZATION,
FRAME_SFX,
ADDITIVE,
EFFECTS
};
enum EMOTE_MOD {
IDLE = 0,
PREANIM = 1,
ZOOM = 5,
PREANIM_ZOOM = 6,
};
enum MUSIC_EFFECT { FADE_IN = 1, FADE_OUT = 2, SYNC_POS = 4 };
#endif // DATATYPES_H