RaidMax / IW4M-Admin

Complete administration tool for IW4x, Pluto T6, Pluto IW5, Pluto T5, Pluto T4, H1-Mod, CoD4x, IW6x, TeknoMW3, and most Call of Duty® dedicated servers.
MIT License
212 stars 43 forks source link

optimize the !mapandgametype command #223

Closed Chenterito closed 2 years ago

Chenterito commented 2 years ago

I think it should interact with the filesystem, since the default names are not always used in "dsr" files in the case of iw5. in my case I use a "dsr" called tdmmaniacos.dsr and that would not allow the execution of the command as it has been implemented. interacting, when looking in the respective folder for the dsr file to be executed. 20211128_192937

RaidMax commented 2 years ago

IW4MAdmin will not be interacting with the file system for game specific implementation. My understanding is that you can’t load gametypes without a dsr on iw5.

Additionally, if the gametype is not defined in the default settings it will not append the _default dsr suffix

Chenterito commented 2 years ago

Exactly, the "dsr" is the one in charge of establishing the type of game and the different options for it. and on the other hand, if you directly execute the command "load_dsr namedsr" when not found in the defaults, it would be fine.

RaidMax commented 2 years ago

Yep that’s how it should be implemented currently. So I’m a bit unsure what the issue is.

If you do !mag dome dd it’ll do load_dsr DD_default, if you do !mag dome custom it’ll do load_dsr custom

Isn’t that what we want?

Chenterito commented 2 years ago

in theory that is correct. I'll try it

Chenterito commented 2 years ago

I tried it and it doesn't work properly. The command does not change the map, it only sets a DSR to then manually apply !map dome and there it works only if a default name is used, such as: !mag dome war -> There it works setting the correct dsr, but I have to use a !map dome for the map to change. The other case. if I use !mag dome DOMM.dsr or !mag dome DOMM this doesn't work and it doesn't assign a correct DSR and the rest won't work either.

image

I hope I have explained myself.

Chenterito commented 2 years ago

$"load_dsr {(hasMatchingGametype ? gametype.ToUpper() + "_default" : gametype)};map {map}"); I don't know about this language, but I think the error is in the formation of the concatenated command. because I used the same idea from my client console and if it works. Like this: load_dsr DOMM; map mp_dome I think the string is wrongly concatenated.

RaidMax commented 2 years ago

!mag dome dom

image

!mag dom domm

image

I don't see where there is an issue with concatenation.

(note this was against iw4x map list so that's why mp_wasn't prefixed)

Chenterito commented 2 years ago

image It's what the server console shows when I run the command.

I think I should run the commands separately.

  1. load_dsr gametype
  2. map mp_xxxx
RaidMax commented 2 years ago

After testing locally I can confirm this issue is caused by Pluto IW5 not properly parsing multiple commands via rcon. Updated 29ae00562159204b2ae485bb38af61c2bb97d45b to use separate commands. Will close once you can verify functionality as expected.

Chenterito commented 2 years ago

Now it works great