PDA

View Full Version : [Share] L2Auction


Ra1n0
03.07.2007, 08:01
hi pplz..I liked auction in WoW and I have decided to make something similar in Lineage 2

[L2Auction 0.8 beta]
------INSTALL-------
Extract archive to www folder

move items.txt to drive C:

execute (install2005.sql script for 2005 server or install2000.sql for 2000 server) in sql manager

change settings in config.php

use ;)
-----CHANGES-------
[0.8]
+added banned account checking
+added different connection for database's
+fixed more bugs..looks like stable release ;)
+fixed items.txt again :]
[0.7]
+added install script for 2000 sql server
+recreate items.txt with tab delimited
+added char_id banning in auction
+added item back
+added buy/sell/itemback logs

[0.6.1]
+set cant sale pets
+Set, seller can only sell items in main inventory

-----FUNCTIONS-----
for banning char set banned=1 for needed char_id in l2auction..acc

column log_id (if =1 its set sell item,if =2 its buy item,if =3 its item back)
-----CREDITS-------
© Code and idea by Ra1n0 [report bugs and new ideas to [email protected]]
DONT USE IT IF U CANT
thx to hel(L2admin),Doreamon\Phantom2005(Lineage Control Panel), Zahar(L2Z)
i take some code from his project's ;)

----------------------
code need more of optimization and clean...but its beta)in next versions i do this

my 2do for next versions:
--Add administration panel..
--Code optimization and clean..
--New ideas ?

users 2do download,install,test,post comment ;)

sсreenshots:
http://img253.imageshack.us/img253/7269/scr2yb6.th.jpg (http://img253.imageshack.us/my.php?image=scr2yb6.jpg)
http://img266.imageshack.us/img266/8318/scr3wh8.th.jpg (http://img266.imageshack.us/my.php?image=scr3wh8.jpg)
http://img412.imageshack.us/img412/9162/scr4wd0.th.jpg (http://img412.imageshack.us/my.php?image=scr4wd0.jpg)
http://img266.imageshack.us/img266/5205/scr5vz0.th.jpg (http://img266.imageshack.us/my.php?image=scr5vz0.jpg)
http://img165.imageshack.us/img165/2083/scr6rb8.th.jpg (http://img165.imageshack.us/my.php?image=scr6rb8.jpg)
http://img165.imageshack.us/img165/1473/scrbc3.th.jpg (http://img165.imageshack.us/my.php?image=scrbc3.jpg)

pass:_www.postpacific.com_

[ download ] (http://rapidshare.com/files/44848234/l2auction_0.8_.rar.html)

jencxxl
03.07.2007, 11:41
interesting idea, not going to use it but thank you for the share.

Rich
03.07.2007, 11:55
Nice share, I like the idea. Thanks :)

Tilluss
03.07.2007, 11:58
nice, this was something we was going to look in to ourselves, but great work!

Can you show a screen shot of it in action at all?

khelben
03.07.2007, 11:59
I've always wanted to do something like this but never had the time!!

Excellent!

I'll be checking this out later!

HF
03.07.2007, 12:08
:D download free... and antileecher pass

emanuel
03.07.2007, 12:53
screenshots, info, scan ? and i will download :D :D

Guaresnay
03.07.2007, 14:59
c'mon don't be so lazy, it can take you like 5min to dl it and test it by your self.
Thanks for the share!, i could use some of ur ideas in my proyects :P

PyroMaker
03.07.2007, 15:11
I haven't had the time to test it yet, but as soon as I do, I'll check it out. I downloaded it already, and can't wait to test this.

I won't say "good job" yet because I didn't see it, but I'll update this post soon.

Eitherway, thanks for sharing. :)

Yui-Ikari
03.07.2007, 15:40
Thanks for the sharing, i'll check it out tonite. Although, hope my shitty pc doesnt run out of resources xD

m4rk
03.07.2007, 15:52
We began to make something like this a while ago but never got to do it in the end, thanks I'll give it a go :)

