SOF3 / InfoAPI

Placeholder registry and formatting API.
https://sof3.github.io/InfoAPI/defaults
Apache License 2.0
34 stars 5 forks source link

Anonymous context does not fallback to base context. #30

Closed Endermanbugzjfc closed 11 months ago

Endermanbugzjfc commented 11 months ago

Reproduce

  1. Use an arbitrary plugin that contains InfoAPI::render(). E.g. ProfanityFilter
  2. Compose a template which involves the base context.

Expectation: everything would be rendered. Reality: the anonymous info gets rendered while the base context info remains unchanged.

Attachments

config.yml (portion)

block-warning-message: "&e{player_name} {baseContext.darkBlue} {infoapi.baseContext.playerCount} {infoapi.worldCount} &cwas blocked message contains profanity message."

Log (portion)

[19:46:40.887] [Server thread/WARNING]: [ProfanityFilter] BlahCoast30765 {baseContext.darkBlue} {infoapi.baseContext.playerCount} {infoapi.worldCount} was blocked message contains profanity message.

Corresponding code executed

https://github.com/ReinfyTeam/ProfanityFilter/blob/21f20fd74eb4c5ece7e54f69088c24d34fedfba1/src/EventListener.php#L76-L79

Environment

InfoAPI: 2.0.0-beta1 PocketMine-MP: 5.4.3

Endermanbugzjfc commented 11 months ago

The plugin virtually does not use InfoAPI.

SOF3 commented 11 months ago

what do you mean?

Endermanbugzjfc commented 11 months ago

what do you mean?

I think he reverted your PR at some point.

SOF3 commented 11 months ago

I don't see any revert, only build tool changes

Endermanbugzjfc commented 11 months ago

I don't see any revert, only build tool changes

¯_(ツ)_/¯