XC_Engine - XC_GameEngine extension for UT99 by Higor.


===========
Setting up:
===========
Place XC_Engine binary in your ~UT/System/ directory.
The new GameEngine we want to load has to be specified in UnrealTournament.ini (or it's server equivalent) as follows.

[Engine.Engine]
;GameEngine=Engine.GameEngine
GameEngine=XC_Engine.XC_GameEngine

Be adviced, when editing ServerPackages and ServerActors in a XC_Engine server, find the [XC_Engine.XC_GameEngine] entry!!!
Either remove it (and apply on GameEngine), or apply the changes on said (XC_GameEngine) entry instead.

Safe to use in v436-v451, and on ACE servers since most hacks are reverted during online sessions (99% sure lol).
Just avoid AnthChecker servers until they have whitelisted this binary.



=================
Global features:
=================
- (All) Logging when the native functions in the engine Start/End for better documentation.
- (Dedicated Server) Initialization and update of Moving Brush Tracker in Dedicated servers.
- (Server) Ability to send 'undownloadable' maps.
- (Server, Standalone player) Faster map list generation algorithm via GetMapName() native hack.
- (Server, Standalone player) Retrieval of map list can now be sorted globally or by folder.
- (All) Makes several properties from native only classes visible to UnrealScript, player commands and edit windows (win32). Below table for more info.
- (All) Timing fix for computers that change CPU frequencies (STILL NEEDS DUALCORE FIX INSTALLED!)
- (Server, Standalone player) PlayerPawn.GetWeapon function enhanced in runtime, works in any engine version.
- (Server, Standalone player) ScriptedPawn.SetEnemy function enhanced in runtime, attacks bots as well.
- (Server, Standalone player) UT_Eightball.NormalFire.Tick function enhanced in runtime, accessed none log warning fixed when use by bots.
NEW:
- (Server) TravelManager subsystem providing extended inventory handling for Coop games (don't lose items on reconnect).
- (Dedicated Server) Moving brush tracker fix can no be ignored on certain user-defined maps.


================
Extra commands:
================
- CACUS			-	Test command, logs a line.

- LOADMAP mapname	-	Test command, loads and initializes another map into memory, but doesn't update or render it, simply stays in the background hogging memory.

- EditObject Name=Objectname Skip=skipcount
Client, Win32 only.
Brings up a property editor dialog of an object with a specified name.
Skip= is optional and can be used to bring up a newer objects with said name.

Example: "EditObject Name=MyLevel Skip=1"
Brings up play level's XLevel properties.

Example: "EditObject Name=MyLevel"
Brings up Entry level's XLevel properties.

- DumpObject Name=Objectname
Dumps object in question's memory block into a file (with the object's name).
Only finds the first object with matching name.
If the object is a UFunction, then it will also save a file name FUNCTIONDATA.bin with the script code (serialized TArray<BYTE>).

- LogFields Name=classname
Logs all of the UnrealScript visible properties of the specified class, with property flags, offset, size and array count.
Boolean properties have their bitmask info logged instead of array size.

- TravelInfo
Lists players and their items in the Single Player travel list!

- LogClassSizes Outer=packagename(optional)
Prints in log a huge list of classes and their size in memory.
If the Outer=packagename parameter isn't used (or fails), it will print all classes's sizes.

- ToggleTimingFix - TimingFix
Toggles the timing fix on/off.
Timing fix is enabled by default and is saved in [XC_Engine.XC_GameEngine] config entry.



===================
Exposed properties:
===================
Additional properties are now visible on certain native classes and their subclasses, these increase the potential functionality of servers and clients running mods coded to access them via GetPropertyText() or GET commands.
= CLASS -> CPP_PropertyName -> UScript_PropertyName (type) (flags)

- GameEngine		-> GLevel		-> Level   (Level)   (const, editconst)
- GameEngine		-> GEntry		-> Entry   (Level)   (const, editconst)

- DemoRecDriver		-> DemoFileName		-> DemoFileName   (string)   (const, editconst)

- LevelBase		-> NetDriver		-> NetDriver   (obj NetDriver)   (const, editconst)
- LevelBase		-> DemoRecDriver	-> DemoRecDriver   (obj NetDriver)   (const, editconst)
- LevelBase		-> Engine		-> Engine   (obj Engine)   (const, editconst)
- LevelBase		-> URL.Protocol		-> URL_Protocol   (string)   (const, editconst)
- LevelBase		-> URL.Host		-> URL_Host   (string)   (const, editconst)
- LevelBase		-> URL.Port		-> URL_Port   (int)   (const, editconst)
- LevelBase		-> URL.Map		-> URL_Map   (string)   (const, editconst)
- LevelBase		-> URL.Op		-> URL_Options   (array<string>)   (const, editconst)
- LevelBase		-> URL.Portal		-> URL_Portal   (string)   (const, editconst)



=============================
Own XC_GameEngine properties:
=============================
- b451Hack   (bool)   (const, editconst)   (default)
v451 XC_GameEngine loaded.
Stored as default property, can be read with a simple GET command.

- bHackingInit   (bool)   (const, editconst)
Initialization hack to prevent crash in a hardcoded GameEngine check.
Only TRUE between GameEngine::Init and first GameEngine::LoadMap command.

- bHackingTracker   (bool)   (const, editconst)
Indicates that XC_GameEngine is handling the moving brush tracker.
Only true in Dedicated servers where the loaded map has movers.

- bHackedEngine   (bool)   (const, editconst)
Simple indicator that GetMapName() native currently in use is XC_Engine's one.
Should ALWAYS be false on client net play (REPORT ME IF NOT).

- bSetEnemy   (bool)   (const, editconst)
Indicates that UnrealShare is loaded, and ScriptedPawn.SetEnemy has been patched.
Never set if client is connected to a server (prevent ACE integrity check kicks).

- bRocketTick   (bool)   (const, editconst)
Indicates that Botpack is loaded, and UT_Eightball.NormalFire.Tick has been patched.
Never set if client is connected to a server (prevent ACE integrity check kicks).

- MapCache   (array<string>)   (const, editconst)
Dynamic array of map names generated by latest GetMapName() function.
This list only persists for the remainder of current Tick.

- bDisableTimingFix   (bool)   (config)   (default=false)
Disables timing fix.

- MSecTimer    (int[10])   (const, editconst)
Logged system milliseconds, used for calculating the timing factor.
This value should update every 0.1 second, and increase in all slots by ~100.

- bDisableBrushTracker   (bool)   (config)   (default=false)
Disables XC_Engine's addition of Brush Tracker.

- bSortMaplistByFolder   (bool)   (config)   (default=false)
Sort the map cache alphabetically by folder.

- bSortMaplistGlobal   (bool)   (config)   (default=false)
Sort the entire map cache alphabetically.
This overrides the previous setting, activate either of both if you're having sorting issues in your server.

NEW
- TravelManager   (obj XC_TravelManager)   (const, editconst)
Pointer to the TravelManager subsystem, always active.

- bAutoTravelManager   (bool)   (config)   (default=true)
TravelManager rebuilds the travel lists every two seconds.

- NoBrushTrackerFix   (array<string>)   (config)
List of maps we want to exclude from using the brush tracker fixer (only works in dedicated server mode), ex (~UT.ini):
NoBrushTrackerFix=CTF-Niven
NoBrushTrackerFix=etc...


=================
XC_TravelManager:
=================
The XC_TravelManager is a custom subsystem that's initialized at application start (along other subsystems).
It can receive console commands (none implemented yet) and receives Tick() from the XC_GameEngine when a server is running.

=== Global Features:
- Automatically corrects the existing level's travel list owner (if any) when a player changes name.
If a player's new name already has an existing travel entry, the name change is reverted!.
This means that a player cannot override an existing travel entry with his own.

When (XC_GameEngine.bAutoTravelManager = True):
- Scans current connections and updates the client's travel list items every two seconds.
The scanning is performed using class and property caching, avoiding any kind of slowdowns in extremely high traffic theoretical scenarios.
The most obvious effect of enabling this setting, is the ability to recover all items/status a player had prior to disconnection.
Ability to persist between level changes (same mission) not yet implemented.
This can be turned on or off in runtime safely.

=== Commands:
Not yet implemented.


=== Properties:
- bAutoMode   (bool)   (const, editconst)
Reflects the bAutoTravelManager setting on XC_GameEngine

- Engine   (obj XC_GameEngine)   (const, editconst)
Pointer to the XC_GameEngine.


=================
Credits:
=================
I would like to thank my fellow betatesting team
- Chamberly
- ~V~ (test this on linux please!)
And all of Cham's development server visitors for the help in bugfixing this.

Would also like to thank AnthRAX for allowing a linux build to be possible.

And to the website owners where I downloaded very educational sample codes of Unreal Engine 2 and 3 (lol!)