YaLTeR / OpenAG

An open-source reimplementation of Adrenaline Gamer's client library.
https://j.mp/OpenAG
Other
133 stars 39 forks source link

Add savemap command #99

Closed cpiernikowski closed 3 years ago

cpiernikowski commented 3 years ago

Added savemap command that writes the current map name to a .txt file, mainly intended for HLKZ.

YaLTeR commented 3 years ago

Don't mind the CI, looks unrelated.

What's the use-case for this?

cpiernikowski commented 3 years ago

While playing HLKZ i often found myself saving map names in notepad to play them later, thought it might be useful for kz players.

cpiernikowski commented 3 years ago

I've made the file open in read/write mode as requested. If the file doesn't exist it gets created by calling fopen() in append mode, if the file didn't exist before it doesn't need to be checked for the presence of the map name. Also, map names are now compared without the \n.

execut4ble commented 3 years ago

Just a suggestion, perhaps call it "writemap" so that it would be consistent with other commands such as writecfg, writeid, writeip?

cpiernikowski commented 3 years ago

Do you think it would be more suitable to write the map name to a .cfg file?

YaLTeR commented 3 years ago

Do you think it would be more suitable to write the map name to a .cfg file?

No, I think .txt is perfectly fine.

YaLTeR commented 3 years ago

Thanks!