From a273c2607d29977188a68599b290ba70217f6173 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Fri, 16 Sep 2022 05:50:42 +0300 Subject: [PATCH] remove custom items --- ServerExt/Classes/ExtMenu_Gear.uc | 5 +- ServerExt/Classes/ExtPerkManager.uc | 9 - ServerExt/Classes/ExtPlayerReplicationInfo.uc | 103 ------------ ServerExtMut/Classes/ServerExtMut.uc | 156 +----------------- tools | 2 +- 5 files changed, 3 insertions(+), 272 deletions(-) diff --git a/ServerExt/Classes/ExtMenu_Gear.uc b/ServerExt/Classes/ExtMenu_Gear.uc index 599466d..e6fd815 100644 --- a/ServerExt/Classes/ExtMenu_Gear.uc +++ b/ServerExt/Classes/ExtMenu_Gear.uc @@ -2,7 +2,6 @@ class ExtMenu_Gear extends KFGFxObject_Menu; var ExtPlayerReplicationInfo ExtPRI; -// var KFGFxObject_TraderItems TraderItems; var KFGFxGearContainer_PerksSelection PerkSelectionContainer; var KFCharacterInfo_Human CurrentCharInfo; var string CharInfoPath; @@ -19,7 +18,6 @@ function InitializeMenu(KFGFxMoviePlayer_Manager InManager) LocalizeText(); EmoteList = class'ExtEmoteList'.static.GetEmoteArray(); InitCharacterMenu(); - // TraderItems = KFGameReplicationInfo(GetPC().WorldInfo.GRI).TraderItems; } function InitCharacterMenu() @@ -69,8 +67,7 @@ function OnOpen() return; CheckForCustomizationPawn(PC); - //GetGameViewportClient().HandleInputAxis = OnAxisModified; - + if (PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun) { // Players cannot change characters if they are in a game diff --git a/ServerExt/Classes/ExtPerkManager.uc b/ServerExt/Classes/ExtPerkManager.uc index 38f1eba..ebec5db 100644 --- a/ServerExt/Classes/ExtPerkManager.uc +++ b/ServerExt/Classes/ExtPerkManager.uc @@ -7,7 +7,6 @@ Class ExtPerkManager extends KFPerk; enum EReplicateState { REP_CustomCharacters, - REP_CustomInventory, REP_PerkClasses, REP_Done }; @@ -451,14 +450,6 @@ function ReplicateTimer() ++RepIndex; } break; - case REP_CustomInventory: // Replicate custom trader inventory - if (!PRIOwner.OnRepNextItem(PRIOwner,RepIndex)) - { - RepIndex = 0; - ++RepState; - } - else ++RepIndex; - break; case REP_PerkClasses: // Open up all actor channel connections. if (RepIndex>=UserPerks.Length) { diff --git a/ServerExt/Classes/ExtPlayerReplicationInfo.uc b/ServerExt/Classes/ExtPlayerReplicationInfo.uc index 4e6f24d..2f7dec7 100644 --- a/ServerExt/Classes/ExtPlayerReplicationInfo.uc +++ b/ServerExt/Classes/ExtPlayerReplicationInfo.uc @@ -18,13 +18,6 @@ struct FMyCustomChar // Now without constant. } }; -// For custom trader inventory. -struct FCustomTraderItem -{ - var class WeaponDef; - var class WeaponClass; -}; - var bool bIsMuted,bInitialPT,bIsDev,bHiddenUser,bClientUseCustom,bClientFirstChar,bClientCharListDone,bClientInitChars; enum E_AdminType @@ -58,10 +51,6 @@ var repnotify FMyCustomChar CustomCharacter; var transient array SaveDataObjects; var transient ExtPlayerReplicationInfo LocalOwnerPRI; // Local playercontroller owner PRI -// Custom trader inventory -var KFGFxObject_TraderItems CustomList; -var array CustomItems; - // Supplier data: var transient struct FSupplierData { @@ -237,98 +226,6 @@ function UnsetPT() bInitialPT = false; } -Delegate bool OnRepNextItem(ExtPlayerReplicationInfo PRI, int RepIndex) -{ - return false; -} - -simulated reliable client function ClientAddTraderItem(int Index, FCustomTraderItem Item) -{ - // Make sure to not execute on server. - if (WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None)) - return; - - if (CustomList==None) - { - CustomList = CreateNewList(); - RecheckGRI(); - } - CustomItems.AddItem(Item); - SetWeaponInfo(false,Index,Item,CustomList); -} - -simulated static final function KFGFxObject_TraderItems CreateNewList() -{ - local KFGFxObject_TraderItems L; - - L = new class'KFGFxObject_TraderItems'; - L.SaleItems = L.Default.SaleItems; - L.ArmorPrice = L.Default.ArmorPrice; - L.GrenadePrice = L.Default.GrenadePrice; - - return L; -} - -simulated static final function SetWeaponInfo(bool bDedicated, int Index, FCustomTraderItem Item, KFGFxObject_TraderItems List) -{ - local array S; - local int i; - - if (List.SaleItems.Length<=Index) - List.SaleItems.Length = Index+1; - - List.SaleItems[Index].WeaponDef = Item.WeaponDef; - List.SaleItems[Index].ClassName = Item.WeaponClass.Name; - if (class(Item.WeaponClass)!=None && class(Item.WeaponClass).Default.SingleClass!=None) - List.SaleItems[Index].SingleClassName = class(Item.WeaponClass).Default.SingleClass.Name; - else List.SaleItems[Index].SingleClassName = ''; - List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : ''; - List.SaleItems[Index].AssociatedPerkClasses = Item.WeaponClass.Static.GetAssociatedPerkClasses(); - List.SaleItems[Index].MaxSpareAmmo = Item.WeaponClass.Default.SpareAmmoCapacity[0]; - List.SaleItems[Index].MagazineCapacity = Item.WeaponClass.Default.MagazineCapacity[0]; - List.SaleItems[Index].InitialSpareMags = Item.WeaponClass.Default.InitialSpareMags[0]; - List.SaleItems[Index].MaxSecondaryAmmo = Item.WeaponClass.Default.MagazineCapacity[1] * Item.WeaponClass.Default.SpareAmmoCapacity[1]; - List.SaleItems[Index].BlocksRequired = Item.WeaponClass.Default.InventorySize; - List.SaleItems[Index].ItemID = Index; - - List.SaleItems[Index].InitialSecondaryAmmo = Item.WeaponClass.Default.InitialSpareMags[1]; - List.SaleItems[Index].WeaponUpgradeDmgMultiplier[0] = 1.0; - for (i = 0;i PlayerInv; -var config array PerkClasses,CustomChars,AdminCommands,CustomItems,BonusGameSongs,BonusGameFX; +var config array PerkClasses,CustomChars,AdminCommands,BonusGameSongs,BonusGameFX; var config array CustomZedXP; var array< class > LoadedPerks; var array CustomCharList; @@ -44,9 +44,6 @@ var transient class LastKillDamageType; var SoundCue BonusGameCue; var Object BonusGameFXObj; -var array CustomItemList; -var KFGFxObject_TraderItems CustomTrader; - const SettingsTagVer=14; var KFGameReplicationInfo KF; var config int SettingsInit; @@ -58,9 +55,6 @@ var int LastWaveNum,NumWaveSwitches; var ExtSpawnPointHelper SpawnPointer; var bool bRespawnCheck,bSpecialSpawn,bGameHasEnded,bIsPostGame; var config bool bKillMessages,bDamageMessages,bEnableMapVote,bNoAdminCommands,bNoWebAdmin,bNoBoomstickJumping,bDumpXMLStats,bRagdollFromFall,bRagdollFromMomentum,bRagdollFromBackhit,bAddCountryTags,bThrowAllWeaponsOnDeath; -var config bool bDontUseOriginalWeaponry; -var config bool bAllowStandartPistolUpgrade; -var config bool bDisableCustomTrader; var KFGI_Access KFGIA; @@ -114,13 +108,6 @@ function PostBeginPlay() KFGIA = new(KFGameInfo(WorldInfo.Game)) class'KFGI_Access'; - // trader things - if (!bDisableCustomTrader && CustomTrader==None) - { - CustomTrader = class'ExtPlayerReplicationInfo'.Static.CreateNewList(); - SetTimer(0.001, false, 'EditTraiderItems'); - } - if (ServerMOTD=="") ServerMOTD = "Message of the Day"; if (StatFileDir=="") @@ -177,11 +164,6 @@ function PostBeginPlay() if (SettingsInit<9) MaxTopPlayers = 50; - if (SettingsInit < 13) - { - bAllowStandartPistolUpgrade = True; - bDisableCustomTrader = False; - } if (SettingsInit < 14) { bThrowAllWeaponsOnDeath = False; @@ -293,96 +275,6 @@ function UpdateCustomZedXPArray() } } -// function CheckPickupFactories() -// { -// local KFPickupFactory_Item ItemFactory; - -// // Disable 9mm and medpistol in all PickupFactories -// foreach AllActors(class'KFPickupFactory_Item', ItemFactory) -// { -// for (i=0;i(DynamicLoadObject(weapdef,class'Class')); - if (CI.WeaponDef == None) - return; - CI.WeaponClass = class(DynamicLoadObject(CI.WeaponDef.Default.WeaponClassPath,class'Class')); - if (CI.WeaponClass == None) - return; - CustomItemList.AddItem(CI); - class'ExtPlayerReplicationInfo'.Static.SetWeaponInfo(WorldInfo.NetMode==NM_DedicatedServer,CustomTrader.SaleItems.Length,CI,CustomTrader); -} - -function AddCIToTraderEx(class weapdef) -{ - local FCustomTraderItem CI; - CI.WeaponDef = weapdef; - if (CI.WeaponDef == None) - return; - CI.WeaponClass = class(DynamicLoadObject(CI.WeaponDef.Default.WeaponClassPath,class'Class')); - if (CI.WeaponClass == None) - return; - CustomItemList.AddItem(CI); - class'ExtPlayerReplicationInfo'.Static.SetWeaponInfo(WorldInfo.NetMode==NM_DedicatedServer,CustomTrader.SaleItems.Length,CI,CustomTrader); -} - static final function string GetStatFile(const out UniqueNetId UID) { return Repl(Default.StatFileDir,"%s","U_"$class'OnlineSubsystem'.Static.UniqueNetIdToString(UID)); @@ -398,21 +290,6 @@ final function bool IsDev(const out UniqueNetId UID) return false; } -function InitGRIList() -{ - local ExtPlayerController PC; - - KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomTrader; - - // Must sync up local client. - if (WorldInfo.NetMode==NM_StandAlone) - { - foreach LocalPlayerControllers(class'ExtPlayerController',PC) - if (PC.PurchaseHelper!=None) - PC.PurchaseHelper.TraderItems = CustomTrader; - } -} - function CheckWave() { if (KF==None) @@ -881,8 +758,6 @@ function NotifyLogin(Controller NewPlayer) if (bAddCountryTags && NetConnection(PlayerController(NewPlayer).Player)!=None) ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).SetPlayerNameTag(class'CtryDatabase'.Static.GetClientCountryStr(PlayerController(NewPlayer).GetPlayerNetworkAddress())); ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).bIsDev = IsDev(NewPlayer.PlayerReplicationInfo.UniqueId); - if (WorldInfo.NetMode!=NM_StandAlone) - ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).OnRepNextItem = GetNextItem; if (BonusGameCue!=None || BonusGameFXObj!=None) ExtPlayerController(NewPlayer).ClientSetBonus(BonusGameCue,BonusGameFXObj); if (bRespawnCheck) @@ -1703,14 +1578,6 @@ function PlayerChangeSpec(ExtPlayerController PC, bool bSpectator) } } -function bool GetNextItem(ExtPlayerReplicationInfo PRI, int RepIndex) -{ - if (RepIndex>=CustomItemList.Length) - return false; - PRI.ClientAddTraderItem(RepIndex,CustomItemList[RepIndex]); - return true; -} - function InitWebAdmin(ExtWebAdmin_UI UI) { local int i; @@ -1760,12 +1627,6 @@ function string WebAdminGetValue(name PropName, int ElementIndex) return string(MaxTopPlayers); case 'MinUnloadPerkLevel': return string(MinUnloadPerkLevel); - case 'bDontUseOriginalWeaponry': - return string(bDontUseOriginalWeaponry); - case 'bDisableCustomTrader': - return string(bDisableCustomTrader); - case 'bAllowStandartPistolUpgrade': - return string(bAllowStandartPistolUpgrade); case 'UnloadPerkExpCost': return string(UnloadPerkExpCost); case 'PerkClasses': @@ -1774,8 +1635,6 @@ function string WebAdminGetValue(name PropName, int ElementIndex) return (ElementIndex==-1 ? string(CustomChars.Length) : CustomChars[ElementIndex]); case 'AdminCommands': return (ElementIndex==-1 ? string(AdminCommands.Length) : AdminCommands[ElementIndex]); - case 'CustomItems': - return (ElementIndex==-1 ? string(CustomItems.Length) : CustomItems[ElementIndex]); case 'ServerMOTD': return Repl(ServerMOTD,"|",Chr(10)); case 'BonusGameSongs': @@ -1837,12 +1696,6 @@ function WebAdminSetValue(name PropName, int ElementIndex, string Value) bRagdollFromMomentum = bool(Value); break; case 'bRagdollFromBackhit': bRagdollFromBackhit = bool(Value); break; - case 'bDontUseOriginalWeaponry': - bDontUseOriginalWeaponry = bool(Value); break; - case 'bDisableCustomTrader': - bDisableCustomTrader = bool(Value); break; - case 'bAllowStandartPistolUpgrade': - bAllowStandartPistolUpgrade = bool(Value); break; case 'bAddCountryTags': bAddCountryTags = bool(Value); break; case 'MaxTopPlayers': @@ -1855,8 +1708,6 @@ function WebAdminSetValue(name PropName, int ElementIndex, string Value) UpdateArray(CustomChars,ElementIndex,Value); break; case 'AdminCommands': UpdateArray(AdminCommands,ElementIndex,Value); break; - case 'CustomItems': - UpdateArray(CustomItems,ElementIndex,Value); break; case 'BonusGameSongs': UpdateArray(BonusGameSongs,ElementIndex,Value); break; case 'BonusGameFX': @@ -1905,9 +1756,4 @@ defaultproperties WebConfigs.Add((PropType=3,PropName="ServerMOTD",UIName="MOTD",UIDesc="Message of the Day")) WebConfigs.Add((PropType=2,PropName="BonusGameSongs",UIName="Bonus Game Songs",UIDesc="List of custom musics to play during level change pong game.",NumElements=-1)) WebConfigs.Add((PropType=2,PropName="BonusGameFX",UIName="Bonus Game FX",UIDesc="List of custom FX to play on pong game.",NumElements=-1)) - - WebConfigs.Add((PropType=1,PropName="bDisableCustomTrader",UIName="Disable custom trader",UIDesc="Warning! That option will disable all settings below")) - WebConfigs.Add((PropType=2,PropName="CustomItems",UIName="Custom Inventory",UIDesc="List of custom inventory to add to trader (must be KFWeaponDefinition class).",NumElements=-1)) - WebConfigs.Add((PropType=1,PropName="bDontUseOriginalWeaponry",UIName="Disable original weapons",UIDesc="Allows to buy default weapons")) - WebConfigs.Add((PropType=1,PropName="bAllowStandartPistolUpgrade",UIName="Standard pistol upgrades",UIDesc="Allows to upgrade standard pistol")) } diff --git a/tools b/tools index cd658d9..0e821f3 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit cd658d9af958a46be3d46679dde4e3af6109c59e +Subproject commit 0e821f3dbbc6b3528f2028b0060d3b6f7f1c4b93