1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-05 14:55:38 +01:00
GiantsTools/Sdk/Include/Network/Public/NetCommon.h

122 lines
2.1 KiB
C
Raw Normal View History

2020-08-27 08:10:21 +02:00
#pragma once
#include <string>
2021-02-28 09:46:21 +01:00
#include "IPAddress.h"
2020-08-27 08:10:21 +02:00
typedef int PlayerIndex;
typedef int PlayerTeamIndex;
enum class ChatColor : int
{
None = 0,
System = 1,
PlayerAll = 2,
PlayerTeam = 3,
Smartie = 4,
Disciple = 5,
Mission = 6
};
2021-01-24 00:40:09 +01:00
enum class ChatFlag
{
None = 0,
InsertName = 1 << 6,
Team = 1 << 5
};
2020-08-27 08:10:21 +02:00
enum class GameOption : unsigned char
{
DamageTeammates, // Toggle damage teammates on/off
PhFF, // Toggle party house friendly fire on/off
PMarkers, // Toggle player marker size
EndGame, // End the game immediately
Detente, // Add time to detente
Smarties, // Change max. smarties
Vimps, // Toggle vimps on/off
TeamChanges, // Toggle team changes on/off
PlayerScoreLimit, // Change player score limit
TeamScoreLimit, // Change team score limit
};
enum class KickReason
{
Removed,
LostConnection
};
enum class NetPlayerState
{
None = 0,
Setup = 1,
HostConfiguring = 2,
HostStartLoading = 3,
HostWorldLoading = 4,
HostPreloading = 5,
JoinWorldWaiting = 6,
JoinStartLoading = 7,
JoinWorldLoading = 8,
JoinPreloading = 9,
JoinObjectWaiting = 10,
JoinObjectLoading = 11,
Ready = 12,
Server = 13,
Active = 14,
};
enum class GameTeam
{
None = -1, // -1 for backwards compatibility
MvM = 0,
MvMvM,
RvR,
MvR,
MvRvK,
MvK,
RvK,
};
struct PlayerInfo
{
PlayerIndex index = 0;
2021-02-28 09:46:21 +01:00
tstring name;
2020-08-27 08:10:21 +02:00
float score = 0;
float deaths = 0;
int ping = 0;
PlayerTeamIndex team = 0;
bool host = false;
NetPlayerState state = NetPlayerState::None;
2021-02-28 09:46:21 +01:00
IPAddress ipAddress;
2020-08-27 08:10:21 +02:00
};
struct NetGameSettings
{
bool allowNewPlayers = false;
bool damageTeammates = false;
int pointsPerKill = 0;
int pointsPerCapture = 0;
int capturePreventCountInMinutes = 0;
float capturePreventCountTime = 0.0f;
int maxPlayers = 0;
bool lockTeams = false;
int smartieDifficulty = 0;
int vimpMeatDifficulty = 0;
bool vimpsDisabled = false;
bool weaponAvailabilityModified = false;
int worldId = 0;
2021-02-28 09:46:21 +01:00
tstring sessionName;
2020-08-27 08:10:21 +02:00
};
struct NetGameDetails
{
// User-adjustable settings for the current game.
NetGameSettings settings;
2021-02-28 09:46:21 +01:00
tstring worldName;
tstring teamTypeName;
tstring gameTypeName;
2020-08-27 08:10:21 +02:00
};