Skip to content
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

Ghost bot support #316

Open
HarpyWar opened this issue Jul 5, 2017 · 0 comments
Open

Ghost bot support #316

HarpyWar opened this issue Jul 5, 2017 · 0 comments

Comments

@HarpyWar
Copy link
Member

HarpyWar commented Jul 5, 2017

From OHSystem created by HarpyWar : Grief-Code/OHSystem#279
Complete discussion: http://archive.is/UzLsz
New discussion: https://community.griefco.de/topic/68-pvpgn-support/

I'm gonna add integration PvPGN + Ghost, and I found your project is well suited for this purpose, because of high activity.
There was a suggestion to add a new connection interface between pvpgn and ghost #35. But I stopped on soft integration using chat commands. Next sheet shows how they can interact.

1. Command (User → PvPGN) /cmd {args} 2. Intermediate (PvPGN → Ghost) /pvpgn [cmd] [user] {args} 3. Callback (Ghost → PvPGN) /ghost [cmd] {code} {user} {args} 4. Result (PvPGN → User) (text message)
/host [mode] [type] [gamename] /pvpgn host[user] [mode] [type] [gamename] /ghost host [code] [user] [gamename] Game [gamename] created. (host DotA map for rating)
/chost [map] [gamename] /pvpgn chost [user] [map] [gamename] /ghost chost [code] [user] [gamename] Game [gamename] created. (host custom map without rating)
/unhost /pvpgn unhost [user] /ghost unhost [code] [user] [gamename] Game [gamename] destroyed.
/ping /pvpgn ping [user] /ghost ping [code] [user] [players] [pings] (players and pings are comma delimited) (PvPGN sends ping for each player on a new line, if user not in game - return error).
/swap [slot1] [slot2] /pvpgn swap [user] [slot1] [slot2] /ghost swap [code] [user] [username1] [username2] -
/open [slot] /close slot /pvpgn open [user] [slot] /ghost open [code] [user] [slot] -
- - /ghost gameresult [code] [players] [ratings] [results]
(result: -1=leave&loss,0=loss, 1=win,2=leave&win) (players, ratings, results are comma delimited)
(PvPGN updates rating and increases wins,losses,leaves,streakes in self database for each player in the game; then users can see their stats using pvpgn /stats command)
/start /abort /pub /priv /pvpgn [cmd] [user] [gamename] /ghost [cmd] [code] [user] [message] -
- /pvpgn init /ghost init (activate "PvPGN mode" on a bot side; a server sends this command when bot login)

Each callback (for commands that sent by a user) contains [code] (ok|err) and [user] who then will receive a message from a server. If [code] == err then next argument is an error message. For example: /ghost host err Joe That game name is busy.

Usage scenario for user:

  1. User Joe sends /host ap 5x5 Join All!
    1.1 Here PvPGN can send /pvpgn ping Joe 123.123.123.123 to several Ghost bots. Each Ghost sends callback to PvPGN /ghost ping Joe 25, and then server can select a bot with better ping for the user.
  2. PvPGN sends to Ghost /pvpgn Joe host ap Join All! as whisper
  3. Ghost receives message and creates dota game with owner Joe. Then sends callback to PvPGN /ghost host ok Joe Join All!
  4. PvPGN sends to Joe Game "Join All!" is created!
  5. When the game ended Ghost sends to PvPGN something like /ghost gameresult ok Joe,player2,player3,player4 1000,900,950,1100 -1,1,1,0

I want to add this as optional in PvPGN too, from Lua scripting that I added recently. So, it is possible to easy add variations of these. For instance auto host games, if there is no games. Or notify all players in all channels that new game is created.

What should be modified in Ghost (OHSystem):

  1. Add new function to handle commands /pvpgn ....
  2. Add new config value pvpgn = true, pvpgn_name = "PvPGN Realm" (this is name of the server from which Ghost will received authorized commands). Next features should be enabled only if pvpgn = true. Command /pvpgn init switches GHost to PvPGN mode. Authorized PvPGN server name can be set in existing option bnet_rootadmin).
  3. Disable direct commands from users, except ingame commands like -lat
  4. Disable count limitation for created lobby games, so bot can create multiple games independently of is there games that are not started or not. (it will be allowed on the PvPGN side)

Please, tell me what do you think about it, and could you do these modifications?


Also I'm wondering to add automatic matchmaking system, but I still don't know details about how it works.
sword
When user clicks on the "sword" button in Battle.net chat interface, PvPGN receives that signal and finds other players who also click on the button and waiting for automatch. Here the server can pick up players by their rating and choose the ghost bot wth the best ping for all players.
Difference of this game type with normal type is there is no lobby room. Game starts automatically by the PvPGN signal to all players in coming match.
To add this Ghost should supports host a game from PvPGN signal without join a lobby. But may be it's not working for custom maps like Dota and it sholdn't be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant