Breeding With Other Males [Solved]

Forum
Last Post
Threads / Messages

Milly Money

Pet-Sim.Online
Staff member
Dev Staff
Joined
Jan 27, 2010
Messages
535
Points
18
Mysidian Dollar
28,313
[Solved!]





I need to allow breeding with other members males, I can't work out how to fix this in Validation, any help would be great :)


The females I want to breed only in their own, but the males I'd like to be able to have available from others.
 
Last edited:
I think she means, breeding pets across users? Like your female pets with a friend's male pets? the easiest way is to use trade feature.
 
I do, and thank you HOF :)

If thats the best way to allow it, we'll go with that!
 
Does anyone else know a (hopefully) easy fix to this?

My members (understandably) dont want to hand over one of their pets to someone else, and trust they get it back. They just want to be able to breed with other males.

I have tried to work it out, and nothing works, just that white page we all love comes up.

Really need help on this, people breeding among each other's pets is really a big deal for us.

Tried the Validator and Settings code, a few different ways, removing the 'owner' part in an array, everything I can see to mess with. Still will *show* the other members males, but when we go to breed --- Invalid ID!


Thanks if anyone can work it out :)
 
Last edited:
Is it only failing to get the ID for other member's males, but working fine for the user's own males?
 
Yep!

Its just for other members pets. Breeding in our own is fine. I know how to get the *list* to show the other ones, finally figured that out, but go to breed and nope :(

Just cannot find it.

There's even a ban that happens sometimes.

Other times, depending on what I mess with, it just does the invalid ID.

Tried all that even looks like it might be for it, in breeding, breedingview, and class_breeding.

Somewhere it's saying ok, NOT your pet, so nope!
 
To show other males you just edit line 72 in breeding.php to this:
PHP:
$stmt = $mysidia->db->select("owned_adoptables", array("name", "aid"), "gender = 'm' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'");
(I'd personally like to add a section for whether the pet is up for stud or not that's null for female pets automatically, and yes or no for males...)

Then I went into class_breedingvalidator.php and changed private function checkOwner to this:
PHP:
private function checkOwner(){
	    $mysidia = Registry::get("mysidia");
		if($this->female->getOwner() != $mysidia->user->username){
		    banuser($mysidia->user->username);
			throw new BreedingException("owner");
		}
		return TRUE;
	}

(removed the part where it does this for males, but left where it checks owner of female)

Now I have no idea if this will work or not because I don't have any other accounts on my test site right now, but you can check it if you want?
 
Well gosh darn it I was excited hehe. Still got ol' reliable:

Invalid ID Specified
The selected female or male Pets ID does not seem to exist.


Thanks for trying, it baffles me where this snippet of code lives that still won't let it work!
 
Hmmm I'll try to check out where it's calling the pet's ID and see if there's something up with that!

Okay, another possibility:
Try changing line 29 (or so) in breeding.php to this:
PHP:
$male = new OwnedAdoptable($mysidia->input->post("male"));
 
Last edited:
Tried it and voila, white page hehe. Did not throw an Invalid ID error, just whited out totally :(


Good try though.

It's baffling. I've scoured every where I could find what looked like validating going on and tinkered with it.

Always Invalid ID or a white page. And you know it's gotta be this one thing we can't locate! xD


I had a thought on it: this part -

$mysidia->user->username);

If there was a way to change that to looking for something harmless that allows all the males owned by all to come up, like some way to have it check something *else* right there.

Like say, 'check' to see again if its male, or something like that. Then that would be verified, and it will allow the breeding.

It's this whole thing of wanting to find that username being the one who owns it.
 
Solved through Abronsyth brilliance -- I will let them share the solution if they desire here.


Thank you again!!
 
Missy Master is helping me test a studding mod, once we get it's working it'll be up on my Mods site!
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,267
Messages
33,049
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top