Jump to content

Playerbot (archive)


Recommended Posts

I All,

What an amazing mod ! I'm about to setup a second server for my tests with playerbot, i'll tell you BlueBoy the results.

I think playerbot limits per account is a very good idea and this option could be included in playerbot sources.

Another idea is to limit level diff, ie you could'nt load a bot with XX level more or less.

because players have the wrong habit to log a 80 character to ease <20 characters's xp

Link to comment
Share on other sites

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

You need to use the patch I provided in post #819. This resolves this issue with PlayerSpell

Hope this helps

Thanks greatly for pointing me to the obvious solution I should have found. :)

Patched up and works great on MaNGOS 9463, SD2 1605 and YTDB 0.11.0 rev. 536

I just baked a Chocolate Cocoa Cake with a layer of Peanut butter in the center. Come on over and have a slice!

- Genius not only diagnoses the situation but supplies the answers.

Link to comment
Share on other sites

Thanks greatly for pointing me to the obvious solution I should have found. :)

Patched up and works great on MaNGOS 9463, SD2 1605 and YTDB 0.11.0 rev. 536

I just baked a Chocolate Cocoa Cake with a layer of Peanut butter in the center. Come on over and have a slice!

- Genius not only diagnoses the situation but supplies the answers.

Hi,

Glad you got it to work. The cake sounds nice;)

Cheers

Link to comment
Share on other sites

I All,

What an amazing mod ! I'm about to setup a second server for my tests with playerbot, i'll tell you BlueBoy the results.

I think playerbot limits per account is a very good idea and this option could be included in playerbot sources.

Another idea is to limit level diff, ie you could'nt load a bot with XX level more or less.

because players have the wrong habit to log a 80 character to ease <20 characters's xp

The 'limit per account' patch is a good idea, but it still needs work before I would feel happy about integrating it into the source. We need to find a better way to process client commands, to handle macros as well.

You could use the patches I provided as templates to produce your own. A 'limit bot level' option could be easily produced. Examine your databases, and find the level field, in the approriate table. Then create a query for the database, to obtain the value you require.

Database   CharacterDatabase
Table          characters
Field           level

Then include a test

bot level = query CharacterDatabase("SELECT level FROM characters WHERE account = '%u'", GetAccountId)
if ( bot level  >  confOption) // confOption in mangosd.conf
{
       tell client that bot level is too high
       return false;
}

If it works, publish a patch on this forum for others to try. I am reluctant to include too many options in the source itself, for stablity reasons.

Hope this helps

Link to comment
Share on other sites

Hi Guys,

I have updated blueboy to be compatible with MaNGOS[9472]. The current code includes the recent changes with 'PlayerSpell' so there is no further need to apply the patch I provided in #819.

The addition of 'soap' has broken MaNGOS-9439-ScriptDev2.patch

Please note that the current ScriptDev2 bind patch MaNGOS-9439-ScriptDev2.patch is broken. I have notified ScriptDev2.com and submitted a modified patch for their consideration. In the meantime, if you are compiling MaNGOS[9466]+ you will need this patch to replace MaNGOS-9439-ScriptDev2.patch.

From 35b3e28341fa4a8984563696ba851d9983065237 Mon Sep 17 00:00:00 2001
From: Derex <[email protected]>
Date: Tue, 23 Feb 2010 16:02:36 +0200
Subject: [PATCH] [PATCH] ScriptDev2 patch.

---
configure.ac             |    6 +++++-
src/bindings/Makefile.am |    2 +-
src/mangosd/Makefile.am  |    4 ++--
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 276827e..d8e6111 100644
--- a/configure.ac
+++ b/configure.ac
@@ -297,7 +297,11 @@ AC_CONFIG_FILES([
   src/mangosd/Makefile
   src/mangosd/mangosd.conf.dist
   src/bindings/Makefile
-   src/bindings/universal/Makefile
+   src/bindings/ScriptDev2/Makefile
+   src/bindings/ScriptDev2/scriptdev2.conf.dist
+   src/bindings/ScriptDev2/config.h
+   src/bindings/ScriptDev2/sql/Makefile
+   src/bindings/ScriptDev2/sql/Updates/Makefile
])

## Configure ACE, if needed
diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am
index d7dc654..79ea910 100644
--- a/src/bindings/Makefile.am
+++ b/src/bindings/Makefile.am
@@ -14,4 +14,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

-SUBDIRS = universal
+SUBDIRS = ScriptDev2
diff --git a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am
index 25d5d79..f4963aa 100644
--- a/src/mangosd/Makefile.am
+++ b/src/mangosd/Makefile.am
@@ -34,7 +34,7 @@ mangos_worldd_SOURCES = \\