Just noticed one thing
You use delitem and then additem no?...
That will mess up the pet items (the new item just won't work and will be deleted on next restart)

Ra1n0
03.07.2007, 15:52
updated first post with screenshot's

m4rk
03.07.2007, 15:59
Sorry for repeating myself (edited my post but ra1n0 replied)

Just noticed one thing
You use delitem and then additem no?...
That will mess up the pet items (the new item just won't work and will be deleted on next restart)

Ra1n0
03.07.2007, 16:11
You use delitem and then additem no?...
That will mess up the pet items (the new item just won't work and will be deleted on next restart)
yes i use del and add item,but i forgot about pets...need set pets id can_sale=0 in l2auction..items

update l2auction..items set can_sale=0 where item_id=4424
update l2auction..items set can_sale=0 where item_id=4423
update l2auction..items set can_sale=0 where item_id=4422
update l2auction..items set can_sale=0 where item_id=3500
update l2auction..items set can_sale=0 where item_id=3501
update l2auction..items set can_sale=0 where item_id=3502
update l2auction..items set can_sale=0 where item_id=2375
update l2auction..items set can_sale=0 where item_id=6648
update l2auction..items set can_sale=0 where item_id=6649
update l2auction..items set can_sale=0 where item_id=6650

Squid
03.07.2007, 16:21
I have this errors:


Notice: Undefined offset: 10 in z:\home\localhost\www\l2auction\func.php on line 172

Notice: Undefined offset: 11 in z:\home\localhost\www\l2auction\func.php on line 172

Notice: Undefined offset: 12 in z:\home\localhost\www\l2auction\func.php on line 172

Notice: Undefined offset: 13 in z:\home\localhost\www\l2auction\func.php on line 176

Notice: Undefined offset: 14 in z:\home\localhost\www\l2auction\func.php on line 176

Notice: Undefined offset: 15 in z:\home\localhost\www\l2auction\func.php on line 176

Notice: Undefined offset: 16 in z:\home\localhost\www\l2auction\func.php on line 176

Notice: Undefined offset: 10 in z:\home\localhost\www\l2auction\func.php on line 205

Notice: Undefined offset: 11 in z:\home\localhost\www\l2auction\func.php on line 205

Notice: Undefined offset: 12 in z:\home\localhost\www\l2auction\func.php on line 205

Notice: Undefined offset: 13 in z:\home\localhost\www\l2auction\func.php on line 205

Notice: Undefined offset: 14 in z:\home\localhost\www\l2auction\func.php on line 205

Notice: Undefined offset: 15 in z:\home\localhost\www\l2auction\func.php on line 205

Notice: Undefined offset: 16 in z:\home\localhost\www\l2auction\func.php on line 205

Ra1n0
03.07.2007, 16:26
php version ?
and its just notice

remove comment on error_reporting(0); from index.php



function encrypt($str) {
.......
line 205
$dst[$i] = $dst[$i] ^ $dst[$i-1] ^ $key[$i];

Ra1n0
03.07.2007, 17:41
first post updated, new ver 0.x.x

DHX
03.07.2007, 18:50
I've always wanted to make an auction house for L2. I never liked the idea of having to keep your L2 client logged on overnight so I'll check this out.

Drag
03.07.2007, 21:59
Lawl cool xD Thanks

Silentz0r
03.07.2007, 22:00
Just tested, had a error in the sql query not to worry, but everything works like a charm. very good work. i just have one question.

I actually keep tracks of the items with item's unique id, there is a way to use another function to keep the same ID of the weapon to sell?

_Untitled
03.07.2007, 22:17
Just tested, had a error in the sql query not to worry, but everything works like a charm. very good work. i just have one question.

I actually keep tracks of the items with item's unique id, there is a way to use another function to keep the same ID of the weapon to sell?

Thers no way to keep same uID .

Ra1n0
03.07.2007, 22:32
had a error in the sql query
please post this query
I actually keep tracks of the items with item's unique id, there is a way to use another function to keep the same ID of the weapon to sell?
Another function ?

Silentz0r
03.07.2007, 23:13
please post this query

Another function ?


don't worry about the query was a little problem with my mssql.

i meant another function to use it in your l2auction, like

#30 MoveItemPacket("ddddd")
#40 MoveItem2Packet("ddddS")

not sure if that functions even work,i just checked this post:
https://postpacific.loc-online.com/forums/showpost.php?p=64631&postcount=6

i just wanted to keep the uniques ID's, that's all if isnt possible well what the heck! xD. but overall this share rocks 10/10.

FidoW
03.07.2007, 23:35
don't worry about the query was a little problem with my mssql.

i meant another function to use it in your l2auction, like

#30 MoveItemPacket("ddddd")
#40 MoveItem2Packet("ddddS")

not sure if that functions even work,i just checked this post:
https://postpacific.loc-online.com/forums/showpost.php?p=64631&postcount=6

i just wanted to keep the uniques ID's, that's all if isnt possible well what the heck! xD. but overall this share rocks 10/10.
Im not sure, i dont enough time to check this auction system right now but at first see and thinking about how to do... MoveItemPacket cant be used, the item need to be deleted in the same moment you add it to the auction... its a really good idea :wink: (im smashing my head into the wall because i dont have that idea by my own before :banghead: ), right now in out of my country on vacations, but the same day i return i will check it, looks very good.

Ra1n0
03.07.2007, 23:47
i meant another function to use it in your l2auction, like

#30 MoveItemPacket("ddddd")
#40 MoveItem2Packet("ddddS")
no way...i all day think of how to create auction system..
moveitem cant be used

if u need keep uid for viewing game logs..i create auction logs..like who sell,who buy,date-time,uid,etc

l2serverfull
03.07.2007, 23:59
no work in mssql 2000 ?

Ra1n0
04.07.2007, 00:12
work..but need to create install.sql for 2000 server..

http://rapidshare.com/files/40880639/install2000.sql.html

Silentz0r
04.07.2007, 04:39
no way...i all day think of how to create auction system..
moveitem cant be used

if u need keep uid for viewing game logs..i create auction logs..like who sell,who buy,date-time,uid,etc

Perfect idea, i was thinking in that too. if you can do it would be awsome. Thank you for the share.

Zil
04.07.2007, 12:13
Hmm, maybe need function to stop selling item? Cause if u set item on auction then u can't back this item in inventory if them not selled :)

sorry for bad english :p

khelben
04.07.2007, 14:21
One thing i noticed is in Item.txt, the comma delimiter causes problems.

Some items have a comma in their name, causing the bulk insert to proceed to the next field

Book: Basics of Giants Magic, Chapter 5

error: Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 5927, column 5 (can_sale).

I'm changing my item.txt to be tab delimited. (Works better for excel exporting anyway if i add my own items)

So far other than that small issue seems to be working great.

Logs would be a welcome addition, as well as the ability to cancel a sale, or for a sale to 'time out' after x days

Ra1n0
04.07.2007, 14:24
Cause if u set item on auction then u can't back this item in inventory if them not selled
added in 2do
I'm changing my item.txt to be tab delimited.
recreate this file in next version

khelben
04.07.2007, 16:24
Here, hope this saves some time.

Tab Delimited SQL 2005 Installer and Tab delimited items.txt

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
l2auction_sql_items_tab_delimited.rar — 51905 байт

Ra1n0
04.07.2007, 18:42
good,thx....

Ra1n0
04.07.2007, 23:39
first post updated..new ver x.x

Zil
05.07.2007, 05:42
Very good stuff, I like it :)
Hmm, new Idea :
Maybe drop items by groups? as weapons, armors, etcitems and etc?:)

jekin
05.07.2007, 08:41
Very nice tool, thanks.
Yet another idea:
Currently, you can deny certain char_id's from participating in auction. I suppose, it could be a good idea to allow only certain char_id's to participate.

olmer2002
05.07.2007, 09:16
Whether it is vulnerable for sql injection? =) I think yes, there are no filters on inquiries

Ra1n0
05.07.2007, 09:23
there are no filters on inquiries
download and see code

/rus/ Вот нахера что то говорить когда ты даже не потрудился скачать и посмотреть? /rus/

Ra1n0
05.07.2007, 09:24
Maybe drop items by groups? as weapons, armors, etcitems and etc?
maybe in next version

Ra1n0
05.07.2007, 09:52
Можно сделать так, что бы при добавлении вещи на продажу, отсылался аннонс типа: На аукцион добавлено то то за столько то.

i dont think is that good idea..if auction use 1k users...1 sec=1 announce ?))

