Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetDriver support #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

NetDriver support #4

wants to merge 4 commits into from

Conversation

Shtoyan
Copy link
Contributor

@Shtoyan Shtoyan commented May 28, 2023

I've tested it for ut2k4 steam version, without any issues. If you want to test yourself here is a template:

class NetDriverTest extends Mutator;

event PrebeginPlay() {
    super.PrebeginPlay();

    DoTest();
}

private final function DoTest() {
    local UNetDriverCast UNetDriverCast;
    local UNetDriver UNetDriver;
    local UPackageMap UPackageMap;
    // local ULevelCast ULevelCast;
    // local ULevel ULevel;
    local object obj;
    local int i;

    // retrieve UNetDriver var #1
    // ULevelCast = new() class'ULevelCast';
    // pass `Level` reference
    // ULevel = ULevelCast.Cast(Level);
    // UNetDriver = ULevel.NetDriver;

    // retrieve UNetDriver var #1
    foreach level.allObjects(class'object', obj) {
        if (obj.IsA('NetDriver')) {
            warn("GOTCHA NetDriver!");
            break;
        }
    }
    UNetDriverCast = new() class'UNetDriverCast';
    UNetDriver = UNetDriverCast.Cast(NetDriver(obj));

    // do something useful
    UPackageMap = UNetDriver.MasterMap;
    log("UPackageMap.List length: " $ UPackageMap.List.Length);
    for (i = 0; i < UPackageMap.List.length; i++) {
        log(i $ ". package - " $ UPackageMap.List[i].Parent.name);
    }
}

I hope there are no f*ps and no one's PC will be formatted D

@Shtoyan
Copy link
Contributor Author

Shtoyan commented May 28, 2023

P.S. For lazy and interested people, vanilla ut2k4 package map content:

