Skip to content

Network data

Alexandre 'Kidev' Poumaroux edited this page Apr 25, 2023 · 1 revision

Useful enums/data sent over the network

From aag.Natives

The NetTags and their enums values

Handshakes

enum Handshakes {
	Init,
	GameServerWelcome,
	RedeemMatchmakerTicket,
	AuthenticateSessionTicket,
	AuthenticateAsGameServer,
	LobbyReady,
	UpdateLoginQueuePosition,
	RequestGameServerWelcome,
	ClientConnectedToLogin,
	ClientLoginHandshake
}

Sent by client to server

enum ClientToServerMessages {
	Build,
	AbilityCommand,
	Hire,
	Train,
	CancelTrain,
	Select,
	Research,
	RefreshAreaOfInterest,
	UpgradeBatch,
	ChoosePowerup,
	RequestSyncUnit,
	SendGameChat,
	RequestMapFile,
	FinishedLoadingScreen,
	DoneLoadingGame,
	AckServerTime,
	SendMapPing,
	ViewCameraBookmark,
	SetAfkStatus,
	VoluntarilyQuit,
	SendChatRoomChat,
	RequestDisplayName,
	RequestCustomGameRoom,
	RequestCustomGameServer,
	RequestMatchmadeGameServer,
	CancelMatchmakingRequest,
	RequestMatchmakingTweak,
	SendInviteToCustomGameRoom,
	TryJoinCustomGameRoom,
	TryOpenSlot,
	TryCloseSlot,
	TrySetBotSlot,
	TryMoveSlot,
	TryLeaveCustomGameRoom,
	TryRefreshCustomGameRooms,
	TryJoinChatRoom,
	ChatRoomCommand,
	SetCustomGameSetting,
	SendInviteToParty,
	AcceptPartyInvite,
	RejectInviteToParty,
	LeaveParty,
	KickFromParty,
	StayAsTeam,
	RequestLobbyCallback,
	RequestTagline,
	RequestAvatar,
	RequestTwitch,
	UpdateOwnedDLC,
	RequestReportPlayer,
	RequestSteamId,
	SendRefreshLoadingProgress,
	ConsumeItem,
	ChooseMission,
	SendBotCommand,
	RequestLoadingProgresses,
	SetCustomGamePlayerSetting,
	RequestBackendData,
	SetCustomGameSharedSetting,
	RequestChatRoomSubscribers,
	ForwardedJoinParty,
	ForwardedLeaveParty,
	ForwardedCreateParty,
	TryQueueUpAsParty,
	LoadSavedTowerBuild,
	RequestPlayVsAIGameServer,
	RequestMatchmakingV2,
	ForwardedEnteredOrLeftMatchmakingV2,
	AvailableForQuickMatch,
	ReadyForQuickMatch,
	RequestAcceptPartyInvite,
	PartyMemberMatchFound,
	UpdateLastActivity,
	RequestDiscordChatHistory,
	ChooseMastermindVariant,
	ConvertItemToEssence,
	ConvertItemToEssenceResult,
	RequestGuildUpdate,
	AcceptInviteToGuild,
	BrowseGuildsSearchByAbbreviation,
	GuildClientAction,
	ChooseInitialExperienceLevel,
	TryPauseGame,
	RequestRefreshGameCoachTip,
	RequestClassicInHouseGameServer,
	SkipTutorial,
	RefreshAutosendEnabled,
	RequestOpeningsLeaderboard,
	RequestOpeningsMatchHistory,
	ChooseExtraGoldVariant,
	StartCustomClassicGame,
	GiftAFriend,
	TryCancelAutopause,
	LogToServer,
	RequestAutomaticItemUnlock,
	ClientToServerKeepAlive,
	WantsToDualBuild,
	OkLetsDualBuild,
	TellPartyMyCampaignDlcOwnership,
	QueueAction,
	CollectMasteryReward,
	RefreshBuildCursor,
	CastInboxVote,
	SendModeVotingVote,
	SendDiscordChatMessage
}