## Link world daemon against the shared library
mangos_worldd_LDADD = \\
-    ../bindings/universal/libmangosscript.la \\
+    ../bindings/ScriptDev2/libmangosscript.la \\
    ../game/libmangosgame.a \\
    ../shared/Database/libmangosdatabase.a \\
    ../shared/Config/libmangosconfig.a \\
@@ -45,7 +45,7 @@ mangos_worldd_LDADD = \\
   ../../dep/src/g3dlite/libg3dlite.a \\
   ../../dep/src/gsoap/libgsoap.a

-mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../../dep/src/gsoap -L../bindings/universal/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic
+mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../../dep/src/gsoap -L../bindings/ScriptDev2/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic

## Additional files to include when running 'make dist'
#  Include world daemon configuration
-- 
1.6.2.5

Edit: I have tested the code on blueboy with

MaNGOS[9473]

SD2[1606] with above patch

auctionhousebot [Naicisum] latest, with Mail.cpp fix

autobroadcast[Xeross] old

It compiles and runs without issue.

Hope this helps

Link to comment
Share on other sites

blueboy, you're simply amazing! You're like a Swiss Army Knife with the versatility you show in all the patches and fixes you're constantly contributing to the community at large.

I had an idea regarding the issue with using ".bot add" macros. It might be way off base but, here goes...

Does the client prefix commands using macros with a different opcode than normal chat commands or at least sends some sort of flag when a macro is invoked? Maybe Playerbot can trap this and then count the number of ".bot add" commands that follow by doing a string compare?

Link to comment
Share on other sites

blueboy, you're simply amazing! You're like a Swiss Army Knife with the versatility you show in all the patches and fixes you're constantly contributing to the community at large.

I had an idea regarding the issue with using ".bot add" macros. It might be way off base but, here goes...

Does the client prefix commands using macros with a different opcode than normal chat commands or at least sends some sort of flag when a macro is invoked? Maybe Playerbot can trap this and then count the number of ".bot add" commands that follow by doing a string compare?

Hi,

Thanks for the idea. I have traced the incomming commmd for both from command line and macros. They seem to be processed using the same opcode. I was concerned that the macro command might be treated like a data packet, encompassing multiple commands. However I have examine the incoming data and this is not so. The macro is broken down into its elemental commands and parsed individually. The command parsing process appears to occurs faster than the query/update process for the database. I don't want to slow the parsing process down, for obvious reasons. Maybe the use of a tally would work better than interrogating the database each time. Things to think about

Cheers

Link to comment
Share on other sites

Hi Guys,

I believe I have overcome the difficulties with macros. The new patch appears to work with both command line & macros. Please give it a try and let me have some feedback.

I have used a faster way to update the database, switching from

CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE guid = '%u'", guid);

to

CharacterDatabase.DirectPExecute("UPDATE characters SET online = 0 WHERE guid = '%u'", guid);

and it seems to do the trick

diff --git a/src/game/PlayerbotMgr.cpp b/src/game/PlayerbotMgr.cpp
index 2928851..8af19db 100644
--- a/src/game/PlayerbotMgr.cpp
+++ b/src/game/PlayerbotMgr.cpp
@@ -522,6 +522,36 @@ bool ChatHandler::HandlePlayerbotCommand(const char* args)
        m_session->GetPlayer()->SetPlayerbotMgr(mgr);
    }

+    QueryResult *resultrealm = loginDatabase.PQuery("SELECT active_realm_id FROM account WHERE id = '%u'", m_session->GetAccountId());
+    if(resultrealm)
+    {
+        Field *fields=resultrealm->Fetch();
+        uint32 acctrealmid = fields[0].GetUInt32();
+        if(acctrealmid == sConfig.GetIntDefault("PlayerbotAI.DisableBotInRealm", 0))
+        {
+            PSendSysMessage("bots are disabled for this realm.");
+            SetSentErrorMessage(true);
+            delete resultrealm;
+        return false;
+        }
+    } 
+    delete resultrealm;
+
+    QueryResult *resultchar = CharacterDatabase.PQuery("SELECT Count(*) FROM characters WHERE online = 1 AND account = '%u'", m_session->GetAccountId());
+    if(resultchar)
+    {
+        Field *fields=resultchar->Fetch();
+        uint32 acctcharcount = fields[0].GetUInt32();
+        if((acctcharcount > sConfig.GetIntDefault("PlayerbotAI.MaxNumBots", 9)) && (cmdStr == "add" || cmdStr == "login"))
+        {
+            PSendSysMessage("You cannot summon anymore bots for this account.");
+            SetSentErrorMessage(true);
+            delete resultchar;
+        return false;
+        }
+    }
+    delete resultchar;
+
    if (cmdStr == "add" || cmdStr == "login")
    {
        if (mgr->GetPlayerBot(guid)) {
@@ -529,6 +559,7 @@ bool ChatHandler::HandlePlayerbotCommand(const char* args)
            SetSentErrorMessage(true);
            return false;
        }
+        CharacterDatabase.DirectPExecute("UPDATE characters SET online = 1 WHERE guid = '%u'", guid);
        mgr->AddPlayerBot(guid);
        PSendSysMessage("Bot added successfully.");
    }