olmer2002
05.07.2007, 10:43
ok. im understand u, good luck, see u later =)

DukeGr
05.07.2007, 11:19
someone should warn people not to use this on live servers,no protection whatsoever.

Ra1n0
05.07.2007, 11:29
no protection whatsoever
no protection ? wtf u download and check code?

smeli
05.07.2007, 13:21
>no protection ? wtf u download and check code?

calm down, look at this men's avatar - he just smoked too much marihuana

supersword
05.07.2007, 15:50
I don't have use for this, but it is a great bit of work.

I'm being nosey and having a read through the code now however. Well done mate.

didu
06.07.2007, 20:31
Hi

I have a problem with the code, i don't see the picture:

http://www.ultimegames.com/l2auction/

Ra1n0
06.07.2007, 20:37
enable gd in php.ini

;extension=php_gd2.dll

remove comment

extension=php_gd2.dll

didu
06.07.2007, 21:41
thx that work :)

Ra1n0
07.07.2007, 06:52
post here in english plz..
/rus/
Надо сделать список вещей, запрещенных для продажи. А то так сосками и другим расходным мериалом халява. Кончились соски, вышел из игры, зашел на аукцион купил, зашел в игру и дальше мобов бить.
column can_sale in l2auction..items, if =0 then cant sale, if =1 then can sale

