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.
Just avoid AnthChecker servers until they have whitelisted this binary.
NOTE: Due to the nature of Linux builds, XC_Engine will only work on version 436.


=================
Global features:
=================
Note:
(Conditional) Means
- (All) in Linux builds
- (Server, Standalone player) In Win32 builds, auto-disables itself when joining a server.

- (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.
- (Dedicated Server) Moving brush tracker fix can be ignored on certain user-defined maps.
- (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.
- (Server, Standalone player) Bot.SetOrders function enhanced in runtime, accessed none log warning fixed when issued with monsters in the map.
- (Conditional) PlayerCanSeeMe() native function replaced with a bugfixed and crash-free version.
- (Conditional) CollidingActors iterator native. (fixed)
- * (Conditional) Dynamic array support for UnrealScript.
- * (Conditional) AddToPackageMap native, packages supporting this feature can autoregister themselves, no need for dynamic loaders.
- * (Conditional) IsInPackageMap native, checks if a package is sent to clients, also checks if it exclusively belongs to ServerPackages list.
* Code compiled with these opcodes should be cross-compatible with Unreal 227.
- (Server) PreLogin hook allows other actors to deny players from joining servers.
- (Server) TravelManager subsystem providing extended inventory handling for Coop games (don't lose items on reconnect).
- (All) Version 451 GET and SET command functionality.
- (Server, pre v451) AdminLogin hook allows other actors to handle admin login requests based on player, included example handling brute forcing.
- (Server, pre v451) Some v451 lag exploit fixes.
- (Client) Automatic cache conversion to desired directories.
- (All) Collision Octree replacing the old hash. (experimental)
- (All) Cleaner map switch by nulling out transient actor references to the main level.
- (Server) Added bUseReplicationHack, allows some relevancy checks to go through translucent surfaces.
- (Server) Worked around RELIABLE_BUFFER crash on Windows servers.
- (Server) New Relevancy loop code that allows better visibility checks on actor replication, also fixes a few flaws on net priority.
- (Server) Some basic anti-flood protection for incoming connections and net driver.

NEW
- (Conditional) XC_Core natives have their numbered opcodes enabled for use without package dependancy.
- (Client) XC_IpDrv HTTP Downloader, can retrieve and decompress LZMA files.
- (All, Win32) XC_IpDrv.XC_TcpNetDriver experimental net driver.


=================
XC_IpDrv:
=================
Needed to use the HTTP LZMA file downloader.

Contains an experimental net driver that works better with XC_ConnectionHandler set at high 'ExtraTCPQueries' amounts.
The net driver XC_IpDrv.XC_TcpNetDriver is only operational in the Win32 build.

================
Extra commands.
Check other documentation files for more commands.
================
- 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.

- 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.

- ToggleDebugLogs - DebugLogs
Toggles additional logging, for developers.
Disabled by default, saved in [XC_Engine.XC_GameEngine] config entry.

- PreLoginHook actor_name
For code usage, lets an actor register itself in the PreLoginHooks list.

- AdminLoginHook actor_name
For code usage, lets an actor register itself as the AdminLoginHook actor (overrides previous one).

- OctreeDebug Name=actor_name
Prints FCollisionCacus information for an actor (if contained in the Octree system).

- TimeFactor
Displays the Time Manager's current time scaler, if active.
TRIVIA: Values other than 1 (or approximate) indicate that XC_Engine is the one responsible
for keeping your game running at normal speed.

- ToggleRelevancy - ToggleRelevant
Requires bUseLevelHook.
Toggles XC_Level relevancy loop on net servers, when enabled:
=> Actor consider list is created once per frame instead of every player check.
=> Visibility checks happen less often on relevant actors.
=> Visibility checks go through most transparent/invisible surfaces.
=> Visibility checks are done against a random point of the actor's box.
=> Player, Viewtarget and Player owned actors are given higher priority.
=> Actors that pass relevancy aren't checked again for a short while.


===================
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)
- LevelBase		-> Actors.Num()		-> ActorListSize   (int)   (const, editconst)
- Level			-> iFirstDynamicActor	-> iFirstDynamicActor   (int)   (const, editconst)
- Level			-> iFirstNetRelevantActor -> iFirstNetRelevantActor   (int)   (const, editconst)

- NetDriver		-> ClientConnections	-> ClientConnections   (array<obj NetConnection>)   (const, editconst)
- NetDriver		-> ServerConnection	-> ServerConnection   (obj NetConnection)   (const, editconst)



=============================
Own XC_GameEngine properties:
=============================
- XC_Version   (int)   (const, editconst)
Stored in defaults, accesible via "GET INI:ENGINE.ENGINE.GAMEENGINE XC_VERSION"
Also accesible via "XC_Engine" console 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).

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

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

- 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.

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

- bCacheConvertAtJoin   (bool)   (config)   (default=false)
Copy and rename cache files from current server into it's corresponding system paths.

- bFasterUpload   (bool)   (config)   (default=true)
Forces a temporary NetSpeed of 1000001 on incoming clients for non-redirected downloads, reverts when finished.
The initial NetSpeed value is stored in ConfiguredNetSpeed during file download.

- bCollisionHashHook   (bool)   (config)   (default=true)
Initializes levels using the FCollisionCacus octree system instead of the FCollisionHash.

- bEnableDebugLogs   (bool)   (config)   (default=false)
Displays additional logs aimed at developers.

- bUseSetEnemyHook   (bool)   (config)   (default=true)
Let user allow XC_Engine to modify UnrealShare.SetEnemy function.

- 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...

- PreLoginHooks   (Actor[12])   (const, editconst)
List of actors currently registered on PreLoginHooks.
These actors already passed the checks needed to be in this list.

- AdminLoginHook   (actor)   (const, editconst)
Actor handling AdminLogin requests, already passed the checks needed to function.

- bUseLevelHook   (bool)   (config)   (default=true)
Hooks the level object after map load, allows it to execute XC_Engine code.

- bUseNewRelevancy   (bool)   (config)   (default=true)
Requires bUseLevelHook=True. See: - ToggleRelevancy - ToggleRelevant commands

NEW:
- b451Setup   (bool)   (const, editconst)
- b440Net   (bool)   (const, editconst)
Setup variables for binary compatibility.

- bHTTP_DLMGR   (bool)   (const, editconst)
HTTP Downloader replacer status, only true during join process while retrieving server packages info.


=================
Credits:
=================
I would like to thank my fellow betatesters
- Chamberly
- ~V~
- Nelsona
- SC]-[LONG_{HoF}
Would also like to thank:
- AnthRAX, for allowing a linux build to be possible.
- SicilianKill, for that v436 Linux server.

And all of Cham's development server visitors for the help in bugfixing this.
And to the website owners where I downloaded very educational sample codes of Unreal Engine 2 and 3 (lol!)