Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2016, 10:42 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,533
Hwona is on a distinguished road
Default Word Scramble Game

This word scramble game is a modification of Kyttias's HiLo game! ~courtesy of Kyttias

Word Scramble Game

Demo: JSBin Preview
Download: Compressed Folder
View game at yoursite.com/wordscramble

Please upload these files:

games/.htaccess
games/wordscramble/sendscore.php
games/wordscramble/wordscramble.php
games/wordscramble/wordscramble.css
games/wordscramble/wordscramble.js
wordscramble.php
classes/class_cookies.php (replace the original file)
view/wordscramble.php

Create this table if you haven't:

phpMyAdmin->SQL->paste
Code:
CREATE TABLE IF NOT EXISTS `adopts_games` (
  `gid` int(11) NOT NULL AUTO_INCREMENT,
  `game` varchar(30) NOT NULL,
  `username` varchar(30) NOT NULL,
  `plays` int(11) NOT NULL,
  `timestamp` int(11) NOT NULL,
  PRIMARY KEY (`gid`),
  UNIQUE KEY `key` (`gid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0;
Modifying Game Code (Advised):
The script runs games/wordscramble/wordscramble.js not games/wordscramble/wordscramble_non.js. wordscramble.js is obfuscated for security: Re-obfuscate Edited Files Here.

This game uses three filler words to unscramble! Don't forget to add more! To do so, edit the arrays at lines 8 and 40 in wordscramble_non.js. Then, obfuscate the code and paste it into wordscramble.js.

Last edited by Hwona; 01-28-2016 at 04:54 PM. Reason: Fixed: Game ends regardless of plays left. I forgot to include one more file in the download: class_cookies.
Reply With Quote
  #2  
Old 01-28-2016, 09:36 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 112,527
Abronsyth is on a distinguished road
Default

Er, ok, something's definitely not right. As soon as I submit the answer it tells me game over, see you tomorrow, and says I have 0 plays left for today (though I've only played once), and then if I refresh the page it resets and says
"Plays Left Today: of 20"

Not updated my currency amount at all, though I guarantee I am getting the answers correct. The only thing I changed in the files would be the words available to unscramble.

It's also not updating at all anywhere in the database, despite me now having attempted to play 4 times.

Even with the 100% original files it's still having this error.
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 01-28-2016 at 09:40 AM.
Reply With Quote
  #3  
Old 01-28-2016, 10:00 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,533
Hwona is on a distinguished road
Default

*bangs head on table*
I forgot one more thing... I recently posted a code replacement for the class cookies file in the hilo thread. Please replace your original file with that? Sorry, Ill do a proper thread update when I have access to my computer.
Reply With Quote
  #4  
Old 01-28-2016, 04:17 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 112,527
Abronsyth is on a distinguished road
Default

Oh dear, I tried that and it resulted in this;
Catchable fatal error: Argument 2 passed to Registry::set() must implement interface Resource\Native\Objective, instance of Cookies given, called in /home/catisserie/public_html/classes/class_mysidia.php on line 237 and defined in /home/catisserie/public_html/classes/class_registry.php on line 198
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #5  
Old 01-28-2016, 04:21 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,533
Hwona is on a distinguished road
Default

Quote:
Originally Posted by Abronsyth View Post
Oh dear, I tried that and it resulted in this;
Catchable fatal error: Argument 2 passed to Registry::set() must implement interface Resource\Native\Objective, instance of Cookies given, called in /home/catisserie/public_html/classes/class_mysidia.php on line 237 and defined in /home/catisserie/public_html/classes/class_registry.php on line 198
Yikes! I guess mys.1.3.4 class files are different too! Try this:
PHP Code:
<?php

/**
 * The Cookies Class, it is one of Mysidia system core classes.
 * It acts as an initializer and wrapper for Mys-related cookies.
 * Cookies is a final class, no child class shall derive from it.
 * An instance of Cookies class is generated upon Mysidia system object's creation. 
 * This specific instance is available from Registry, just like any other Mysidia core objects. 
 * @category Resource
 * @package Core
 * @author Hall of Famer 
 * @copyright Mysidia Adoptables Script
 * @link http://www.mysidiaadoptables.com
 * @since 1.3.2
 * @todo better naming of cookies methods.
 */

final class Cookies extends Core{

    
/**
     * The mysuid property, which stores the id of the current user. 
     * For guest, this id is 0.     
     * @access private
     * @var Int
    */
    
private $mysuid;
    
    private 
$mysusername;
  
    
/**
     * The myssession property, which stores the session var of the current user. 
     * @access private
     * @var String
    */
    
private $myssession;
   
    
/**
     * The mysactivity property, which stores the timestamp for the current user's last activity. 
     * @access private
     * @var Int
    */
    
private $mysactivity;
  
    
/**
     * The mysloginattempt property, which stores how many failed login attempt made by this particular user.
     * @access private
     * @var Int
    */
    
private $mysloginattempt;

    
    
/**
     * Constructor of Cookies Class, it loads mys-related cookie vars from $_COOKIE superglobals.    
     * @access public
     * @return Void
     */     
    
public function __construct(){
        
$keyarray = array("mysuid""mysusername""myssession""mysactivity""mysloginattempt");
        foreach(
$_COOKIE as $key => $val){
            if(
in_array($key$keyarray)) $this->$key $val;
        }    
    }
    
    
/**
     * The get method, which retrieves private cookie item from Cookies object.  
     * If supplied argument is invalid, an exception will be thrown.
     * @param String  $prop
     * @access public
     * @return Boolean
     */    
    
public function getcookies($prop){
        if(!
property_exists('Cookies'$prop)) throw new Exception('The specified cookie is invalid...');
        return 
$this->$prop;
    }
  
    
/**
     * The set method, which handles the four basic cookies vars for user who has just successfully logged in.  
     * If operation is successful, the method returns a Boolean value True, so it can be used in conditional statement.
     * @access public
     * @return Boolean
     */
    
public function setcookies($username){
        
$mysidia Registry::get("mysidia");
        
ob_start();
        
$Month 2592000 time();
        
$this->mysuid $mysidia->db->select("users", array("uid"), "username = '{$username}'")->fetchColumn();
        
setcookie("mysuid",$this->mysuid,$Month"/"$_SERVER['HTTP_HOST']);
        
$this->mysusername $username;
        
setcookie("mysusername",$this->mysusername,$Month"/"$_SERVER['HTTP_HOST']);     
        
$session $mysidia->session->getid();
        
$this->myssession md5($this->mysuid.$session);     
        
setcookie("myssession",$this->myssession,$Month"/"$_SERVER['HTTP_HOST']);     
        
$this->mysactivity time();
        
setcookie("mysactivity",$this->mysactivity,$Month"/"$_SERVER['HTTP_HOST']);
        
$this->mysloginattempt 0;
        
setcookie("mysloginattempt"$this->mysloginattempt,$Month"/"$_SERVER['HTTP_HOST']);
        
ob_flush();
        return 
TRUE;
    }
    
    
/**
     * The setadmincookie method, which handles admincp related cookies.  
     * If operation is successful, the method returns a Boolean value True, so it can be used in conditional statement.
     * @access public
     * @return Boolean
     */
    
public function setAdminCookies(){
        
$mysidia Registry::get("mysidia");
        
ob_start();
        
$Month 2592000 time();
        
$session $mysidia->session->getid();
        
$this->mysadmsession sha1($this->mysuid.$session);     
        
setcookie("mysadmsession",$this->mysadmsession,$Month"/"$_SERVER['HTTP_HOST']);    
        
$this->mysadmloginattempt 0;
        
setcookie("mysadmloginattempt"$this->mysadmloginattempt,$Month"/"$_SERVER['HTTP_HOST']);
        
ob_flush();
        return 
TRUE;
    }

    
/**
     * The delete method, which gets rid of cookies to enable users to log out of the site. 
     * If operation is successful, the method returns a Boolean value True, so it can be used in conditional statement.
     * @access public
     * @return Boolean
     */
    
public function deletecookies(){   
        
$expire time() - 2592000;
        
ob_start();
        
setcookie("mysuid"""$expire"/"$_SERVER['HTTP_HOST']);
        
setcookie("mysusername"""$expire"/"$_SERVER['HTTP_HOST']);
        
setcookie("myssession"""$expire,"/"$_SERVER['HTTP_HOST']);
        
setcookie("mysactivity"""$expire"/"$_SERVER['HTTP_HOST']);
        
setcookie("mysloginattempt"""$expire"/"$_SERVER['HTTP_HOST']);
        
ob_flush();
        return 
TRUE;
    }

    
/**
     * The login method, which evaluates the login attempt of a guest user.
     * @access public
     * @return Void
     */
    
public function logincookies($reset FALSE){
        if(!
$reset$this->mysloginattempt++;        
        else 
$this->mysloginattempt 0;
        
ob_start();
        
$Month 2592000 time();
        
setcookie("mysloginattempt"$this->mysloginattempt,$Month"/"$_SERVER['HTTP_HOST']);
        
ob_flush();
    }

    
/**
     * The admLogin method, which evaluates the login attempt from admin control panel.
     * @access public
     * @return Void
     */
    
public function loginAdminCookies($reset FALSE){
        if(!
$reset$this->mysadmloginattempt++;        
        else 
$this->mysadmloginattempt 0;
        
ob_start();
        
$Month 2592000 time();
        
setcookie("mysadmloginattempt"$this->mysadmloginattempt,$Month"/"$_SERVER['HTTP_HOST']);
        
ob_flush();
    }      
}
?>
Edit: Okay, I'm so sorry... I don't know what's wrong with me. The class_cookies file needs to be swapped again. It's correct now.

Last edited by Hwona; 01-28-2016 at 04:52 PM.
Reply With Quote
  #6  
Old 01-28-2016, 07:23 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 112,527
Abronsyth is on a distinguished road
Default

Okay, it seems to be working so far...hopefully the reset tomorrow works as well (since that's where I was running into major issues with Kyttias's game script).

Thank you, Wallie :)

Edit; Just a note, all of my users have had to log out and then log back in to get it to work correctly.
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 01-28-2016 at 07:45 PM.
Reply With Quote
  #7  
Old 01-28-2016, 07:54 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,533
Hwona is on a distinguished road
Default

Quote:
Originally Posted by Abronsyth View Post
Okay, it seems to be working so far...hopefully the reset tomorrow works as well (since that's where I was running into major issues with Kyttias's game script).

Thank you, Wallie :)

Edit; Just a note, all of my users have had to log out and then log back in to get it to work correctly.
I hope it works out for you! :D
Reply With Quote
  #8  
Old 02-16-2016, 12:50 PM
gunpowdercat gunpowdercat is offline
Member
 
Join Date: Feb 2016
Posts: 29
Gender: Female
Credits: 1,813
gunpowdercat is on a distinguished road
Default

Uploaded the files, tried to visit the game, I get this message;
http://prntscr.com/a445x7
Reply With Quote
  #9  
Old 02-16-2016, 06:01 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,540
NobodysHero is on a distinguished road
Default Error Message

Quote:
Originally Posted by gunpowdercat View Post
Uploaded the files, tried to visit the game, I get this message;
http://prntscr.com/a445x7
Looks like the files might not have all uploaded to the right spot. Try reuploading the files. If you didn't before, use Filezilla or something similar to drag and drop the files inside the zip.

Hope this helps.
Reply With Quote
  #10  
Old 02-17-2016, 03:03 PM
gunpowdercat gunpowdercat is offline
Member
 
Join Date: Feb 2016
Posts: 29
Gender: Female
Credits: 1,813
gunpowdercat is on a distinguished road
Default

Quote:
Originally Posted by NobodysHero View Post
Looks like the files might not have all uploaded to the right spot. Try reuploading the files. If you didn't before, use Filezilla or something similar to drag and drop the files inside the zip.

Hope this helps.
For some reason, it duplicated the games folder. deleting one of them helped. Thanks!
Reply With Quote
Reply

Tags
games

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:39 AM.

Currently Active Users: 258 (0 members and 258 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636