vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   RPG Integration Hack (https://vborg.vbsupport.ru/forumdisplay.php?f=102)
-   -   RPG Integration Hack - Old Support Thread (https://vborg.vbsupport.ru/showthread.php?t=73868)

rinkrat 09-30-2004 07:47 PM

My site has been going slow since I added this hack and I'm not real sharp on queries but one of my tech guys sent me a list from the logs saying there are a ton of queries in showthread.php, including a lot of RPG stuff. Any way I can clear out some of this stuff and speed things up a bit because I'm getting server busy with only 50 people online? (He says the LEFT JOIN's at the bottom are killing me)

Code:

From showthread.php:
SELECT
post.*, post.username AS postusername, post.ipaddress AS ip,
user.*, userfield.*, usertextfield.*,
user.ma AS uma,user.hp AS uhp,user.pp AS upp,user.ap AS uap,".TABLE_PREFIX."rpg_battle_options.namefield,".TABLE_PREFIX."rpg_battle_options.exprate,".TABLE_PREFIX."rpg_battle_options.privacy AS battleprivacy,".TABLE_PREFIX."rpg_items_user.*,".TABLE_PREFIX."rpg_battle_stats.*,".TABLE_PREFIX."rpg_rpg_race.name AS rpgracename,".TABLE_PREFIX."rpg_rpg_race.alignment AS rpgalignmentname,".TABLE_PREFIX."rpg_rpg_classf.name AS fclassname,
".TABLE_PREFIX."rpg_rpg_classf.folder AS fclassfolder,".TABLE_PREFIX."rpg_rpg_classm.name AS mclassname,".TABLE_PREFIX."rpg_rpg_classm.folder AS mclassfolder,".TABLE_PREFIX."rpg_rpg_element.name AS elename,
" . iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "
" . iif($vboptions['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline,') . "
" . iif($vboptions['reputationenable'], 'level,') . "
" . iif(!$deljoin, 'NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,') . "
editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason,
post_parsed.pagetext_html, post_parsed.hasimages,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
" . iif(!can_moderate(), $datastore['hidprofilecache']) . "
FROM " . TABLE_PREFIX . "post AS post, ".TABLE_PREFIX."rpg_battle_options, ".TABLE_PREFIX."rpg_items_options
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN ".TABLE_PREFIX."rpg_items_user ON ".TABLE_PREFIX."rpg_items_user.userid=user.userid
LEFT JOIN ".TABLE_PREFIX."rpg_battle_stats ON ".TABLE_PREFIX."rpg_battle_stats.userid=user.userid
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_classf ON ".TABLE_PREFIX."rpg_rpg_classf.id=user.rpgclass
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_classm ON ".TABLE_PREFIX."rpg_rpg_classm.id=user.rpgclass
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_element ON ".TABLE_PREFIX."rpg_rpg_element.elementid=user.element
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_race ON ".TABLE_PREFIX."rpg_rpg_race.raceid=user.rpgrace AND ".TABLE_PREFIX."rpg_rpg_race.alignmentid=user.alignment
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
" . iif($forum['allowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = post.iconid)") . "
" . iif($vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") .
iif($vboptions['reputationenable'], " LEFT JOIN " . TABLE_PREFIX . "reputationlevel AS reputationlevel ON(user.reputationlevelid = reputationlevel.reputationlevelid)") . "
" . iif(!$deljoin, "LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND deletionlog.type = 'post')") . "
LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid = post.postid)
WHERE $postids
ORDER BY dateline $postorder


Blam Forumz 09-30-2004 08:03 PM

Quote:

Originally Posted by Revan
Just alter the SQL to have Dropdown as default, and then remove the Choose stuff from the template AND the php

And how would i go about doing that ? :|

Revan 10-01-2004 02:12 PM

Quote:

Originally Posted by RMS
Ah, this isn't a big deal but what I meant was is there a way to get a link to display stats in the profile that anyone can see of a certain person? I have the link in the usercp but currently the only way to see another person's character is to find a thread he posted in and then look it up there.

No theres no such mod available atm. :)

Quote:

Originally Posted by RMS
Sorry if this has been asked before but is there a reason that classes are based upon gender? Maybe I'm just not clear on it but it seems that this isn't very useful. Races are based on alignment so in turn it would be nice to have classes that are exclusive to certain races. Is this possible?