Ra1n0
07.07.2007, 07:51
nothing to worry,allright

auction connect to cached ( admin server create socket )
auction check character (offline or online) (check character:char_id)
auction packet manupulation :D
auction disconnect from cached (admin server closed)

Ra1n0
07.07.2007, 09:29
/rus/
все проверил персонаж и аккаунт в оффлайне,но заметил баг связанный с этим.когда я пробую купить соул шоты у того кто продает,выдает ту ошибку, но после того как я захожу на аакаунт и на чара продовца на нем также остаетсья 1500 соул шотов но деньги переводяться.ТОесть получаетсья остаеться и товар и и деньги за него прходят.Если знаете в чем проблема помогите.i tested auction work perfect..
see pm..

Silentz0r
07.07.2007, 10:03
New Idea:

would be good if you add a check ban, if ppl are banned trought l2db like "This account is banned from the Server" or something like that.

DB: lin2db, user_account pay_stat

1= can login
0= can't login

Ra1n0
07.07.2007, 10:11
New Idea:

would be good if you add a check ban, if ppl are banned trought l2db like "This account is banned from the Server" or something like that.
added in 2do

Lucifer
07.07.2007, 10:35
/rus/
Надо сделать список вещей, запрещенных для продажи. А то так сосками и другим расходным мериалом халява. Кончились соски, вышел из игры, зашел на аукцион купил, зашел в игру и дальше мобов бить.
/rus/
А не проще после удачной покупки слать пакет sendhome?
New Idea:

would be good if you add a check ban, if ppl are banned trought l2db like "This account is banned from the Server" or something like that.

DB: lin2db, user_account pay_stat

1= can login
0= can't login
lin2db.dbo.block_flag & lin2db.dbo.block_flag2 - if any of them = 1 can't login ;)

Lirix
07.07.2007, 10:48
I suggest to move all string in a separate file and add skins funtion

Lirix
07.07.2007, 10:50
/rus/
А не проще после удачной покупки слать пакет sendhome?


hmm. good idea. but need to make this function on an option.

m4rk
07.07.2007, 11:01
lin2db.dbo.block_flag & lin2db.dbo.block_flag2 - if any of them = 1 can't login
lin2db.dbo.block_flag & lin2db.dbo.block_flag2 - if any of them >= 1 can't login

In fact, depending on wich flag it is set (2,4,6...) it shows different message when you try to login ingame.

Ra1n0
07.07.2007, 11:38
/rus/
А не проще после удачной покупки слать пакет sendhome?
for what ?
I suggest to move all string in a separate file and add skins funtion
in 2do

