DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • October 19, 2017, 08:05:46 PM
Home Forums News Downloads Login Register Advanced Search
* *
DragonPrime Menu
Login
 
 
Resource Pages
Search

  Show Posts
Pages: [1] 2 3 ... 24
1  Coding Support / Coding Support Desk / Re: MYSQL Connect Error on: Today at 10:53:28 AM
I have searched on here for answers but all pertain to installation. My error is post installation. Every once in awhile when my site goes to process this function in the dbwrapper_mysql.php file I get the following error.


Function processed:
Code:
function db_connect($host,$user,$pass){
$fname = DBTYPE."_connect";
$r = $fname($host,$user,$pass);
return $r;


Error that happens:

Code:
PHP Warning:  mysql_connect(): Access denied for user 'thecomz2'@'localhost' (using password: NO) in /home/thecomz2/public_html/lib/dbwrapper_mysql.php on line 204


Can someone tell my why this happens and where Id look to fix it? Id greatly appreciate it.

It's happening because the argument passed for your $pass (database password) is blank. You can tell from the "access denied for user 'redacted'@'localhost' (using password: NO)" bit, which unfortunately gives away your database username... Not the best of security management there, maybe you should edit your post. Look for any db_connect functions - that's where your issue lies. Since it's 'every once in a while', maybe check items hooked into newday_runonce.
2  Coding Support / Coding Support Desk / Re: How Do I Remove Color-Coding Notations From Page Headers? on: October 13, 2017, 08:08:35 AM
I do not believe that was in any way edited or why I would.

I will look for another declaration of page_header then.

Just looked, I do not see another declaration.  I am stumped.

Do you have to somewhere require_once /lib/sanitize.php or something?

That is the only thing I can think of...

You shouldn't have to. There should have been a fatal error because of the undeclared function if you didn't require the file. You should probably try that out before posting about it o.O.
3  Coding Support / Coding Support Desk / Re: How Do I Remove Color-Coding Notations From Page Headers? on: October 12, 2017, 09:26:32 AM
Where the dwellings code uses the page_header function when you enter a dwelling, use the sanitize function first on the dwelling name, then pass that into page_header.

Humm...not sure I get it.  It LOOKS like the sanitize is already being used, nevertheless, I still get unwanted stuff in my page headers.

Here is the code snip for case_enter on dwellins:
Code:
<?php
if (
$session['user']['location'] != get_module_setting("logoutlocation"))
set_module_pref("location_saver"$session['user']['location']);
$sql "SELECT name,description,ownerid FROM ".db_prefix("dwellings")." WHERE dwid=$dwid";
$result db_query($sql);
$row db_fetch_assoc($result); 
if($row['name'] == ""){
$name translate_inline("Unnamed");
}else{
$name $row['name'];
}
page_header("%s",sanitize($name));

Is that not supposed to sanitize the name and get the bold and color codes out of the page header?

Or am I missing something here?


You should look for another declaration of page_header() then. Unless your lib/sanitize.php functions are edited - yes, that should remove the backtick character and anything in the set of [1234567890!@#\$%^&)~QqRVvGgTtjJeElLxXyYkKpPmM?*AabicnHw] (as of 1.2).
4  Village Square / General Discussion Area / Re: What was the fastest playthrough For the first dragonkill on: October 12, 2017, 09:20:24 AM
LevelExp per FightExp for LevelExp DiffRounds
1141001007.14
22440030012.5
334100260217.71
445191291020.22
5553140122822.33
6664707156723.74
7776641193425.12
8898985234426.34
910111795281027.82
10113.315143334829.55
11126.819121397831.37
12140.423840471933.64
1315629437559735.88
1417236071663438.57
1518943930785941.58
=393.51

That would make about 400 rounds for the first dragonkill. Seems like quite a lot just now, maybe exp gain is a little increased in battle (haven't checked the scripts). Also there might be fights vs multiple enemies that give more exp and so on and so on.  Wink
[/quote]
oh lol, thank you... THAT sir is really high end Information Cheesy thanks man. It helps a lot Cheesy

This assumes that players start with no gems, or that they won't find any during fights, it seems. Buying vitality through the inn can seriously effect your gameplay - in higher kill counts, it's not surprising to get a new dragon kill in less than a minute on most servers. Also need to keep in mind that there is the chance of death or loss of experience. Balance and timing is something that's more specific to the server, and the modules in the server.
5  Core Code Development Discussions / Core Development Discussion / Re: AJAX based chat on: September 29, 2017, 07:20:06 AM
Hey, i was just wondering if anyone came up with a solution without tampering with the core code ?
Is this still a thing ?

Yes, there is a solution without editing the core code - but it is not through this module, since it relies on core editing. All you would need to do is to make an API hook, for your javascript to obtain a JSON of all recent commentary, and display it through your javascript.
6  Coding Support / Coding Support Desk / Re: Is It Possible To.... on: September 27, 2017, 12:22:07 PM
That is a very neat idea for something such as a highwayman that targets women. It very much is possible - however without a module to prevent the fight from starting, the creature has a chance to hit once, through the surprise attack mechanic. This can be done through an AI script (Be careful who you give creature editor). You would have to decide on what conditions the creature should attack. If you want it to attack women, you would want to check if $session['user']['sex'] is the constant SEX_FEMALE.

Code:
<?php
global $session$enemies$badguy;
if (
$session['user']['sex'] == SEX_FEMALE) {
    
//We want our highwayman to attack women, but not men. Return to continue the next round of fighting.
    
return;
}
foreach (
$enemies as $id => $enemy) {
    if (
$enemy['creaturename'] == $badguy['creaturename']) {
        unset(
$enemies[$id]);
        
//Remove the highwayman from the fight array. He should flee in group combat.
    
}
}
$badguy['creaturegold'] = 0;
$badguy['creatureexp'] = 0;
$badguy['dead'] = true;
// Remove the rewards, remove the creature from the fight.
output("The Highwayman notices a little too late that you are a male and flees!`n");

Neat.  so this is not a module, but something which goes in the Creature Editor, right?

Because that is what I am looking for.

I am looking to create a few creatures that only attack men...and a few that attack only women.

As an extension to this, I also wanted to create a creature that only attacks a certain race...for example, only Elves or only Trolls, or only Humans or whatever.
Yes, you can drop this script into a creatures 'AI Script' field. Anyone with creature editor can edit an AI - so be VERY, VERY careful who you give creature editor to. It should be treated like the 'Run Raw SQL' or 'Megauser' superuser flags.
7  Coding Support / Coding Support Desk / Re: Is It Possible To.... on: September 26, 2017, 09:55:09 AM
That is a very neat idea for something such as a highwayman that targets women. It very much is possible - however without a module to prevent the fight from starting, the creature has a chance to hit once, through the surprise attack mechanic. This can be done through an AI script (Be careful who you give creature editor). You would have to decide on what conditions the creature should attack. If you want it to attack women, you would want to check if $session['user']['sex'] is the constant SEX_FEMALE.

Code:
<?php
global $session$enemies$badguy;
if (
$session['user']['sex'] == SEX_FEMALE) {
    
//We want our highwayman to attack women, but not men. Return to continue the next round of fighting.
    
return;
}
foreach (
$enemies as $id => $enemy) {
    if (
$enemy['creaturename'] == $badguy['creaturename']) {
        unset(
$enemies[$id]);
        
//Remove the highwayman from the fight array. He should flee in group combat.
    
}
}
$badguy['creaturegold'] = 0;
$badguy['creatureexp'] = 0;
$badguy['dead'] = true;
// Remove the rewards, remove the creature from the fight.
output("The Highwayman notices a little too late that you are a male and flees!`n");
8  Game Administration, Installation and Configuration / The Idea Place / Re: Account ID on: September 22, 2017, 02:44:30 AM
OK...I could try.

What I am actually doing...

Is setting up so that in, let's say, in the hook for village (where my modue would show up)

While it is in the testing stage, I only want it to access certain values and add the nav ONLY for those values.  Everyone else would not have the nav, thus would not stumble into what is not fully tested.

The reason why this first came up in the multi-poke thread, was because that one has setting in it where you can allow ONLY certain account ID's to use certain pokes.

I wanted to know how I would set that up within a module, as a temporary thing, so that, once fully tested, it could then be taken out and thus everyone would get the nav, see?

Now, the way I had done this in the past would be something like this:

Code:
if ($session['user']['id'] <= 10) {
addnav whatever
} else {}

That way only users with an account ID 10 or lower would see the nav.

So, without setting superuser tags on someone...how would I make a player a betatester on something...so that they could still see the nav where other players could not?

THAT is where I am trying to get.  I do not want to give someone Grotto Access just in order to allow them to beta test.  I have some longer-term players that I normally would consider for use for beta-testing, but their account ID's are all over the place and I wanted to order those players so that everything was in the same rage, so that my above coding would work.

I am being told this is not a good plan.  So what I am looking for then....is code that would allow access only to certain players...and without giving them Grotto Access.

Oh, alright. If you are going to give certain users, including non-superuser accounts, access I would use DarknessFall's method or use the 'beta' tag in user editor (Misc Info > Willing to participate in beta). The beta feature will make it so that you don't have a lot of modules where you assign specific access (less preferences saved in the database). Just keep in mind that the beta flag is for beta testing, meaning they have access to all beta features you provide, not just one module. If you are going to flag people as beta testers, then the code would be:

Code:
if ($session['user']['beta']) {
// Code for beta users to access.
}
9  Game Administration, Installation and Configuration / The Idea Place / Re: Account ID on: September 17, 2017, 07:31:57 PM
I heavily advise against this. The acctid is unique for a reason, it's how other tables sync properly. Why not just check for superuser values, or a module setting/pref? Those will be safer than changing the acctid.

If it is for the purpose of letting staff test things, or making a superuser only module, I would rather you go ahead and check against the user's superuser value ($session['user']['superuser']). You can do this with:

Code:
<?php
global $session;
if (
$session['user']['superuser'] & SU_CONSTANT) {
// Functionality
}

Replace SU_CONSTANT with any of the constants prefaced with SU_ in lib/constants.php. The constants are rather autological in that their name is the option you can set in the user editor.
10  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Test Server on: September 09, 2017, 07:23:39 AM
Friendly reminder that phpinfo(); should show your Apache/Nginx version as well as your phone version.
11  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Test Server on: September 06, 2017, 01:18:15 AM
Could anyone actually help me with doing a test server???  I am absolutely clueless as to how to do this.

Absolutely! It's fine if you do not know what to do. Just remember that your learning experience is also someone else's learning experience in the future. If someone googles "How to host a LotGD", they will stumble upon this. Gotta look at it positively.

First thing to ask is if you are going to host locally on your own personal machine, that only you can access, or would you want to host a public test server? If you are going to host a public test server, what kind of hosting do you have now for your live server; is it on a VPS, or just a shared host? If you are going to host it privately, then we need to know what type of operating system you have. Also, for any type of hosting,which version of PHP are you going to run? PHP 7 runs LotGD a lot faster, but the current DragonPrime stable version has issues with PHP 7. PHP 5.4 is just fine, but you will miss out on new features, and you will receive less help from the PHP community as a whole.
12  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: File Discussion: Multi Poke on: September 03, 2017, 01:23:45 PM
Like I said...no Item System...complete deal-breaker.

1) Item System, or 2) required bug fixes and better security measures... I know what I would want for my players. I hope that you're going to let your players know about your choice as well.

Without the Item System, my entire game is shot.  Others run 1.1.0 and Central even runs 1.0.6 so gimme a break, okay??

Security against WHAT??  Even so, no sooner that new "security" stuff is done hackers find a way to break it, so I seriously doybt even 1.1.2 is all that bloody "secure"

Central runs 1.0.6 because there is no affiliation with DragonPrime. It's old, dead code, online for the sake of being online. Anyone who has 1.1.0 is not up-to-date and probably is doing the same - just being online to be online, without updating their servers. There is a bug in 1.1.0 where anyone can set ANY module preference to ANY value they want. Anyone with the creature editor has access to everything on the server. Upgrading is key. Upgrade the items system, don't downgrade a version for legacy modules. 1.1.2 and further revisions are much more secure.
13  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: File Discussion: Multi Poke on: September 02, 2017, 02:35:00 PM
So does this module like, completely work now?

Can I plug and play it into my 1.1.0 server?

I know, I know...a lot of people here hate older versions of the core but I don't.

I have no intention of making it compatible with an older server of the core. It's not that I "hate" the older versions, it's that I have no interest is supporting versions without bug fixes and with security flaws that put players as risk.

Best you can do is just try it on a test server and see if it works.

I did it and it works on 1.1.0
And I have no intention of updating my core to a later version that does not support certain things I need supported.
FWIW:  When the core gets updated, they should MAKE SURE the new core is compatible with everything that came before...if they want people to update.
Core past 1.1.0 does not support Alternate Currencies and my game is dependent on them...without them, my game would not be the game it is and I would have to modify 90 percent of my game.  Not gonna do it.

I don't even know if later version of the core support the Item System, and that, right there, would be a huge deal-breaker.

Quite hard to do if you are going to update the core to current standards, like following the PSR.
14  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: Petra the Tattoo Artist on: August 09, 2017, 12:05:30 AM
Incredibly old post... Has anyone ever revamped the Petra's Tattoo module to make it more usable, so that we don't need to directly edit the module to modify the tattoos? If not, I'll go ahead and do so myself.

There was one, though I doubt it is on DragonPrime. Just do it.
15  Coding Support / Coding Support Desk / Re: Move Superuser Grotto Links on: August 02, 2017, 09:23:40 AM
I was wondering if it would be possible to code a module that would move that link up to the upper right, near, say, the Petition Viewer...instead of in the left-side navigations.

That would require core editing, rather than a module. Take a look at the templates and see how the links are added.

That is not true. Hook into everyheader-loggedin, use the $header global string and append the grotto link after {petitioncount}. Also,
Pages: [1] 2 3 ... 24

*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
30 Guests, 1 User
Maverick
Home Forums News Downloads Login Register Advanced Search