What I would like to do is for example do something like make a race of dwarves where if you choose them you can then only choose a class that is proficient in melee and not magic. The way I see it now is that no matter your alignment or race, you can be pretty much any class that is availalable. This way I can't even divide it so that only the default race of orcs can only be black mages. Personally I find it a bit contradictory to allow good people to be a black mage.

At the very least is there any real purpose to creating more class types other than to organize things better?

Is this just the way it is, am I mistaken or is there a way to fix this?

The main reason to have Class Types is that you can limit the ITEMS each class can use.

Theres currently no way of seperating races by alignment. It would also be impossible to both seperate by alignment AND gender (afaik).
Redesigning this would mean having to mess about with JavaScript, which I dont know ANYTHING about, so no can do :(

Quote:

Originally Posted by RMS
Also I seem to have a problem. After battles (and maybe something else) it seems that some or all characters have their max MP and PP calculated incorrectly, making it become some huge number. When I was level one I could go to my character edit screen and update it which would fix it. Now even when I do that nothing happens. :surprised:

Weird. You could try lowering the MA and PP modifiers in the acp, then update stats.
Recommended values for versions < 2.5.3 is 0.003
:)


Quote:

Originally Posted by rinkrat
My site has been going slow since I added this hack and I'm not real sharp on queries but one of my tech guys sent me a list from the logs saying there are a ton of queries in showthread.php, including a lot of RPG stuff. Any way I can clear out some of this stuff and speed things up a bit because I'm getting server busy with only 50 people online? (He says the LEFT JOIN's at the bottom are killing me)

If you know any other way of merging all those different tables that uses less query time, do let me know ;)


Quote:

Originally Posted by Blam Forumz
And how would i go about doing that ? :|

1. Open profile.php and pick out all that has anything to do with rpgpostbit, namely:
PHP Code:

        if ($bbuserinfo['rpgstats'] == 1)
        {
            
$rpg_postbit1 '<input type="radio" name="rpgpostbit" value="1" CHECKED /> Display RPG stats in postbit';
            
$rpg_postbit2 '<input type="radio" name="rpgpostbit" value="0" /> Display RPG stats in dropdown';
        } 
        else if (
$bbuserinfo['rpgstats'] == 0
        {
            
$rpg_postbit1 '<input type="radio" name="rpgpostbit" value="1" /> Display RPG stats in postbit';
            
$rpg_postbit2 '<input type="radio" name="rpgpostbit" value="0" CHECKED /> Display RPG stats in dropdown';
        } 

and
PHP Code:

rpgstats='$rpgpostbit' 

Then pick out the stuff that shows the $rpg_postbit variables, the entire table preferrably :P

Then run this:
[sql]
ALTER TABLE `user` CHANGE `rpgstats` `rpgstats` CHAR( 1 ) DEFAULT '0' NOT NULL ;
UPDATE `user` SET `rpgstats`='0';
[/SQL]
Remember to add a prefix if you use it.

TJFweb 10-01-2004 02:35 PM

Revan: Any ETA on v3?

I check this thread every day in anticipation ;-)

RMS 10-01-2004 04:51 PM

Ah thanks. Indeed if the MA and PP modifiers should be something around .003 then my values were a bit off. I think they were default but I had 2 and 3. So far it seems to be fixed :)

Revan 10-01-2004 04:55 PM

Quote:

Originally Posted by TJFweb
Revan: Any ETA on v3?

I check this thread every day in anticipation ;-)

About 3-4 months would probs not be too far off the mark.

rinkrat 10-01-2004 07:42 PM

I removed the RPG stats in postbit and it seems to have speeded up things dramatically.

starfantazy 10-02-2004 03:37 AM

could you let me know when you get the female part of the hack fixed..... i really want to use it and im one of the few that cant, its such a tease :nervous: haha

Revan 10-02-2004 07:56 AM

I would send you the alpha build of the "new feature-less" v3 once I get the acp done redesigned, but I dont want to upload it anywhere and link to it in PM, and I most def dont want to attach it here cos I dont want everyone grabbin it
lol
:p

Blam Forumz 10-02-2004 09:38 AM

Wanna send it to me? my board is so small it almost doesnt exist :P


All times are GMT. The time now is 08:57 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01989 seconds
  • Memory Usage 1,767KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete