DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • November 22, 2017, 01:45:57 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2 3 ... 10
 1 
 on: November 20, 2017, 08:12:42 PM 
Started by TGTarheel - Last post by phu
I am pretty sure I never messed with the sanitize function, I would have had no reason to.

Just curious...do you document all your code and especially your changes to the core code in the files?  If not, strongly recommended...

TGTarheel: Since LotGD is a download and not a repository you clone, if you intend to change it much, you could use git to track your changes (by creating a new repository in your LotGD directory with git init) so you can always see what you've changed (and why, as long as you use good commit messages).

Really, you could use any version control mechanism, but git is my favorite. git-flow is a really nice utility that provides some great convenience methods for managing branches. You can also set up a repository on GitHub or BitBucket (the latter allows private repos on a free account, which is nice) so you can always keep a web-browsable, up to date backup of your personal LotGD installation.

 2 
 on: November 20, 2017, 08:04:00 PM 
Started by TGTarheel - Last post by phu
For a well-maintained, powerful utility designed specifically to search code, I recommend ack. I've been using it for years instead of grep for searching projects.

This will search the modules/ directory for the text addnews( (the parenthesis will be interpreted as part of an incomplete regular expression if you don't escape it; this isn't necessary, but if you don't use it, you'll see a lot of comments in this directory that are just #://addnews ready):

Code:
you@yourpc:/tmp/lotgd$ ack --php "addnews\(" modules/

You could also just use this to search all PHP files in the current directory (recursively) for the string "addnews":

Code:
you@yourpc:/tmp/lotgd$ ack --php addnews

 3 
 on: November 09, 2017, 10:22:00 AM 
Started by TGTarheel - Last post by TGTarheel
So here is original coding
Code:
//split into array of words
$filtstr = explode(" ", trim($string));
foreach ($filtstr as $key => $filtstr1)
$filtstr[$key] = trim($filtstr1);

This is lines 71-74
The call stack happens at line 85
Code:
if (strlen($filtstr) > strlen($filterpost1))

Somewhere along the line you have edited the code incorrectly.  The correct line 85 in riddles.php is
Code:
if (strlen($filtstr1) > strlen($filterpost1))
(note the '1' in 'filtstr1').

Thanks, Boris...this worked!

 4 
 on: November 06, 2017, 09:40:50 AM 
Started by TGTarheel - Last post by TGTarheel
I have not looked at the item system module at all, and you did not provide a full snippet of the _dohook() function, so I am going to assume that this is in a switch case. It is better to just add a break for those under 100 Dragon kills - it will look a lot nicer in the code, rather than wrapping everything in an if statement.

Code:
<?php
        
global $session;
        if (
$session['user']['dragonkills'] <= 100) {
            break;
        }
require_once("lib/itemhandler.php");
$inventory get_inventory();
$count=0;
while ($item db_fetch_assoc($inventory)) {
$destroyed 0;
for($c=0;$c<$item['quantity'];$c++) {
if($item['dkloosechance'] >= e_rand(1,100)) $destroyed++;

}
if ($destroyedremove_item((int)$item['itemid'], $destroyed);
$count+=$destroyed;
}
if ($count == 1) {
output("`n`2Shattered around you lie the remains of a once mighty item destroyed by the power of the dragon's flames. ");
} else if ($count 1) {
output("`n`2Shattered around you lie the remains of once mighty items destroyed by the power of the dragon's flames. ");
output("It seems `^%s items`2 have been destroyed."$count);
}

So it accomplished the same thing...
It just breaks the case if under 100 dragonkills, and allows it to continue if not.

Thanks.

Not sure really why that is cleaner...I guess I do not know a whole lot about standards and practices...I'm a pretty sloppy coder and always have just done what works, regardless of any standards or protocols, LOL.

Thanks for this, I will try it.

It seems like this would work, from what I know of the code.

Just trying to add a machanism in that balances the game a bit for the elite players, and helps the newbies.

 5 
 on: November 06, 2017, 09:37:17 AM 
Started by TGTarheel - Last post by TGTarheel
So here is original coding
Code:
//split into array of words
$filtstr = explode(" ", trim($string));
foreach ($filtstr as $key => $filtstr1)
$filtstr[$key] = trim($filtstr1);

This is lines 71-74
The call stack happens at line 85
Code:
if (strlen($filtstr) > strlen($filterpost1))

Somewhere along the line you have edited the code incorrectly.  The correct line 85 in riddles.php is
Code:
if (strlen($filtstr1) > strlen($filterpost1))
(note the '1' in 'filtstr1').

Huh.
I never messed with the code on riddles.

I will try it.

 6 
 on: November 06, 2017, 04:35:58 AM 
Started by TGTarheel - Last post by Stephen.Kise
I have not looked at the item system module at all, and you did not provide a full snippet of the _dohook() function, so I am going to assume that this is in a switch case. It is better to just add a break for those under 100 Dragon kills - it will look a lot nicer in the code, rather than wrapping everything in an if statement.

Code:
<?php
        
global $session;
        if (
$session['user']['dragonkills'] <= 100) {
            break;
        }
require_once("lib/itemhandler.php");
$inventory get_inventory();
$count=0;
while ($item db_fetch_assoc($inventory)) {
$destroyed 0;
for($c=0;$c<$item['quantity'];$c++) {
if($item['dkloosechance'] >= e_rand(1,100)) $destroyed++;

}
if ($destroyedremove_item((int)$item['itemid'], $destroyed);
$count+=$destroyed;
}
if ($count == 1) {
output("`n`2Shattered around you lie the remains of a once mighty item destroyed by the power of the dragon's flames. ");
} else if ($count 1) {
output("`n`2Shattered around you lie the remains of once mighty items destroyed by the power of the dragon's flames. ");
output("It seems `^%s items`2 have been destroyed."$count);
}

 7 
 on: November 06, 2017, 12:55:04 AM 
Started by TGTarheel - Last post by Boris735
So here is original coding
Code:
//split into array of words
$filtstr = explode(" ", trim($string));
foreach ($filtstr as $key => $filtstr1)
$filtstr[$key] = trim($filtstr1);

This is lines 71-74
The call stack happens at line 85
Code:
if (strlen($filtstr) > strlen($filterpost1))

Somewhere along the line you have edited the code incorrectly.  The correct line 85 in riddles.php is
Code:
if (strlen($filtstr1) > strlen($filterpost1))
(note the '1' in 'filtstr1').

 8 
 on: November 04, 2017, 07:38:18 PM 
Started by Aeolus - Last post by Aeolus
Another required fix is that all mysql_ functions in the installer need to be updated to db_ functions for use with PHP 7. Three fixed files attached.

Extensions of mysql_ were deprecated in PHP 5.5.0 and removed in PHP 7.0.0. Instead, the MySQLi extension should be used.

If you're also getting "Invalid default value" errors in MySQL for "0000-00-00 00:00:00", follow these instructions.

 9 
 on: November 04, 2017, 09:11:20 AM 
Started by TGTarheel - Last post by TGTarheel
Do try to keep your drama to a minimum here, nobody here appreciates it. Nor did we ask for your life story.

I wasn't born into it, I self-taught myself at 16, started learning how to code properly in Uni at 18, and have only been decent at it for five years. Don't assume.

Shall we get back on topic?

Please.

The original topic was me asking for help.

You have chosen to belittle and shame me instead of HELPING.

I would love to get back to the original topic.

 10 
 on: November 04, 2017, 07:11:57 AM 
Started by TGTarheel - Last post by Aeolus
Do try to keep your drama to a minimum here, nobody here appreciates it. Nor did we ask for your life story.

I wasn't born into it, I self-taught myself at 16, started learning how to code properly in Uni at 18, and have only been decent at it for five years. Don't assume.

Shall we get back on topic?

Pages: [1] 2 3 ... 10

*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

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