Sent by server to client

enum ServerToClientMessages {
	UnitKeyframesBatch,
	AutoAttackMissileBatch,
	AbilityMissileBatch,
	SpecialEffectBatch,
	UnitSpecialEffectBatch,
	ForceSyncUnitBatch,
	UpdatePlayerNameTimeline,
	UpdatePlayerImageTimeline,
	UpdatePlayerControllerTimeline,
	UpdatePlayerGoldTimeline,
	UpdatePlayerMythiumTimeline,
	UpdatePlayerFoodUsedTimeline,
	UpdatePlayerFoodCapTimeline,
	UpdatePlayerIncomeTimeline,
	UpdatePlayerValueTimeline,
	UpdatePlayerWorkersTimeline,
	UpdatePlayerConnectedTimeline,
	UpdatePlayerDefenderPlayerTimeline,
	UpdatePlayerAttackerPlayerTimeline,
	UpdatePlayerAfkStatusTimeline,
	UpdatePlayerPowerupChoicesTimeline,
	UpdatePlayerPowerupSelectedTimeline,
	UpdatePlayerMutedTimeline,
	UpdatePlayerTotalGoldFromIncomeTimeline,
	UpdatePlayerTotalGoldFromEnemyLeaksTimeline,
	UpdatePlayerTotalGoldLostToLeaksTimeline,
	UpdatePlayerTotalEnemyTeamGoldFromYourLeaks,
	UpdatePlayerTotalGoldFromCatchingLeaks,
	UpdatePlayerMythiumGatherRate,
	UpdatePlayerRolls,
	UpdatePlayerTotalMythium,
	UpdatePlayerLeakedPercentOnWave,
	UpdateChatTimeline,
	UpdateSquareOccupyTimeline,
	UpdateResearchLevel,
	MakeSquaresBuildable,
	PlaySoundAtPoint,
	PlaySoundFromUnit,
	PlayGlobalSound,
	UnitKilledEvent,
	CreateFloatingText,
	CustomEvent,
	ConsoleLog,
	TitleDataChanged,
	RefreshDataReports,
	SetHudSource,
	SetMinimapImage,
	SetHudInfo,
	SetWaveNumber,
	SetWaveTime,
	SetWaveTimerPaused,
	SetWestEnemiesRemainingText,
	SetEastEnemiesRemainingText,
	DisplayGameText,
	LoadView,
	LoadPopup,
	LoadOkPopup,
	LoadUnclickablePopup,
	LoadClientNotification,
	MapPing,
	SetCameraPosition,
	ShowRerollWindow,
	ShowPowerupsWindow,
	SetResearchLevels,
	RefreshMercenariesReceived,
	ConfirmUnitHired,
	SetRegionVisible,
	SetRegionHidden,
	ForceHideUnit,
	ForceSyncPlayer,
	SyncPlayerController,
	ForceSetPlayerId,
	GameStarted,
	AttachSpecialEffectToUnit,
	Map,
	SendMapFile,
	SendServerTime,
	AckAckServerTime,
	NetworkError,
	SyncTimeHeartbeat,
	Authenticated,
	AuthenticatedWithLobby,
	JoinCustomGameRoom,
	UpdateCustomGameRoomSlot,
	BootedFromCustomGameRoom,
	CustomGameRoomDisbanded,
	InvitedToCustomGameRoom,
	RefreshCustomGameRooms,
	GameNoLongerExists,
	GameAlreadyStarted,
	ErrorStartingGame,
	RefreshCustomGameSettings,
	ChatRoomChat,
	SetChatRoomProperties,
	RefreshChatRoomSubscribers,
	RefreshChatRoomHistory,
	MatchFound,
	MatchFoundCanceled,
	GameServerReady,
	MatchmakingForbidden,
	MatchmakingRequestCanceled,
	MatchmadeGameServerRequested,
	MatchInfo,
	RefreshLoadingProgress,
	RefreshDeltaMultiplier,
	LobbyCallbackResult,
	InvitedToParty,
	RefreshPartyMembers,
	KickedFromParty,
	PostGameStats,
	RequestSteamIdResult,
	RequestReportPlayerResult,
	SetDisplayNameResult,
	RequestTaglineResult,
	RequestAvatarResult,
	RequestTwitchResult,
	CustomLog,
	SetSpectatorHud,
	AddMatchModifier,
	SetMatchModifiers,
	ConsumeItemResult,
	BeatMission,
	ForcePickLegion,
	SetHudEnabled,
	CreateTutorialGroundText,
	CreateTutorialArrowText,
	RefreshObjectives,
	RefreshPlayersInQueue,
	PartyMembersChanged,
	UpdatePlayerDualBuilding,
	RefreshPlaybackRate,
	BackendDataResult,
	ConfirmUnitTrained,
	RefreshPlayerStackrank,
	ForceSelectUnit,
	UpdatePlayerExtraRecommendedValue,
	UpdateTowerScoreboard,
	SetBarracksEnabled,
	JoinSoloParty,
	RefreshLoadingStickerSuffix,
	ReceiveMysteriousCard,
	MatchmakingPlayerReady,
	MatchmakingPlayerReadyFailed,
	MatchmakingPlayerAllReady,
	SavedTowerBuild,
	RefreshLeakRatio,
	UpdatePlayerLegionUnitType,
	PlaySpecialTheme,
	UpdateReadyPlayers,
	ForwardedTryJoinCustomGameRoom,
	ChangeChannel,
	RequestCustomGameRoomListing,
	CustomGameRoomListingResult,
	ReadyForMatchmakingV2,
	SetObjectFailed,
	UpdatePlayerPartyMembersTimeline,
	LeaveQueueToFormQuickMatch,
	GenericGameServerRequested,
	RequestTryJoinCustomGameRoom,
	PartyRecoveryFailed,
	ForwardedPartyMemberMatchFound,
	UpdateKingStacks,
	DiscordChatMessage,
	ShowMastermindVariantWindow,
	RefreshLoadingStickerExtras,
	ConvertItemToEssenceResult,
	RefreshDeployStacks,
	ShowChallengeVictoryWindow,
	RequestGuildUpdateResult,
	InvitedToGuild,
	TryJoinGuildResult,
	ForceRefreshInbox,
	KickedFromGuild,
	SyncGuildEmblem,
	SyncUnitGarrison,
	DisplayPlayerLeakedText,
	BrowseGuildsSearchByAbbreviationResult,
	RefreshGoldBountyRemaining,
	ConfirmInitialExperienceLevel,
	PartyIsAvailableForQuickMatch,
	RefreshInGameCoach,
	ForceMaintenancePopup,
	MatchmakingV1RequestFailed,
	ConfirmSkipTutorial,
	RefreshMonuments,
	EarnIngameAchievement,
	RequestOpeningsLeaderboardResult,
	RequestOpeningsMatchHistoryResult,
	ShowExtraGoldVariantMenu,
	RefreshPlayerDamageTracker,
	ConfirmGiftAFriend,
	UpdateAutopauseTimer,
	RefreshAutosendStatus,
	RefreshPlayerOpenings,
	RefreshSpectatorWinProbabilities,
	RefreshPlayerRerolls,
	RefreshFiestaGold,
	ServerToClientKeepAlive,
	ForwardedWantsToDualBuild,
	ForwardedOkLetsDualBuild,
	MaphackEnabled,
	ForwardedTellPartyCampaignDlcOwnership,
	SyncQueueState,
	PlayGlobalWhatSound,
	CollectMasteryRewardResult,
	ShowVersusOverlay,
	UpdateBuildCursor,
	CastInboxVoteResult,
	ShowModeVotingMenu,
	UpdateModeVotingPlayers,
	DisplayPickedMode,
	PromptDoubleLockIn
}