@@ -539,6 +570,7 @@ bool ChatHandler::HandlePlayerbotCommand(const char* args)
            SetSentErrorMessage(true);
            return false;
        }
+        CharacterDatabase.DirectPExecute("UPDATE characters SET online = 0 WHERE guid = '%u'", guid);
        mgr->LogoutPlayerBot(guid);
        PSendSysMessage("Bot removed successfully.");
    }
diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
index a36f2fa..ed263bb 100644
--- a/src/mangosd/mangosd.conf.dist.in
+++ b/src/mangosd/mangosd.conf.dist.in
@@ -1424,9 +1424,21 @@ SOAP.Port = 7878
#    PlayerbotAI.FollowDistanceMax
#        Min. and Max. follow distance for bots
#        Default: 0.5 / 1.0
+#
+#    PlayerbotAI.DisableBotInRealm
+#        Disable the bot command and bot menu for this realm
+#        Default: 0 - off
+#        Realm id: - on
+#
+#    PlayerbotAI.MaxNumBots
+#        Limits the number of bots per account (Max 9)
+#        Default: 9
+#
###################################################################################################################

PlayerbotAI.DisableBots = 0
PlayerbotAI.DebugWhisper = 0
PlayerbotAI.FollowDistanceMin = 0.5
-PlayerbotAI.FollowDistanceMax = 1.0
\\ No newline at end of file
+PlayerbotAI.FollowDistanceMax = 1.0
+PlayerbotAI.DisableBotInRealm = 0
+PlayerbotAI.MaxNumBots = 9
\\ No newline at end of file

Cheers

Link to comment
Share on other sites

i pulled the new reversion on mangos and after that i pulled your repo.... and i had merge conflicts in Player.cpp

O.K

I just looked at the code, and it seem they have modified Player.cpp in MaNGOS[9496]. They left an additional blank line at the end of the file. Nothing to worry about. Delete the reject merge marks from Player.cpp, and the additional blank line if you wish. It should not effect compilation, or the running of the code.

Edit: Marks to remove

<<<<<<< HEAD
=======


>>>>>>> 6f01ad7465e5005472d5ea59f04d8b9b2a9049f9

then

git add src/game/Player.cpp

git commit -a

The default editor will open showing the merge comment + the conflict you have addressed. Save the file. To check that the merge has occured

git log

Hope this helps

Link to comment
Share on other sites

the edit button takes a lot of time to load for some reason: it still shows the Merge thig in the git window

Hi,

The edit button on what? I presume you are referring the the 'commit header' for the merge. If this is so, that perfectly normal. The header is just a description of the merge process. It's saying that you carried out a merge and there was a conflict in Player.cpp, during the process. Type the following

git log

examine the commit history. If the expected version of MaNGOS (in square brackets) is listed, then the merge was successful.

If you find the conflict reference untidy, particulary if you are planning to publish (or push) to an online github repo, you can remove the reference.

You can do this immediately after the commit

git commit -a

the default editor will open; remove the reference; and then save the file.

Or, If you want to change the reference after saving the file, maybe you forgot to change it :rolleyes:

git commit --amend

the default editor will open again, allowing you to modify the description. When you are happy, save the file.

git log

to view the changes.

Hope this helps

Link to comment
Share on other sites

the problem is that when i insert git commit -a in my git window(after doing the change in player.cpp and i did git add src/game/player.cpp) it shows me something like this:

Merge brach 'master' of git://github.com/blueboy/mangos

Confilcts:

src/game/Player.cpp

#

# It looks like you may be commiting a MERGE

# If this is not correct, please remove the file

.git/MERGE_HEAD

# and try again.

# Please enter the commit message for your change.

and some other lines .. what the hell do i do now ?? ...

Link to comment
Share on other sites

the problem is that when i insert git commit -a in my git window(after doing the change in player.cpp and i did git add src/game/player.cpp) it shows me something like this:

Merge brach 'master' of git://github.com/blueboy/mangos

Confilcts:

src/game/Player.cpp

#

# It looks like you may be commiting a MERGE

# If this is not correct, please remove the file

.git/MERGE_HEAD

# and try again.

# Please enter the commit message for your change.

and some other lines .. what the hell do i do now ?? ...

That's the commit header I mentioned in my last post. To edit it,

git commit --amend

