-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show games with password to admins #353
Comments
How is this important for WarCraft and Diablo games? |
@RElesgoe, for example in diablo games you dont want players to see private games created by other players but only public games and you want for admins to see them and check all games list if anyone is cheating. Cheating with a bot for example will create private games one after another with increasing number and it's easy to track if you are able to see full games list. |
@HarpyWar, maybe a lua command can be added for this? |
It's possible to override returned game list from Lua in Example of code which returns only games with passwords for admins, edit it to your needs: local gamelist = {}
-- is admin account
local is_admin = account_get_auth_admin(account.name, nil)
if is_admin then
-- get server games
local glist = server_get_games()
-- iterate games
for i,game in pairs(glist) do
-- if game password is not empty
if not string:empty(game.pass) then
-- then add to new gamelist
table.insert(gamelist, game.id)
table.insert(gamelist, game.name)
end
end
-- return new gamelist
return {"id", "name"}, gamelist
end |
Thanks @HarpyWar. Do I need to replace the entire function or can I keep war3xp one too? I see current function is related to ghost for warcraft. Can it be added as separate function for D2XP and keep WAR3XP too https://pastebin.com/jUAwm2Xk? Also can you make it please so it returns all games with pass for certain command group only instead of all admins? So only admins with certain cg that I choose can see that. |
This requires testing, so I can't do it now. You can debug and finish the script by yourself with |
I'm not good with lua so whenever you have time I would appreciate if you can take a look and make so cg flag can be used instead of all admins, only when you have time. Will test the command today anyway to see if all works good. Thanks again, helpful as always. |
If you know any other programming language I can suggest the following link which helped me for writing these scripts for pvpgn http://tylerneylon.com/a/learn-lua/ |
I wished I knew any but I don't and not because I am lazy or anything, tried to learn c++ few years ago but barely understood few simple things that are always used, wouldn't know to develop from from that. I will try to find something useful on the link you gave me although at first look it's like chineese to me. |
Have you tried using the |
@RElesgoe I am testing now and used @HarpyWar, I replaced the lua function. When using |
As a workaround for now, you can modify |
This will block the command for all normal players though and in games like diablo they must be allowed to see all normal games. Something seems to be broken with |
I don't think the |
@RElesgoe, how about setting |
I've made a commit (8464f2b) to the |
@RElesgoe, maybe if you only give a certain command group number the permission it won't be as overkill? Let's say only those with cg 3 can see and if we need to change that we only modify that file in source. Either way I bet many will love this new commit and thank you for being so fast, will test this as soon as I get to pc. |
It's pretty arbitrary and inconsistent to restrict this specific command and parameter to a specific command group. If you still want this feature, you would have to implement it yourself. |
@RElesgoe, I tested the new commit on the source I'm using and works perfect, thanks a lot for that. Yes, maybe giving specific cg is personal preference because I would prefer not to give someone |
You'll want to modify the |
I tried to change |
You should replace |
Thanks a lot, much appreciated. The setting in |
By default pvpgn can hide/display games with password using this setting in bnetd.conf
The bug here is that even if the setting is set to
true
normal players can still see passworded games that that shouldn't happen as the option is enabled. Can we have so that only admins (maybe certain cg) can see the full list of games normal players the public games? This is mainly important for games like warcraft and diablo games.The text was updated successfully, but these errors were encountered: