po-devs / po-server-goodies

Pokemon Online Server scripts.js and tiers.xml
44 stars 109 forks source link

Mixed json and MemoryHash, with scripts.js and plugin access #1058

Closed NightfallAlicorn closed 9 years ago

NightfallAlicorn commented 9 years ago

So far I've managed to access Hangman and Mafia admins with memory hash inside scripts.js but I'm unable to reach inside a plugin module for Trivia and Tours which use json. I don't wanna copy full 2 full functions which should be accessible inside modules in scripts.js unless I need to.

This script is a request from Fuzzy for allowing those that are side game staff auth be able to access VR without needing cauth. I've got half done so far. Also I feel it be better to only use one of these methods for handling saved module script data instead of 2.

PokeWorldBW commented 9 years ago

You could try something like if (JSON.parse(sys.getFileContent("tadmins.txt")).indexOf(srcName) !== -1) return; for Trivia Admins and if (JSON.parse(sys.getFileContent("scriptdata/tourconfig/touradmins.json")).hasOwnProperty(srcName)) return; However, idk what effect it will have on the server if you make it read the files whenever someone joins VR. I don't think there's a good way to do this unless you redo the isTAdmin and isMegaUser functions.

Fuzzysqurl commented 9 years ago

Midwaymarshall coded a very minimalistic fix for it.