DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • July 18, 2019, 10:45:57 PM
Home Forums News Downloads Login Register Advanced Search
* *
DragonPrime Menu
Login
 
 
Resource Pages
Search

  Show Posts
Pages: [1] 2 3 ... 18
1  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Translation Wizard on: June 16, 2019, 06:46:58 PM
Ofc you could translate everything in code, but in case of an update of the module all your translations will be lost or you will have a hard time merging the changes into your stuff. Also the module will then still be only in one language, what not really matters as a multi language server hardly makes sense - in my opinion.
2  Coding Support / Coding Support Desk / Re: Going from md5 to password_hash function on: February 24, 2019, 11:35:58 AM
If you escape strings correctly or use prepared statements, which natively do that, you don't have to hash anything. But truth is probably that lotgd is not sql injection save.

But to topic, if you want to secure passwords you should also consider adding salt (& pepper) when hashing.
3  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Accounts not saving to db on: January 18, 2019, 10:52:14 AM
Well, if you say that the db connect file exists and is valid then the issue must be when reading the file to get the variables and that happens in the common.php file. Try printing the variables there and if the values are null / undefined you know that there is an issue with reading the file, not really sure how to solve that then, haven't worked with php and lotgd codebase for quite some time.
4  Coding Support / Coding Support Desk / Re: Tables Question on: January 10, 2019, 09:30:46 AM
The tables (including borders and margin) must not exceed 100% width of the parent element, else they will still show under each other even while floating.
5  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Accounts not saving to db on: January 02, 2019, 11:04:27 AM
db_connect is just a lotgd wrapper method, internally mysql_connect is used unless you modify the files for another database server - which seems not to be the case.

Try debuging the common.php file where the database connection is established and if the variables $DB_HOST, $DB_USER, $DB_PASS are set (probably not). Then the issue must be as line 101: require_once("dbconnect.php"); where these variables should be set.
6  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Accounts not saving to db on: January 01, 2019, 06:22:09 AM
Is the installed game working? Can you create a new - normal user - account? Or do you get the same error there?
7  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Accounts not saving to db on: December 30, 2018, 02:56:17 PM
And is the content of your dbconnect file valid? When trying to install again, did you delete the dbconnect file before that? If not you should do so.
Also, did you check that all database tables were created during installation?
8  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Accounts not saving to db on: December 29, 2018, 02:25:07 PM
Have you tried running the installation process again? And do you get any error messages there? If not you can check your servers php and mysql error logs, their location and existence depends on your configuration and operating system. Check google in that case.

Can you create normal characters? If so you could just create one and apply superuser privileges through the database.
9  Coding Support / Coding Support Desk / Re: OK, Why Are My Stats Showing In Someone Else's Bio? on: November 13, 2018, 11:00:34 AM
Check which parameters can be passed to get_module_pref and how you use them when getting "birdtrain" and "birdname". You'll figure it out.
10  Game Administration, Installation and Configuration / The Idea Place / Re: concerning the spelling bee on: October 23, 2018, 12:16:12 AM
I'm only on my mobile so writing Code is a bit tough right now but I'll try to explain a little more


Code:
// define an array with questions and answers. [ ] is like array( )
// this is placed at top of the run or run event function
// answer is an array of arrays which contain a value and the correct index if it's the correct word
$questions = [
  [
    'question' => '`3What is it when you ask for help?`n`n',
    'answers' => [['value' => 'assistance', 'correct' => 1], ['value' => 'assisstance']['value' => 'asisstance'], ['value' => 'asisstance']]
  ],
  ...
];

When asking the question
Code:
$randomKey = e_rand(0, count($questions)-1);
// get random question from array
$question = $questions[$randomKey];
// print the question
output($question['question']);
$x = 1;
//print and add navs for all answers in a random order
foreach(shuffle($question['answers']) AS $answer) {
  output("`#$x)".$answer['value']."`n");
  // all navs go to the same op
  // add the selected word and the randomkey to the navigation
  addnav("`b`G$x)".$answer['value']."`b","runmodule.php?module=spellingbee&op=check&key=$randomKey&word=".$answer['value']);
  $x++;
}