Merge brach 'master' of git://github.com/blueboy/mangos
Confilcts:      // REMOVE THIS LINE
src/game/Player.cpp   //REMOVE THIS LINE
#
# It looks like you may be commiting a MERGE
# If this is not correct, please remove the file
.git/MERGE_HEAD
# and try again.

# Please enter the commit message for your change.
and some other lines .. what the hell do i do now ?? ...

save the file, then

git log

to view the changes.

Cheers

Link to comment
Share on other sites

Hi Guys,

I have updated the code on blueboy to be compatible with MaNGOS[9509]. I have tested the code with

SD2[1619]

auctionhousebot[Naicisum] // with fix for Mail.cpp

autobroadcast[Xeross] old

PSMDB[295][silvermoon Project]

it compiles and runs without issue.

I have received little or no response to the patches I posted on this forum. I guess, no news is good news. Anyway, I have now included all in the new release. I have not found any problems, but please let me know if you do.

Hope this helps

Link to comment
Share on other sites

Hello Blueboy, very impressive work sir. I've been successfully running your patch for a few days now and I must say the AI has come a long way since I last attempted to bring in this work. Nice!

I have run into a couple crashes occasionally after populating about 3 bots in a group -- the purpose of this message is to attempt to provide some helpful info on the nature of this crash for future dev.

In the mean time, I'm going to update to your latest patch as described above. Please let me know if this info is helpful at all or how I may offer assistance with this effort. Thanks.

Sincerely,

Bramm

MaNGOS/0.16.0-DEV, Revision 9469

udb 0.11.6, pack 387, acid 3.0.3, sd2 1608

from Server.log

2010-03-04 19:25:27 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:25:27 ERROR:SESSION: received not allowed opcode CMSG_LFD_PARTY_LOCK_INFO_REQUEST (0x0371)

2010-03-04 19:25:55 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:26:10 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:26:49 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:26:54 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:27:35 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:27:35 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

Link to comment
Share on other sites

Hello Blueboy, very impressive work sir. I've been successfully running your patch for a few days now and I must say the AI has come a long way since I last attempted to bring in this work. Nice!

I have run into a couple crashes occasionally after populating about 3 bots in a group -- the purpose of this message is to attempt to provide some helpful info on the nature of this crash for future dev.

In the mean time, I'm going to update to your latest patch as described above. Please let me know if this info is helpful at all or how I may offer assistance with this effort. Thanks.

Sincerely,

Bramm

MaNGOS/0.16.0-DEV, Revision 9469

udb 0.11.6, pack 387, acid 3.0.3, sd2 1608

from Server.log

2010-03-04 19:25:27 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:25:27 ERROR:SESSION: received not allowed opcode CMSG_LFD_PARTY_LOCK_INFO_REQUEST (0x0371)

2010-03-04 19:25:55 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:26:10 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:26:49 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:26:54 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:27:35 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

2010-03-04 19:27:35 ERROR:SESSION: received not allowed opcode CMSG_LFD_PLAYER_LOCK_INFO_REQUEST (0x036E)

Hi,

Thanks very much for the feedback. All information is useful. vladex is quite right, there have a lot of changes since MaNGOS[9469]. Looking at the errors you're receiving, I would hazard a guess that it has something to do with 'soap'. This was added to the MaNGOS[9466], as an improvement to remote server access.

I believe these opcodes are used for resource locking purposes. In a multi-thread system, multiple routines may try to access the same resource. Locking the resource prevents this. I notice in MaNGOS[9488] there was a fix for 'semaphore locking' with MaNGOSsoap. I sure everything is being done to iron out issues with this new feature. If you do not use it, (activated in 'mangosd.conf') then these errors in server.log can be safely ignored. I am sure that when you update to the latest code on blueboy, that these issues will probably vanish. I will setup server.log on my box to check this out.

Thanks again for your reponse

EDIT: O.K I have check my server, and the same thing is happening. I must admit it does not cause any problems, in the way the server functions. I have done some more research on the opcodes. It appears that they are used with the new 'Dungeon Finder' feature on the client (3.3.0). LFD - Looking for Dungeon & LFG - Looking for group. I get the idea from what I have found, that locking info is a way to prevent cheating on Blizzard servers. The client is basicially asking the server for lock out information. The MaNGOS servers at present do not support this informatiion request. Thus the error. Hope this helps

Link to comment
Share on other sites

Hi Guys,

When I created the pet feed patch for PlayerbotHunterAI, it lacked the visual action where the hunter actually throws the food to it's pet. I have now put that right. I have added the changes to the code on blueboy, and merged with MaNGOS[9528].

I hope you like it

Edit: I have tested the code, it compiles and runs without issue.

note that SD2[1633] has an issue, 'boss_anubarak' is defined twice, causing a build error. I would stick with [1631] until they sort it out.

Cheers

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use