Lucifer
07.07.2007, 12:02
/rus/
Надо сделать список вещей, запрещенных для продажи. А то так сосками и другим расходным мериалом халява. Кончились соски, вышел из игры, зашел на аукцион купил, зашел в игру и дальше мобов бить.
Ra1n0
for fix this problem, but not forbidding them to sell...

Lirix
07.07.2007, 20:45
for what ?

for option. :)

katso
11.07.2007, 03:51
I have a problem, attempt to enter with my account and the name of my char, entrance the security code, and when I do click in login, reset all the fields and the security code changes. That I am making bad?

Silentz0r
11.07.2007, 04:05
I have a problem, attempt to enter with my account and the name of my char, entrance the security code, and when I do click in login, reset all the fields and the security code changes. That I am making bad?

I noticed a problem with capital letters password won't get log. Raino, u should check that.

Ra1n0
11.07.2007, 07:27
/rus/
нашёл баг. выставляю на продажу short sword, он выставляется, но при этом остаётся в инвентаре. дюп? меч в руках у персонажа.
зы. не удалялся даже через админку. а в игре удалился спокойно.
кстати полностью перевёл на русский. кому надо - могу выложить.
/rus/
/eng/
small bug
/eng/
maybe problem in CacheD ?cached returns "1" mean all is good..if cached returns not "1" auction dont set item on sell.

Ra1n0
11.07.2007, 08:09
and question..

Who know what means columns in user_item.(eroded,bless,ident,wished) maybe problem here?

khelben
11.07.2007, 09:24
Additional Request:
Support Different Connection Addresses/DNS Names for all databases.

i.e. Auth(lin2db) = 10.0.0.1, World(lin2world) = 10.0.0.2, Auction(l2auction) = 10.0.x.x

katso
11.07.2007, 17:26
I noticed a problem with capital letters password won't get log. Raino, u should check that.

Yes, my password contains capital letters. It is a problem that cannot be entered with password of this type.

Ra1n0
11.07.2007, 18:11
some mistake for me..

find in func.php

function safe($str) {
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', strtolower ( $str ) );
} else {
$str = '';
}
return trim($str);
}
replace to

function safe($str) {
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', $str );
} else {
$str = '';
}
return trim($str);
}

katso
13.07.2007, 16:36
I have the following problem, I install l2auction in my web server and I form so that it is connected to the IP of of the server of l2, enter the page, complete all the fields, and do click in login, and nothing happens, disappear the data that enters the fields of the page and the security code changes, without no message of error. Try with the modification for the capital letters and nothing happens, the problem persists, somebody can help me.
Greetings.


Tengo el siguiente problema, instalo l2auction en mi web server y configuro para que se conecte al ip de del server de l2, ingreso a la pagina, completo todos los campos, y hago click en login, y no sucede nada, desaparecen los datos que ingrese en los campos de la pagina y se cambia el codigo de seguridad, sin ningun mensaje de error. Intente con la modificacion para las letras mayusculas y nada sucede, el problema persiste, alguien me puede dar una ayuda?.
Saludos.

Bash
15.07.2007, 14:05
some mistake for me..

find in func.php

function safe($str) {
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', strtolower ( $str ) );
} else {
$str = '';
}
return trim($str);
}
replace to

function safe($str) {
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
$str = str_replace ( $banwords, '', $str );
} else {
$str = '';
}
return trim($str);
}

I think so it will be more effective

function safe($str)
{
$banwords = array ("'", ",", ";", "--","drop", "select", "update", "create", "delete", "insert");
if (!eregi("^[A-Z0-9._%@*-]+",$str))
$str = NULL;
else
{
$str2 = str_replace($banwords, '', strtolower($str));
if(strtolower($str2) != strtolower($str)) $str = NULL;
}
return $str;
}

paul
15.07.2007, 22:41
Okay this is probably something retarded i'm missing buuut

I get a cached: 997 error everytime someone tries to place an auction (or even when its trying to check to see if they are logged in but i removed that check hehe) Any ideas on what could be causing it?

Kenjiro
16.07.2007, 10:02
It's normal, every connection to cached admin port, make some and then disconnect results in 997 (sometimes other) error.
I suppose there is some function to disconnect, or some another way to 'nicely' close connection.

In other words, do not worry :).

paul
16.07.2007, 10:30
Uh considering this script doesn't work because of the 997 errors, i don't worry but its kinda a stopper :p

radio
16.07.2007, 11:43
Additional Request:
Support Different Connection Addresses/DNS Names for all databases.
i.e. Auth(lin2db) = 10.0.0.1, World(lin2world) = 10.0.0.2, Auction(l2auction) = 10.0.0.3

YES !!!....

goodtimeshaxor
17.07.2007, 03:12
When I saw this I was really excited because I was working on something like this but gave up but I'm wondering if it works and if it does what problems it has if any.

Thanks

katso
17.07.2007, 03:15
Whenever somebody puts an item on sale, it indicates me that the transaction was successful, but when seeing that items I have for sale, does not appear nothing and the items disappear of the inventory, as it can be the error?


Cada vez que alguien pone a la venta un item, me indica que la transaccion fue exitosa, pero al ver que items tengo en venta, no aparece nada y los items desparecen del inventario, cual puede ser el error?

Silentz0r
17.07.2007, 03:52
guys.. i think your doing something wrong :/ i got this working 100% functional in less than 5min and aswell i get the 997 error, but it works anyways.

paul
17.07.2007, 06:23
I finally dug into it a bit more. It's taking the item from the inventory of the person however it's not putting it into the l2auction db

goodtimeshaxor
17.07.2007, 06:41
I'm getting a similar error except it doesn't do anything at all.

It doesn't take the item from the inventory.

Whenever a user sets up an auction it says it was successful and it also appears in the buy list but it doesn't disapear from the online inventory or the character's in-game inventory.

EDIT:
Does this only work after restart? I'm assuming that it works right away cause you have to be logged out.

goodtimeshaxor
17.07.2007, 14:47
Polite Bump:

Also, I noticed that if I use this auction system on the server machines www all the images are displayed correctly and it seems like it works (all except for the actual ingame exchange, that doesn't work still) but when I use the exact same files on a remote web server the images don't show and I get an error that says I must be logged out of my character to buy/sell items. (Which I am)

(Update: I got the images to display correct. I had the folder named /auction/ instead of /l2auction/. A simple edit of the files fixed the problem)





Warning: fwrite(): supplied argument is not a valid stream resource in C:\www\auction\func.php on line 275

Warning: fread(): supplied argument is not a valid stream resource in C:\www\auction\func.php on line 276

Warning: unpack() [function.unpack]: Type v: not enough input, need 2, have 0 in C:\www\auction\func.php on line 276

Warning: fread(): supplied argument is not a valid stream resource in C:\www\auction\func.php on line 276

Warning: unpack() [function.unpack]: Type c: not enough input, need 1, have 0 in C:\www\auction\func.php on line 276

Warning: fclose(): supplied argument is not a valid stream resource in C:\www\auction\func.php on line 278
Info

Okay the above error was caused by my firewall. Port 2012 (CacheD) wasn't allowing connections from the web server. I opened this port to the web server's IP and now these errors do not show; however, I am still not able to transfer the items in game.
Any ideas?

(Update 2:)

I get the following error in CacheD.exe when trying to use the L2Auction system:

admin server closed(XX.XX.XXX.XXX) error: 258

goodtimeshaxor
19.07.2007, 01:48
I'm still not able to get the auction to work. Specifically, the items that are put up for auction are not taken out of the player's inventory (on auction page and in game). When someone buys the item in auction page the item is NOT transfered in game.

Details: The auction system is on my web server, separate from the game server.
The database is named "l2auction".
The URL is /auction instead of /l2auction
Image sources for items are changed to /auction/img.
CacheD port allows the IP of web server to connect.
Getting an error: admin server closed(XX.XX.XXX.XXX) error: 258

stpavel
19.07.2007, 13:28
Some bugs.

1. If item's name have apostrof ( for example Recipe: Zubei's Boots ) , when char try to sale it, item take from inventory but not show in item on sell list, because here sql query error...
For fix this I changed function get_item_name


function get_item_name($id) {
$q=mssql_query("SELECT name from l2auction..items where item_id='".safe_int($id)."'");
$data=mssql_fetch_array($q);
$item_name = str_replace ("'" , "''", $data['name']);
return $item_name;
}


2. If count of item , that char try to sell is float have , - count mul to 10 , for example if I type
2,5 and then click sell button , I see 25. If count of item have . ( for example 2.5 ) , item take from inventory but not show in item to sell list, here sql error....
I fix this so:

function safe_int($str) {
$str = str_replace ( ",", '.', $str );
$banwords = array ("'", ",", ";", "-");
if ( eregi ( "[0-9]+", $str ) ) { $str = str_replace ( $banwords, '', strtolower ( $str ) );
} else {
$str = NULL;
}
return trim(ceil($str));
}


3. When char sell item, here write a log, item_id, count of item that sell char e.t.c.,,
Small bug, in log write not count of item, that sell char, but count of item that he has in inventory..
Fix :

$sale_count=safe_int($_POST['count']);
#makelog(1,get_char_id($_SESSION['char']),get_char_id($_SESSION['char']),$data_sale['item_type'],$data_sale['amount'],$data_sale['enchant'],$data_sale['item_id']);
makelog(1,get_char_id($_SESSION['char']),get_char_id($_SESSION['char']),$data_sale['item_type'],$sale_count,$data_sale['enchant'],$data_sale['item_id']);


4. If account is banned , he anywhere can login in auction
Fix : func.php , function is_logged :


function is_logged($name,$pass,$char){
...
...
sqlconnect("auth");
$result1 = mssql_query("SELECT block_flag FROM user_account WHERE account = '".safe($name)."' and block_flag=1");
$rows1=mssql_num_rows($result1);
if ($rows1>0){
unset($_SESSION['user']);
unset($_SESSION['pass']);
unset($_SESSION['char']);
session_destroy();
echo '
<script language="JavaScript">
alert("Sorry, your account is banned.");
</script>
';
refresh('index.php');
}
...
...
...



5. Not correct some records of items in item.txt.

5927 Book: Basics of Giants Magic Chapter 1 etc_paper_blue_i00,1 1
5928 Book: Basics of Giants Magic Chapter 2 etc_paper_blue_i00,1 1
5929 Book: Basics of Giants Magic Chapter 3 etc_paper_blue_i00,1 1
5930 Book: Basics of Giants Magic Chapter 4 etc_paper_blue_i00,1 1
5931 Book: Basics of Giants Magic Chapter 5 etc_paper_blue_i00,1 1
5932 Handbook: Giants Architecture Chapter 1 etc_paper_red_i00,1 1
5933 Handbook: Giants Architecture Chapter 2 etc_paper_red_i00,1 1
5934 Handbook: Giants Architecture Chapter 3 etc_paper_red_i00,1 1
5935 Handbook: Giants Architecture Chapter 4 etc_paper_red_i00,1 1
5936 Handbook: Giants Architecture Chapter 5 etc_paper_red_i00,1 1
5937 Book: Giants Medical Science Chapter 1 etc_paper_white_i00,1 1
5938 Book: Giants Medical Science Chapter 2 etc_paper_white_i00,1 1
5939 Book: Giants Medical Science Chapter 3 etc_paper_white_i00,1 1
5940 Book: Giants Medical Science Chapter 4 etc_paper_white_i00,1 1
5941 Book: Giants Medical Science Chapter 5 etc_paper_white_i00,1 1
...
5945 Book: Giants Science & Technology Chapter 1 etc_spell_books_white_i00,1 1
5946 Book: Giants Science & Technology Chapter 2 etc_spell_books_white_i00,1 1
5947 Book: Giants Science & Technology Chapter 3 etc_spell_books_white_i00,1 1
5948 Book: Giants Science & Technology Chapter 4 etc_spell_books_white_i00,1 1
5949 Book: Giants Science & Technology Chapter 5 etc_spell_books_white_i00,1 1
5950 Almanac: Titan Culture Chapter 1 etc_spell_books_summon_i00,1 1
5951 Almanac: Titan Culture Chapter 2 etc_spell_books_summon_i00,1 1
5952 Almanac: Titan Culture Chapter 3 etc_spell_books_summon_i00,1 1
5953 Almanac: Titan Culture Chapter 4 etc_spell_books_summon_i00,1 1
5954 Almanac: Titan Culture Chapter 5 etc_spell_books_summon_i00,1 1
...
5979 Ancient Epic Chapter 1 etc_piece_of_paper_gray_i00,1 1
5980 Ancient Epic Chapter 2 etc_piece_of_paper_gray_i00,1 1
5981 Ancient Epic Chapter 3 etc_piece_of_paper_gray_i00,1 1
5982 Ancient Epic Chapter 4 etc_piece_of_paper_gray_i00,1 1
5983 Ancient Epic Chapter 5 etc_piece_of_paper_gray_i00,1 1
...
5989 Blueprint: Tower of Insolence 1st Floor etc_letter_blue_i00,1 1
5990 Blueprint: Tower of Insolence 2nd Floor etc_letter_blue_i00,1 1
5991 Blueprint: Tower of Insolence 3rd Floor etc_letter_blue_i00,1 1
5992 Blueprint: Tower of Insolence 4th Floor etc_letter_blue_i00,1 1
5993 Blueprint: Tower of Insolence 5th Floor etc_letter_blue_i00,1 1
5994 Blueprint: Tower of Insolence 6th Floor etc_letter_blue_i00,1 1
5995 Blueprint: Tower of Insolence 7th Floor etc_letter_blue_i00,1 1
5996 Blueprint: Tower of Insolence 8th Floor etc_letter_blue_i00,1 1
5997 Blueprint: Tower of Insolence 9th Floor etc_letter_blue_i00,1 1
5998 Blueprint: Tower of Insolence 10th Floor etc_letter_blue_i00,1 1
5999 Blueprint: Tower of Insolence 11th Floor etc_letter_blue_i00,1 1
6000 Blueprint: Tower of Insolence 12th Floor etc_letter_blue_i00,1 1
6001 Blueprint: Tower of Insolence 13th Floor etc_letter_blue_i00,1 1
...


fix : delete third column, move image's name from fourth column to third or manually edit table items
p.s. sorry for bad english

Ra1n0
24.07.2007, 10:15
thx to all for finding bugs ^^
but i'am on vacation right now i will fix this coming soon...

Ra1n0
24.07.2007, 23:57
first post updated...new ver. 0.8

looks like stable release..

ok,i am still on vacation..but mail me if u find critical bug..

Elven
05.08.2007, 02:16
I have added new function - history of sales and purchases. Thus has collided with that that in a field ‘count’ in table ‘logs’ save the rest, instead of quantity of the sold things. If you wish to write down the quantity of the sold things replace
It
makelog(2,get_char_id($_SESSION['char']),$data_sale['char_id'],$data_sale['item_id'], $data_sale['count'],$data_sale['enchant'],$data_sale['db_id']);

on
makelog(2,get_char_id($_SESSION['char']),$data_sale['char_id'],$data_sale['item_id'],safe_int($_POST['count']),$data_sale['enchant'],$data_sale['db_id']);


//rus
Я добавил новую функцию - историю продаж и покупок, доступную для просмотра пользовтелям. При этом столкнулся с тем, что в поле 'count' в таблице 'logs' записывается остаток, а не количество проданных вещей.
Если вы хотите записать не остаток, а количество проданных вещей, то замените

Это
makelog(2,get_char_id($_SESSION['char']),$data_sale['char_id'],$data_sale['item_id'], $data_sale['count'],$data_sale['enchant'],$data_sale['db_id']);
на
makelog(2,get_char_id($_SESSION['char']),$data_sale['char_id'],$data_sale['item_id'],safe_int($_POST['count']),$data_sale['enchant'],$data_sale['db_id']);

yobzhik
06.08.2007, 12:00
Thanks, its amazing share ! But having problem... When i try login, it show message "Sorry, your account is banned..."... Where is problem ?
Вкусна, пасиба. Одна проблема - кем не захожу, пишет Sorry, your account is banned... В чем я протупил ?

goodtimeshaxor
06.08.2007, 12:04
Blah. I'm still having problems with this.

Ryatzu
06.08.2007, 14:39
elven could you upload your edited version please.

Thank you