Jump to content
MakeWebGames

Recommended Posts

Posted

Hi, I did this a little earlier, I've not tested fully so please let me know of bugs ect.

Screenies:

http://yfrog.com/i3auctionnonep

http://yfrog.com/7hauctionaddp

http://yfrog.com/7hauctionaddp

http://yfrog.com/5nauctionp

http://yfrog.com/5ibidp

Features:

  • Buy It Now function
  • Time Selection
  • Bid
  • Ran of timestamps

SQL:

[mysql]CREATE TABLE IF NOT EXISTS `gAuction` (

`ID` int(11) NOT NULL auto_increment,

`SellerID` int(11) NOT NULL,

`ItemID` int(11) NOT NULL,

`CurrentBid` int(11) NOT NULL,

`BuyNow` int(11) NOT NULL,

`Time` varchar(30) NOT NULL,

`TimeLeft` varchar(100) NOT NULL,

PRIMARY KEY (`ID`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;[/mysql]

[mysql]CREATE TABLE IF NOT EXISTS `gAuctionBids` (

`ID` int(11) NOT NULL auto_increment,

`aID` int(11) NOT NULL,

`BidderID` int(11) NOT NULL,

`CurrentBid2` int(11) NOT NULL,

PRIMARY KEY (`ID`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;[/mysql]

Auction.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Open Header.php & find the $bgcolor variable & add underneath.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Open inventory.php & find [Sell]

Add next to it:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Open global_func.php & add.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And that's it, let me know of any bugs I did this quickly so have no idea if there are any.

  • Replies 104
  • Created
  • Last Reply

Top Posters In This Topic

Posted
Looks great, I needed this. How secure are they?

What do you mean? - The file as a whole? - Or just auctions & the effect they would have on your game?

The file as a whole is secure yes & no bugs have been reported as of yet.

Posted
Wow, I can finally use this script without having to recode it. Thank's zed =]

Lol, no problem.

 

Tested and works well nice one mate :thumbsup:

Sweet!, thanks for letting me know. :)

Posted

I

I had no idea "item_add" existed so, thanks.

Was it the queries giving the problem?

 

I suggest using it, Zed....

It automatically merges the items, I think 8|

Looking good though :) :thumbsup:

Posted
I
I had no idea "item_add" existed so, thanks.

Was it the queries giving the problem?

 

I suggest using it, Zed....

It automatically merges the items, I think 8|

Looking good though :) :thumbsup:

Nope, MCCode standard one doesn't merge, I don't think so anyway, I've edited mine
Posted
I
I had no idea "item_add" existed so, thanks.

Was it the queries giving the problem?

 

I suggest using it, Zed....

It automatically merges the items, I think 8|

Looking good though :) :thumbsup:

Nope, MCCode standard one doesn't merge, I don't think so anyway, I've edited mine

 

Well I havnt changed mine and it merges the items 8|

Posted

I'm suprised that nobody has mentioned this yet...

This modification looks horribly inefficent with every user pulling the information for every auction every page refresh...

8| :wacko:

Posted

No I wouldn't say so myself, with every user only aloud 1 auction at any time, even with 10k auctions, that means there's 10k players minimum, so "$ir" and any other of the predefined variables are pulling *alot* more data from the database than the auction query would ever have.

Of course it could be done with the use of a cron, But from the usability of this particular modification a time-stamp is best. (And it would have to go in a 1 min cron anyway)

Posted

$ir isn’t that bad if properly indexed.

With this modification, even with 100 current auctions, you will get.

1 Select query that pulls 100 rows of data, and then 100 Select queries after that (in the while loop).

If you are using the players to replace the use of a cron, you could at least Join the data from both tables into 1 Select statement, use a timestamp condition to limit the query to only needed rows, and index all fields that are used in the join and where statements.

Posted
$ir isn’t that bad if properly indexed.

With this modification, even with 100 current auctions, you will get.

1 Select query that pulls 100 rows of data, and then 100 Select queries after that (in the while loop).

If you are using the players to replace the use of a cron, you could at least Join the data from both tables into 1 Select statement, use a timestamp condition to limit the query to only needed rows, and index all fields that are used in the join and where statements.

 

I think the global $ir shouldn't even exist, even if McCodes had correct indexation - it's still slower than it could've been done (even if it's only a few milliseconds)

And just so you know, Zed - you could've mixed <span> with :)

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

To

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Nothing special.

I think this is a great modification and Zed has done well, I think the way it's coded is perfectly fine for a small and large McCodes game :P

Posted
I think the global $ir shouldn't even exist, even if McCodes had correct indexation - it's still slower than it could've been done (even if it's only a few milliseconds)

Nothing special.

I think this is a great modification and Zed has done well, I think the way it's coded is perfectly fine for a small and large McCodes game :P

I didnt say that it was the best, i said it wasnt that bad. My $ir query has 9 joins and only takes 0.001 second.

What i was saying is, if you have 100 auctions, you are going to be making a ton of queries to the datebase, everytime every users goes to a new page. I pitty your mysql servers.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...