Snapshots

Is a full static class representing the actual game state, often exchanged. Here is available data:

static class Snapshot
{
	// Method
	void Dump(string filename);
	
	// Events
	event SimpleEvent OnReset;
	event SimpleEvent OnPaused;
	event SimpleEvent OnLogicalTickDynamic;
	event SimpleEvent OnDump;
	event SimpleEvent OnDoneReset;
	event SimpleEvent OnSkippedTooManyRefreshes;
	event SimpleEvent OnSkippedTooManyRefreshesSecondPass;
	
	// Properties
	long RenderTime { get; }
	long RenderTimeOffset { get; set; }
	long CurrentTime { get; set; }
	long DeltaTicks { get; set; }
	long ActualTime { get; }
	bool IsPaused { get; }
	string CurrentMap { get; set; }
	bool GameStarted { get; set; }
	string HudTheme { get; set; }
	bool GivingWaveRewards { get; set; }
	int SuddenDeathCount { get; set; }
	double ElapsedSeconds { get; }
	string LastSaveFilePath { get; set; }
	
	// Fields
	bool IsServer;
	bool IsLobby;
	double ElapsedSecondsTestOffset;
	bool EnableVerboseLogging;
	double ElapsedSecondsAtBeginningOfTick;
	double ElapsedSecondsLastHandler;
	List<SimpleEvent> onLogicalTickEvents = new List<SimpleEvent>();
	long actualTime;
	long ExpirationTime = 0L;
	float PlaybackRate = 1f;
	float RefreshRate = 1f;
	int MessageNumber = 0;
	readonly UnitProperties[] UnitProperties = new UnitProperties[2000];
	readonly PlayerProperties[] PlayerProperties = new PlayerProperties[17];
	readonly PulseTimeline<ChatMessage> ChatHistory = new PulseTimeline<ChatMessage>(new Action<ushort, ChatMessage>(PlayerApi.ReceiveChatMessage));
	readonly ActionTimeline Actions = new ActionTimeline();
	readonly PulseTimeline<ConstructionInfo> Constructions = new PulseTimeline<ConstructionInfo>(new Action<ushort, ConstructionInfo>(SquareApi.ConstructUnit));
	readonly PulseTimeline<VisibilityShape> SetVisibles = new PulseTimeline<VisibilityShape>(new Action<ushort, VisibilityShape>(VisibilityApi.SetAreaVisible));
	readonly PulseTimeline<VisibilityShape> SetHiddens = new PulseTimeline<VisibilityShape>(new Action<ushort, VisibilityShape>(VisibilityApi.SetAreaHidden));
	readonly IPositionTracker Grid = new SpatialHashTracker();
	readonly bool[] IsColliderEnabled = new bool[2000];
	readonly Velocity[] CachedVelocity = new Velocity[2000];
	readonly Point[] CachedPosition = new Point[2000];
	readonly float[] CachedMaxSpeed = new float[2000];
	readonly AngleValue[] CachedFacing = new AngleValue[2000];
	readonly bool[] CachedActive = new bool[2000];
	readonly bool[] CachedAlive = new bool[2000];
	readonly bool[] CachedAliveAndUnpaused = new bool[2000];
	readonly TargetFilter[] CachedFlags = new TargetFilter[2000];
	Stopwatch stopwatch = new Stopwatch();
	Stopwatch elapsedTimeStopwatch = new Stopwatch();
	long lastActualTime;
	long lastElapsedMilliseconds;
	long tickDifferential;
	float leftoverDeltaFromLastTick;
	bool paused;
	bool isDirty;
	bool dumped;
	int GameTickTimeoutMilliseconds = 2000;
	int NumberOfRefreshesSkipped = 0;
	int NumberOfCongestedRefreshes = 0;
}

Sent by server to client for debug

enum ServerToClientDebugMessages {
	ShowInspector,
	SyncInspector
}