And then just check if the 'correct' index is set for the 'word' and the 'key'.

Code:
// when op is 'check'
// get randomkey and selected word from navigation
$key = httpget('key');
$word = httpget('word');
// get question from the question array
$q = $questions[$key];
// run through all answers and check if the value is equal to the selected word from the navigation. If the word equals check if the correct index is set
$right = false;
foreach($q['answers'] AS $a) {
  if($a['value'] == $word && isset($a['correct']) {
    output("Yey, you're right!");
    $right = true;
  }
}
// if the wrong value was selected
if(!$right) {
  output("Aww, you're wrong!");
}
11  Game Administration, Installation and Configuration / The Idea Place / Re: concerning the spelling bee on: October 21, 2018, 10:21:47 AM
Haven't really read your posts, just looked at those snippets. No matter if the array comes from a database or is static, it will be far easier to handle and extend than the way it's currently written in. What I was thinking of is something like this:

I'll only write pseudo like code, so don't just copy&paste

at the beginning of the run function
Code:
$questions = [
  [
    'question' => '`3What is it when you ask for help?`n`n',
    'answers' => [['value' => 'assistance', 'correct' => 1], ['value' => 'assisstance']['value' => 'asisstance'], ['value' => 'asisstance']]
  ],
  ...
];

When asking the question
Code:
$question = $question[$randomKey]; // get random question from array
output($question['question']);
$x = 1;
foreach(shuffle($question['answers']) AS $answer) {
  output("`#$x)".$answer['value']."`n");
  addnav("`b`G$x)".$answer['value']."`b","runmodule.php?module=spellingbee&op=jj68baef&key=$randomKey&word=".$answer['value']);
  $x++;
}

And then just check if the 'correct' index is set for the 'word' and the 'key'.

Code:
$key = httpget('key');
$word = httpget('word');
$q = $questions[$key];
foreach($q['answers'] AS $a) {
  if($a['value'] == $word && isset($a['correct']) {
    output("Yey, you're right!");
  }
}
12  Game Administration, Installation and Configuration / The Idea Place / Re: concerning the spelling bee on: October 19, 2018, 08:07:10 AM
Assuming you have your answers in an array fetched from the database, just shuffle that array (any amount of answers possible) and pass the selected word in your navigation and check on the next page if the word in your navigation is the correct one. No idea what you were planing with printing all 24 (4!) possibilities.

~
13  Coding Support / Coding Support Desk / Re: Screenreader Accessibility?? on: May 05, 2018, 01:51:40 AM
Why would you want to create a superuser flag for that? Use a module pref, far more flexible and you don't have to mess around with the core files and it can be assigned to any user you want.

An please don*t use caps lock in your texts, no one wants to be shouted at.
14  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Upgrade 1.1.0 to 1.1.2 on: February 01, 2018, 12:13:43 AM
Not realy done this before, but this is about what I would do.

1. Export and Backup your live database and files
2. Import all (at least vital) information from the old database into the new one on your local test server
3. Inform your players that some recent progression (the last day or something) may be lost and that the site will go down for a couple of hours due to updating
4. Clean your server and upload your copy of 1.1.2
5. Run the installation process
6. Import your prepared local DB into the new live server

If your local DB is good enough prepared you might even skip installation and create the dbconnect manually.

Like I said that's only what I would do and there might be something missing which I'm not thinking about right now.
15  Coding Support / Coding Support Desk / Re: The Desert - Question on: January 30, 2018, 10:21:17 AM
Just one thing, if you use
Code:
<?php
$args
['creaturelose'] = $row['creaturelose'];
you should select that field from the DB as well, which you do not in the code you posted.
Pages: [1] 2 3 ... 18

*
DragonPrime Notices
Play LoGD on Dragonprime

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