uakfdotb / ghostpp Goto Github PK
View Code? Open in Web Editor NEWGHost++, the Warcraft III game hosting bot
Home Page: https://www.ghostpp.com
License: Other
GHost++, the Warcraft III game hosting bot
Home Page: https://www.ghostpp.com
License: Other
Problem: my bot is hanging on "attempting to auth as Warcraft III: The Frozen Throne". After several seconds, it disconnects from Battle.net
Solution: in some cases, this may be caused by outdated bncsutil which no longer works properly after 1.29 patch (sends incorrect data in SID_AUTH_CHECK packet). The current bncsutil in this repository is updated, or you can fetch the latest from https://github.com/BNETDocs/bncsutil. After compiling (cd bncsutil/src/bncsutil; make && sudo make install
) it should be fixed.
If this doesn't solve your problem, here are other potential causes:
Still getting this error after making changes on windows:
[BNET: USWest] attempting to auth as Warcraft III: The Frozen Throne
[BNET: USWest] creating BNLS client
[BNLSC: localhost:9367:C1] connecting to server [localhost] on port 9367
[BNET: USWest] logon failed - game version is too old, disconnecting
[BNET: USWest] disconnected from battle.net
[BNET: USWest] waiting 90 seconds to reconnect
I've tried renaming my Warcraft III.exe inside my Warcraft III folder and also redirecting the bot_war3path inside the default.cfg. I have also extracted common.j and blizzard.j from my War3x.mpq and put them in the bots mapcfgs folder. I saw on another thread that replacing storm.dll and game.dll with empty files fixes the issue, however when I tried that I get this error:
[BNCSUI] unable to open [C:\Program Files (x86)\Warcraft III\storm.dll]
[BNCSUI] unable to open [C:\Program Files (x86)\Warcraft III\game.dll]
[BNET: USWest] logon failed - bncsutil key hash failed (check your Warcraft 3 path and cd keys), disconnecting
[BNET: USWest] disconnected from battle.net
[BNET: USWest] waiting 90 seconds to reconnect
I've also had similar issues with aurabot and the older version of GHost++ since the 1.29 patch.
Here's my default.cfg with stuff taken out:
default cfg copy.txt
bncsutil switched build from normal Makefiles to CMake, so the build instructions in the readme are incorrect. Also for 1.30 the note about casclib is missing. In my repo i created a branch with updates for these issues (And also updated stormlib in preparation for including casclib in a future release).
https://github.com/maxemann96/ghostpp/tree/readmeupdate
If you want, i can create i pull request for this.
Hi,
since 1.30 was released, the bot doesn't load anymore (at least for me).
I also checked the wc3 folder: Seems like they removed the "War3x.mpq" - so extracting the script files doesnt work anymore.
Does anybody know how to get it up running again?
Cheers and thanks
Added by:
game.cpp
//
// !VOTESTART
//
bool votestartAuth = player->GetSpoofed( ) && ( AdminCheck || RootAdminCheck || IsOwner( User ) );
bool votestartAutohost = m_GameState == GAME_PUBLIC && !m_GHost->m_AutoHostGameName.empty( ) && m_GHost->m_AutoHostMaximumGames != 0 && m_GHost->m_AutoHostAutoStartPlayers != 0 && m_AutoStartPlayers != 0;
if( (Command == "votestart" || Command == "vs" || Command == "go" || Command == "го") && !m_CountDownStarted && (votestartAuth || votestartAutohost || !m_GHost->m_VoteStartAutohostOnly) && m_GHost->m_VoteStartAllowed != 0 )
{
if( !m_GHost->m_CurrentGame->GetLocked( ) )
{
if(m_StartedVoteStartTime == 0) { //need >minplayers or admin to START a votestart
if (GetNumHumanPlayers() < m_GHost->m_VoteStartMinPlayers && !votestartAuth) { //need at least n players to votestart
uint32_t MinPlayers = m_GHost->m_VoteStartMinPlayers;
if( MinPlayers <= 4 ) {
SendChat( player, "Вы не можете проголосовать за старт игры, пока не зайдет минимум " + UTIL_ToString(MinPlayers) + " игрока!" );
}
else{
SendChat( player, "Вы не можете проголосовать за старт игры, пока не зайдет минимум " + UTIL_ToString(MinPlayers) + " игроков!" );
}
return false;
}
for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); ++i )
(*i)->SetStartVote( false );
m_StartedVoteStartTime = GetTime();
}
player->SetStartVote(true);
uint32_t VotesNeeded = GetNumHumanPlayers( ) - 1;
if (VotesNeeded < 2)
VotesNeeded = 2;
uint32_t Votes = 0;
for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); ++i )
{
if( (*i)->GetStartVote( ) )
++Votes;
}
if( !player->GetSpoofed( ) ) {
SendChat( player, "Вы не можете проголосовать за старт игры, пока не прошли проверку на подмену ника." );
return false;
}
if( IsDownloading( ) ) {
SendChat( player, "Вы не можете проголосовать за старт игры, пока кто-то скачивает карту." );
return false;
}
if(Votes < VotesNeeded) {
if( VotesNeeded - Votes == 1 ) {
SendAllChat("Для старта игры осталось проголосовать " + UTIL_ToString(VotesNeeded - Votes) + " игроку." );
}
else{
SendAllChat("Для старта игры осталось проголосовать " + UTIL_ToString(VotesNeeded - Votes) + " игрокам." );
}
} else {
StartCountDown( true );
}
}
else {
SendChat( player, "Ошибка: невозможно запустить голосование, потому что игра заблокирована. Владелец " + m_OwnerName );
}
}
game_base.cpp
// expire the votestart
if( m_StartedVoteStartTime != 0 && GetTime( ) - m_StartedVoteStartTime >= 120 )
{
if(!m_GameLoading && !m_GameLoaded) {
CONSOLE_Print( "[ИГРА: " + m_GameName + "] голосование за старт игры истекло." );
SendAllChat( "Голосование за старт игры истекло спустя 2 минуты." );
}
m_StartedVoteStartTime = 0;
}
Hello,
With my GHost++ Version 17.2, When I start a game with observers or referees, my ghost ejects all players. When I remove referees and observers, the Ghost works normally.
Hello, I want run ghostpp on linux, but I can't found game room on game list.
I complete the configuration and successfully connect to the server and I saw log and sure bot created room success.
I try to adjust firewall setting, but still can't see game room.
I used Ubuntu 16.04 and Warcraft III version is 1.28.5.
I used Windows can work, but I want run on linux.
Can you help me has happened and solution?
First, i must say I use same statsdota.cpp like this repo, but I have adapted the ghostone interface to see live events.
I am attacked with a tool who sent fake stats(Kills and Deaths) to the bot.
I made live prints one from game:
and after 2 seconds i saw live the ghostone interface:
The fake kills/deaths trick the bot, and the atacker can sent 10 fake kills/deaths per second, until the game end all players have scores like K/D: 887/865
@uakfdotb Please help us! Maybe you can make a filter to read/accept action packets only from the bot ip (localhost only), or stats must be read'ed only from replay.
ghostdbmysql.{h,cpp} references my_bool
which used to be defined by mysql.h. This has been removed, and leads to build failures. I inserted the typedef to circumvent typedef bool my_bool;
Was using this bot just fine for 1.29, but since the update it seems to be forcing everyone who joins to re-download the map (even if they have it), and once the user finishes downloading the map the bot kicks them.
I've tried various maps, and even re-porting a map with the new World Editor from 1.30, still no luck. Any help would be appreciated!
Could it be possible to to make the commands work on slots? P.e. !kick slot1.
I think that would be a good feature with all the spoofs and colored names happening on battle.net.
boost::mutex::scoped_lock lock( m_GamesMutex );
if( m_CurrentGame )
{
for( vector<CBNET *> :: iterator i = m_BNETs.begin( ); i != m_BNETs.end( ); ++i )
{
if( (*i)->GetServer( ) == creatorServer )
(*i)->QueueChatCommand( m_Language->UnableToCreateGameAnotherGameInLobby( gameName, m_CurrentGame->GetDescription( ) ), creatorName, whisper );
}
if( m_AdminGame )
m_AdminGame->SendAllChat( m_Language->UnableToCreateGameAnotherGameInLobby( gameName, m_CurrentGame->GetDescription( ) ) );
**return;**
}
if( m_Games.size( ) >= m_MaxGames )
{
for( vector<CBNET *> :: iterator i = m_BNETs.begin( ); i != m_BNETs.end( ); ++i )
{
if( (*i)->GetServer( ) == creatorServer )
(*i)->QueueChatCommand( m_Language->UnableToCreateGameMaxGamesReached( gameName, UTIL_ToString( m_MaxGames ) ), creatorName, whisper );
}
if( m_AdminGame )
m_AdminGame->SendAllChat( m_Language->UnableToCreateGameMaxGamesReached( gameName, UTIL_ToString( m_MaxGames ) ) );
**return;**
}
**lock.unlock( );**
Is there not to be an unlock before the return?
Maps above a certain size make you unable to join the lobby. I believe it's around 128mb. From my testing, a 122mb map works fine, a 137mb map and bigger ones don't work. I didn't have anything closer to the mentioned number though.
Edit:
This might actually be unrelated to the bot. The map size patch for 1.28 only works up to 128mb, therefore it might actually be the cause. Until I can find a workaround for this, this issue should be ignored. Sorry for the inconvenience.
Is it possible to run 2 ghost plus plus application in 1 pc?
and what are the requirement for the open ports?
is it 6112 - 6119?
When more than 2 bots get scheduled on the same host within my kubernetes cluster (same public ip) the bot can't connect to battle.net anymore.
When the 3rd one starts - sharing the same public ip - it just waits 90 seconds after the BNLS connect and then gets the disconnected after a short while without any errors.
The first 2 started bots always work, regardless of which one it is. All bots are identical except for acc/cdkeys/command trigger/bnls warden cookie/mysql bot id (docker container, configured using environment variables).
Does someone have a idea what could cause this?
Log
[BNET: USEast] connected
[BNET: USWest] connected
[BNET: Europe] connected
[BNET: Asia] connected
[BNET: USEast] attempting to auth as Warcraft III: The Frozen Throne
[BNET: USEast] creating BNLS client
[BNLSC: pyro.no-ip.biz:9367:C22] connecting to server [pyro.no-ip.biz] on port 9367
[BNET: Europe] attempting to auth as Warcraft III: The Frozen Throne
[BNET: Europe] creating BNLS client
[BNLSC: pyro.no-ip.biz:9367:C20] connecting to server [pyro.no-ip.biz] on port 9367
[BNET: Asia] attempting to auth as Warcraft III: The Frozen Throne
[BNET: Asia] creating BNLS client
[BNLSC: pyro.no-ip.biz:9367:C21] connecting to server [pyro.no-ip.biz] on port 9367
[BNLSC: pyro.no-ip.biz:9367:C22] connected
[BNET: USWest] attempting to auth as Warcraft III: The Frozen Throne
[BNET: USWest] creating BNLS client
[BNLSC: pyro.no-ip.biz:9367:C23] connecting to server [pyro.no-ip.biz] on port 9367
[BNLSC: pyro.no-ip.biz:9367:C20] connected
[BNLSC: pyro.no-ip.biz:9367:C21] connected
[BNLSC: pyro.no-ip.biz:9367:C23] connected
[TCPSOCKET] closed by remote host
[BNET: USEast] disconnected from battle.net
[BNET: USEast] waiting 90 seconds to reconnect
[TCPSOCKET] closed by remote host
[BNET: USWest] disconnected from battle.net
[BNET: USWest] waiting 90 seconds to reconnect
[TCPSOCKET] closed by remote host
[BNET: Europe] disconnected from battle.net
[BNET: Europe] waiting 90 seconds to reconnect
[TCPSOCKET] closed by remote host
[BNET: Asia] disconnected from battle.net
[BNET: Asia] waiting 90 seconds to reconnect
Hey, i build a docker container (base: ubuntu) around this bot to run it.
I didnt change any code though. When i try to join a game hosted by the bot this happens and it just kicks me back to the lobby:
Log
[GAME: test] player [X.X.X.X] joined the game
[GAME: test] [Local]: Game locked. Only the game owner and root admins can run game commands.
[GAME: test] map download started for player
[GAME: test] map download finished for player in 0.9 seconds
[GAME: test] [Local]: Player downloaded the map in 0.9 seconds (328.2 KB/sec).
[GAME: test] deleting player: has left the game voluntarily
It has the latest Warcraft III.exe (otherwise login would not work)
I've extracted the latest Blizzard.j / common.j and its calculating the map info correctly:
[BNET: Europe] admin sent command [!map Fire]
[QUEUED: Europe] Loading config file [VampirismFire5.09.w3x].
[MAP] loading MPQ file [data/maps/VampirismFire5.09.w3x]
[MAP] calculated map_size = 209 13 10 0
[MAP] calculated map_info = 37 160 86 63
[MAP] calculated map_crc = 181 29 176 182
[MAP] calculated map_sha1 = 173 204 39 157 119 242 23 148 130 41 52 196 174 24 73 146 140 70 133 237
[MAP] calculated map_options = 96
[MAP] calculated map_width = 128 0
[MAP] calculated map_height = 128 0
[MAP] calculated map_numplayers = 12
[MAP] calculated map_numteams = 2
[MAP] calculated map_slot1 = 0 255 0 0 0 0 1 1 100
[MAP] calculated map_slot2 = 0 255 0 0 0 1 1 1 100
[MAP] calculated map_slot3 = 0 255 0 0 0 2 1 1 100
[MAP] calculated map_slot4 = 0 255 0 0 0 3 1 1 100
[MAP] calculated map_slot5 = 0 255 0 0 0 4 1 1 100
[MAP] calculated map_slot6 = 0 255 0 0 0 5 1 1 100
[MAP] calculated map_slot7 = 0 255 0 0 0 6 1 1 100
[MAP] calculated map_slot8 = 0 255 0 0 0 7 1 1 100
[MAP] calculated map_slot9 = 0 255 0 0 0 8 1 1 100
[MAP] calculated map_slot10 = 0 255 0 0 0 9 1 1 100
[MAP] calculated map_slot11 = 0 255 0 0 1 10 8 1 100
[MAP] calculated map_slot12 = 0 255 0 0 1 11 8 1 100
It doesnt matter which map i choose btw.
Does anyone have a idea whats wrong? Is it a general issue or sth. on my side?
@uakfdotb Hello :)
I need to write down the original nickname of the player and not colored nickname.
Line: https://github.com/uakfdotb/ghostpp/blob/master/ghost/statsw3mmd.cpp#L111
Help to write down the original nick to the database.
I used to create admin game on 1.26a Lan game but admin game don't show on war3 (log said admin game had been created)
Then I download another older ghost version https://github.com/Shiox/ghostpp, then
I copy default,cfg and ghost.cfg to older ghost version. Then the admin game show on my war3 !
The newer Ghost++ from your repository have bug on creating admin game.
Error recompiling Ghost ++
IDE: Microsoft Visual C++ 2008 Express Edition
Boost version: v1.38
Step: same as MANUAL
Note: No source code changes
BuildLog: BuildLog.txt
Is there any other way to compile Ghost++ for windows?
Hi,
this one is not really an issue, more like a question regarding the mapgametype:
The game list is overloaded. But there's a certain reserved value (49161), which only works for officially signed blizzard maps and which makes the game visible on top of the list.
So far so good. But I still have a problem: When I use this value in the ghost.cfg, it doesn't make any difference (I also tried some debug output, the function GetMapGameType() in the map.cpp overwrites this value). My second try was to hardcode it (at the end of the GetMapGameType()-function) and just use "GameType = 49161;". However this results in a "failed to authorize the map" error in the wc3 client.
Is there any workaround to fix that?
Cheers
Need run: sudo ldconfig
Cache clear.
Have this code
void CBaseGame :: SendAllActions( )
{
bool UsingGProxy = false;
uint32_t start = GetTicks( );
for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); ++i )
{
if( (*i)->GetGProxy( ) )
UsingGProxy = true;
}
//TrackTimeCode( "SAAUGP", GetTicks( ) - start );
//start = GetTicks( );
m_GameTicks += m_Latency;
if( UsingGProxy )
{
// we must send empty actions to non-GProxy++ players
// GProxy++ will insert these itself so we don't need to send them to GProxy++ players
// empty actions are used to extend the time a player can use when reconnecting
for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); ++i )
{
if( !(*i)->GetGProxy( ) )
{
for( unsigned char j = 0; j < m_GProxyEmptyActions; ++j )
Send( *i, m_Protocol->SEND_W3GS_INCOMING_ACTION( queue<CIncomingAction *>( ), 0 ) );
}
}
if( m_Replay )
{
for( unsigned char i = 0; i < m_GProxyEmptyActions; ++i )
m_Replay->AddTimeSlot( 0, queue<CIncomingAction *>( ) );
}
}
//TrackTimeCode( "SAAIFGP", GetTicks( ) - start );
//start = GetTicks( );
// Warcraft III doesn't seem to respond to empty actions
/* if( UsingGProxy )
m_SyncCounter += m_GProxyEmptyActions; */
++m_SyncCounter;
//TrackTimeCode( "SAADLC", GetTicks( ) - start );
//start = GetTicks( );
// we aren't allowed to send more than 1460 bytes in a single packet but it's possible we might have more than that many bytes waiting in the queue
if( !m_Actions.empty( ) )
{
// we use a "sub actions queue" which we keep adding actions to until we reach the size limit
// start by adding one action to the sub actions queue
uint32_t start2 = GetTicks( );
queue<CIncomingAction *> SubActions;
CIncomingAction *Action = m_Actions.front( );
m_Actions.pop( );
SubActions.push( Action );
uint32_t SubActionsLength = Action->GetLength( );
//TrackTimeCode( "SAADLC1", GetTicks( ) - start2 );
//start2 = GetTicks( );
while( !m_Actions.empty( ) )
{
Action = m_Actions.front( );
m_Actions.pop( );
// check if adding the next action to the sub actions queue would put us over the limit (1452 because the INCOMING_ACTION and INCOMING_ACTION2 packets use an extra 8 bytes)
if( SubActionsLength + Action->GetLength( ) > 1452 )
{
uint32_t start3 = GetTicks( );
// we'd be over the limit if we added the next action to the sub actions queue
// so send everything already in the queue and then clear it out
// the W3GS_INCOMING_ACTION2 packet handles the overflow but it must be sent *before* the corresponding W3GS_INCOMING_ACTION packet
SendAll( m_Protocol->SEND_W3GS_INCOMING_ACTION2( SubActions ) );
if( m_Replay )
m_Replay->AddTimeSlot2( SubActions );
while( !SubActions.empty( ) )
{
delete SubActions.front( );
SubActions.pop( );
}
SubActionsLength = 0;
//TrackTimeCode( "SAADLC13", GetTicks( ) - start3 );
}
SubActions.push( Action );
SubActionsLength += Action->GetLength( );
}
//TrackTimeCode( "SAADLC2", GetTicks( ) - start2 );
SendAll( m_Protocol->SEND_W3GS_INCOMING_ACTION( SubActions, m_Latency ) );
if( m_Replay )
m_Replay->AddTimeSlot( m_Latency, SubActions );
while( !SubActions.empty( ) )
{
delete SubActions.front( );
SubActions.pop( );
}
}
else
{
SendAll( m_Protocol->SEND_W3GS_INCOMING_ACTION( m_Actions, m_Latency ) );
if( m_Replay )
m_Replay->AddTimeSlot( m_Latency, m_Actions );
}
//TrackTimeCode( "SAAWH", GetTicks( ) - start );
//start = GetTicks( );
uint32_t ActualSendInterval = GetTicks( ) - m_LastActionSentTicks;
uint32_t ExpectedSendInterval = m_Latency - m_LastActionLateBy;
m_LastActionLateBy = ActualSendInterval - ExpectedSendInterval;
if( m_LastActionLateBy > m_Latency )
{
// something is going terribly wrong - GHost++ is probably starved of resources
// print a message because even though this will take more resources it should provide some information to the administrator for future reference
// other solutions - dynamically modify the latency, request higher priority, terminate other games, ???
//To causes a performance problem, when the console has to say this 1000 times. Should improve ghost hosting on servers
CONSOLE_Print( "[GAME: " + m_GameName + "] warning - the latency is " + UTIL_ToString( m_Latency ) + "ms but the last update was late by " + UTIL_ToString( m_LastActionLateBy ) + "ms" );
m_LastActionLateBy = m_Latency;
}
m_LastActionSentTicks = GetTicks( );
//TrackTimeCode( "SAACALC", GetTicks( ) - start );
}
Using the code execution time measurements, I found out that this method is slow. And it is slow to work those code which, in principle, are not long to work (see SAACALC). An example of one measurement from one game.
End report: twilka
Loaded
ACMO: 12 times, time exec: 327
SAACALC: 5 times, time exec: 179
SAADLC: 3 times, time exec: 11
SAADLC1: 6 times, time exec: 194
SAADLC13: 1 times, time exec: 0
SAADLC2: 4 times, time exec: 56
SAAIFGP: 4 times, time exec: 18
SAAUGP: 3 times, time exec: 50
SAAWH: 10 times, time exec: 327
SCKICK: 3 times, time exec: 8
Нужен Coder который шарит по ghost pvpgn и тэ надо переписать несколько таблиц для pvpgn
Оплата имеется.
Hi,
since 1.30.2 is out and the network traffic will be encrypted and the hosting system is changed - is there still a chance to keep the bot running?
See details here:
https://us.battle.net/forums/en/bnet/topic/20769476896
I have some ghost++ bots that run on a PvPGn server, they are like four. I made them so anyone that wants to use them can do. The problem at hand is that, even if a user whispers a bot saying "spoofcheck", the bot won't react to neither !map nor !pub commands, but commands like !stats or ?trigger work just fine. What's going on? Am I missing something or is this a bug?
I'll probably end up editing ghost++ so it doesn't check for admin privileges for these commands, but in either case it should work, right?
Anyone please help me with this problem, I setup everything following the instruction, but when I create host I got "pvpgn log"
`Oct 17 02:06:56 [debug] _client_startgame4: [21] got startgame4 status for game "Game #1" is 0x00000010 (gametype=0x2001 option=0x0049, flag=0x0000)
Oct 17 02:06:57 [debug] handle_udp_packet: [19] got unknown udp packet type 0x6c30f7, len 108 from xxx.xxx.xxx.xxx:41226
`
Whoops my 24p patch broke support for hosting on older pvpgn servers.
See:
44e3e44
to revert:
set the max_slots = 24 in gameslot.h to 12
and packet.push_back( 110 ); to packet.push_back( 98 ); in bnetprotocol.cpp
recompile it with ''make''
should probably make it automatically switch based on game version, I'm not sure how tho..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.