Skip to content

FindMap plugins#350

Closed
powerlord wants to merge 27 commits intoalliedmodders:masterfrom
powerlord:fuzzymap-plugins
Closed

FindMap plugins#350
powerlord wants to merge 27 commits intoalliedmodders:masterfrom
powerlord:fuzzymap-plugins

Conversation

@powerlord
Copy link
Contributor

NOTE: Since this was started, it switched from being based on pull request #348 to being based on the now-merged pull request #351.

This adds a new stock to sourcemod.inc:

  • GetFriendlyMapName changes a CSGO or TF2 workshop path to just the base mapname. This is intended for display purposes in various plugins and/or plugins that need compatibility with existing names.

Note that in TF2, at this time you can't get the proper map path for a workshop map unless you tf_workshop_map_sync the map after the server start so that the server is actively tracking it.

The following plugins have all been updated to make calls to FindMap and GetFriendlyMapName as appropriate:

  • MapChooser
  • Nominations
  • NextMap
  • BaseVotes
  • BaseTriggers
  • RandomCycle

powerlord added 18 commits June 15, 2015 13:30
…p_dustbowl, for example. Therefore, don't waste time calling it.
…well as calling the new GetFriendlyMapName for displaying.
… IGameHelpers to version 11.

Fixed in-line documentation for ResolveFuzzyMapName native to match current behavior.
…st is). This is because non-MapChooser plugins may also need them.
Changed basecommands to use friendly names in menus.
@powerlord
Copy link
Contributor Author

Based on input from John S. from Valve, all plugins that use the ProduceResolvedMapList function should be rewritten and the ProduceResolvedMapList stock removed entirely.

This is based on his comments about how tf_workshop_map_sync can be delayed.

I will do this sometime tonight or tomorrow.

@powerlord
Copy link
Contributor Author

That last commit is to convert a ClearArray(g_NextMapList) to the more modern g_NextMapList.Clear(). This got missed when I was cleaning up the 1.6 to 1.7 syntax conversion in pull request #226.

…merge from upstream expose-findmap branch to verify that I've made all changes (and to pull in the FindMap test plugin)
…zymap-plugins

Conflicts:
	core/HalfLife2.cpp
	core/HalfLife2.h
	core/smn_halflife.cpp
@powerlord
Copy link
Contributor Author

This is now based on PR #351, but both it and this have Linux issues at the moment.

I'll do some plugin testing on my test server once this is fixed.

@powerlord powerlord changed the title Fuzzymap plugins FindMap plugins Jun 30, 2015
@powerlord
Copy link
Contributor Author

Not sure when it happened, but I'm seeing bugs in nominations... need to check other plugins as well.

@psychonic
Copy link
Member

D:

Nicholas Hastings

Ross Bemrose mailto:[email protected]
Wednesday, July 1, 2015 9:42 PM

Not sure when it happened, but I'm seeing bugs in nominations... need
to check other plugins as well.


Reply to this email directly or view it on GitHub
#350 (comment).

Ross Bemrose mailto:[email protected]
Thursday, June 18, 2015 11:52 PM

NOTE: Since this branch was based on the Fuzzymapnative branch, it
includes all the changes made in pull request #348
#348 as well.

This adds two new stocks to sourcemod.inc :

GetFriendlyMapName changes a CSGO or TF2 workshop path to just the
base mapname. This is intended for display purposes in various
plugins and/or plugins that need compatibility with existing names.

Note that in TF2, at this time you can't get the proper map path
for a workshop map unless you |tf_workshop_map_sync| the map after
the server start so that the server is actively tracking it.
ProduceResolvedMapList runs ResolveFuzzyMapName on every entry in
an ArrayList and places the resolved name in the second ArrayList.
Also has the side effect of clearing the target ArrayList first.

The following plugins have all been updated to make calls to
ResolveFuzzyMapName and GetFriendlyMapName as appropriate:

  • MapChooser
  • Nominations
  • NextMap
  • BaseVotes
  • BaseTriggers

    You can view, comment on, or merge this pull request online at:

#350

    Commit Summary


Reply to this email directly or view it on GitHub
#350.

@powerlord
Copy link
Contributor Author

@psychonic I thought I'd tested it since I switched it over to FindMap... maybe I didn't and just thought I did.

Then again, I'm testing it now.

FindMap itself is working as my mappath command is resolving these maps, they're just not being resolved in the current code for nominations/mapchooser/others

@powerlord
Copy link
Contributor Author

Oh wait, this may be because I'm not syncing workshop maps until AFTER plugins load due to a server crashing bug that should be fixed in tomorrow's update. Let me test it again.

@powerlord
Copy link
Contributor Author

Yup, sure enough, that's exactly what was causing the issue I was seeing.

It'll be nice if they add the mapcyclefile auto-sync to tomorrow's TF2 update so I can remove the plugin I'm using to late-sync these maps.

Yay, panicking over nothing.

…ues in the MapChooser code that I noticed while working on NativeVotes MapChooser.
@powerlord
Copy link
Contributor Author

I'm going to redo this pull request.

Not only is its history a mess because of the number of different methods I've done, but I think GetFriendlyMapName would be better served as a native.

In fact, I'm rewriting it as a native named GetWorkshopMapBaseName right now. The name is a bit verbose, but it does explain what it's for.

So, expect to see a new pull request with that soon. Not sure when as I'll need to do some testing on it after it's finished.

@KyleSanderson
Copy link
Member

@powerlord Just for reference, if you rebase your branch you can clean it up quite easily. This isn't recommended for a number of reasons, but you can recover this way.

@powerlord
Copy link
Contributor Author

@KyleSanderson You can, but they recommend you don't do it if it's already been pushed to a public repository.

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.

3 participants