Hit me UPackageMap.List length: 200
  1. DM-Flux2
  2. Engine
  3. Core
  4. AlleriaArchitecture
  5. UCGeneric
  6. CubeMaps
  7. XGameShaders
  8. Shiptech
  9. PlayerSkins
  10. XGameTextures
  11. TeamSymbols_UT2003
  12. AlleriaHardware
  13. AlleriaHardwareBrush
  14. AlleriaTerrain
  15. XceptOne
  16. SkyRenders
  17. dom-goose
  18. FireEngine
  19. Fire
  20. MikeDemoLevel
  21. ArboreaArchitecture
  22. H_E_L_Ltx
  23. Egypt_tech_Epic
  24. ArboreaTerrain
  25. AbaddonArchitecture
  26. 2K4reducedTEXTURES
  27. EmitterTextures
  28. XGame
  29. UnrealGame
  30. Gameplay
  31. AS_FX_TX
  32. GameSounds
  33. AnnouncerAssault
  34. EpicParticles
  35. Editor
  36. InterfaceContent
  37. intro_characters
  38. AW-2004Particles
  39. AWGlobal
  40. TowerTerrain
  41. AbaddonTerrain
  42. AbaddonArchitecture-epic
  43. PickupSkins
  44. VMVehicles-TX
  45. AW-Metals
  46. AW-Cubes
  47. jm-prefabs
  48. TauntPack
  49. XEffects
  50. XEffectMat
  51. WeaponSounds
  52. ParticleMeshes
  53. ONSVehicleSounds-S
  54. ExplosionTex
  55. XGameShadersB
  56. DefaultFluid
  57. PlayerSounds
  58. AW-2004Explosions
  59. WeaponStaticMesh
  60. WeaponSkins
  61. ArboreaLanscape
  62. GeneralAmbience
  63. WarEffectsTextures
  64. DeployableTex
  65. NewDeath
  66. XGame_rc
  67. SC_Volcano_T
  68. AnnouncerFemale2K4
  69. XPickups
  70. E_Pickups
  71. PickupSounds
  72. XPickups_rc
  73. TeamSymbols
  74. XGame_StaticMeshes
  75. DanFX
  76. Phobos2_cp
  77. CP_Effects1
  78. 2k4ChargerMeshes
  79. 2K4Chargers
  80. XGameShaders2004
  81. DeRez
  82. DemoPlayerSkins
  83. UT2004Weapons
  84. GeneralImpacts
  85. NewWeaponPickups
  86. LastManStanding
  87. HUDContent
  88. MenuSounds
  89. ThunderCrash
  90. HumanFemaleA
  91. HumanMaleA
  92. XWeapons
  93. XWeapons_rc
  94. Weapons
  95. NewWeapons2004
  96. NewSniperRifle
  97. 2K4Hud
  98. NewWeaponSounds
  99. InstagibEffects
  100. IndoorAmbience
  101. NewWeaponStatic
  102. XceptTwo
  103. XceptOneObjA
  104. OutdoorAmbience
  105. XInterface
  106. Crosshairs
  107. AnnouncerMale2K4
  108. 2K4Menus
  109. ExitScreen
  110. ServerIcons
  111. MenuEffects
  112. 2K4MenuSounds
  113. SinglePlayerThumbs
  114. Vehicles
  115. VehicleFX
  116. BulldogMeshes
  117. EffectMeshes
  118. TeamSymbols_UT2004
  119. BonusPack
  120. MutantSkins
  121. TowerStatic
  122. cassTextures2
  123. Shiptech2
  124. ArboreaHardwareBrush
  125. cf_tex01
  126. AW-Alleria
  127. Pipe_Set
  128. HumanoidArchitecture
  129. Egypt_techmeshes_Epic
  130. BarrensArchitecture-epic
  131. BarrensArchitecture
  132. HumanoidHardware
  133. HumanoidHardwareBrush
  134. AbaddonHardwareBrush
  135. SkaarjPack_rc
  136. SkaarjPackSkins
  137. SkaarjPack
  138. AnnouncerEvil
  139. UTClassic
  140. SniperAnims
  141. UT2k4Assault
  142. AS_Weapons_SM
  143. AS_Weapons_TX
  144. Detail
  145. VMParticleTextures
  146. AssaultSounds
  147. AS_Vehicles_M
  148. AS_Decos
  149. cp_staticmeshskin1
  150. cp_texturetest1
  151. VMWeaponsTX
  152. ONSInterface-TX
  153. VMStructures
  154. ONSstructureTextures
  155. AS_Vehicles_SM
  156. AS_Vehicles_TX
  157. Turrets
  158. AssaultFilmGrain
  159. Onslaught
  160. ONSDeadVehicles-SM
  161. ONSDeadVehicles-TX
  162. ONSWeapons-A
  163. VMGeneralSounds-S
  164. VMWeaponsSM
  165. ONSWeapons-SM
  166. ONSVehicles-A
  167. ONSstaticMeshVehicles
  168. TurretParticles
  169. BenTex01
  170. AW-ShieldShaders
  171. VMVehicleSounds-S
  172. ONSNewTank-A
  173. VMmeshEmitted
  174. GUI2K4
  175. PlayerPictures
  176. ULogo
  177. UT2k4AssaultFull
  178. AS_VehiclesFull_M
  179. JWAssaultMeshes
  180. OnslaughtFull
  181. ONSFullTextures
  182. ONSFullStaticMeshes
  183. ONSFullAnimations
  184. Lev_Particles
  185. GenericSD
  186. xVoting
  187. OnslaughtBP
  188. ONSBPTextures
  189. AW-2k4XP
  190. ONSBP_DestroyedVehicles
  191. ONSBPSounds
  192. CicadaTex
  193. ONS-BPJW1
  194. X_SC-City
  195. SC-City
  196. BonusParticles
  197. ONSBPAnimations
  198. CicadaSnds
  199. DistantBooms
  200. AssaultBP

Shtoyan added 2 commits May 29, 2023 14:04
And fix `UNetConnection.GetChannel()` return type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant