balliztik1 Posted June 19, 2009 Author Share Posted June 19, 2009 For 2.8, the banking system has undergone a rather large change. For those that want to fix these errors in their own sources, I am compiling all the known bugs here. Some of these bugs have been around for a while, so even if you are using an older source, such as TE, it might be good to add this.Known Bugs as of 6/19/2009:* Bank Buttons too Small* Items not deposited from a specific slot* Equipped Item checks not working* A few other, secret errors (Marsh has advised me not to release the specifics, as players could exploit the bugs in games without this fix)**Bank Button Fix**For some reason, the bank buttons that came with 2.7 are impossibly small. AkselJ has a tutorial with pictures, here: [[EE 2.7] How to fix bank and trade](http://www.touchofdeathforums.com/smf/index.php/topic,44128.0.html)Basically, in the frmBank object view, drag and resize the deposit and withdraw buttons to a bigger size.**Deposit Fixes** The remaining fixes all have to do with depositing items. It's a pretty simple fix. Just replace your Packet_BankDeposit with this:```Public Sub Packet_BankDeposit(ByVal index As Long, ByVal InvNum As Long, ByVal Amount As Long) Dim BankSlot As Long Dim ItemNum As Long ItemNum = GetPlayerInvItemNum(index, InvNum) BankSlot = FindOpenBankSlot(index, ItemNum) If BankSlot = 0 Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "Bank full!" & END_CHAR) Exit Sub End If If Amount > GetPlayerInvItemValue(index, InvNum) Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "You can't deposit more than you have!" & END_CHAR) Exit Sub End If 'Fix posted back in 2.5\. Never added. If GetPlayerWeaponSlot(index) = InvNum Or GetPlayerArmorSlot(index) = InvNum Or GetPlayerShieldSlot(index) = InvNum Or GetPlayerHelmetSlot(index) = InvNum Or GetPlayerLegsSlot(index) = InvNum Or GetPlayerRingSlot(index) = InvNum Or GetPlayerNecklaceSlot(index) = InvNum Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "You can't deposit worn equipment!" & END_CHAR) Exit Sub End If If Item(ItemNum).Type = ITEM_TYPE_CURRENCY Or Item(ItemNum).Stackable = 1 Then If Amount < 1 Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "You must deposit more than 0!" & END_CHAR) Exit Sub End If End If 'Shouldn't have to revert to this, but leaving it just in case 'Call TakeItem(index, ItemNum, Amount) If GetPlayerInvItemValue(index, InvNum) > Amount Then Call SetPlayerInvItemValue(index, InvNum, GetPlayerInvItemValue(index, InvNum) - Amount) ElseIf GetPlayerInvItemValue(index, InvNum) = Amount Then Call SetPlayerInvItemNum(index, InvNum, 0) Call SetPlayerInvItemValue(index, InvNum, 0) Call SetPlayerInvItemDur(index, InvNum, 0) End If Call SendInventoryUpdate(index, InvNum) Call GiveBankItem(index, ItemNum, Amount, BankSlot) Call SendBank(index)End Sub```The main problem with the bank system was that you select an item from your inventory list, but that item slot isn't really used. Instead, the item slot is converted to the item number, which is fed to the TakeItem sub. This results in the wrong item being taken if a player has more than one of that item. I simply changed the TakeItem call to one that checks only the given slot.A second problem is that the item's number was being checked against the item's slot. For the same reason that the TakeItem sub gave us problems, this doesn't work. They are two different values. I PMed a fix to the developers back in 2.5, but for some reason, it never found its way in. This prevents worn items from being unequipped and deposited.The errors that I'm not at liberty to discuss are also fixed here. I won't be sharing the details, but this fix provides a safeguard against them. If you need more details, or your bank system is different and you still want this fix, PM me, and I'll see what I can do. Link to comment Share on other sites More sharing options...
dao Posted June 20, 2009 Share Posted June 20, 2009 nice fix dude thanks Link to comment Share on other sites More sharing options...
Kimimaru Posted June 24, 2009 Share Posted June 24, 2009 Thanks! This helped a lot! I've modified your code slightly to make it so that the messages pop up rather than show on the bank screen. For me, and I'm sure many others, this is more convenient. Also, it will probably be more helpful to those who didn't modify the box that displays the message in frmBank.frm. Well, here it is:Replace your **Packet_BankDeposit** in _modHandleData_ on the Server side with this:```Public Sub Packet_BankDeposit(ByVal index As Long, ByVal InvNum As Long, ByVal Amount As Long) Dim BankSlot As Long Dim ItemNum As Long ItemNum = GetPlayerInvItemNum(index, InvNum) BankSlot = FindOpenBankSlot(index, ItemNum) If BankSlot = 0 Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "Your bank is full! Please remove an item if you wish to deposit any more." & END_CHAR) Exit Sub End If If Amount > GetPlayerInvItemValue(index, InvNum) Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "You can't deposit more than what you have!" & END_CHAR) Exit Sub End If 'Fix posted back in 2.5\. Never added. If GetPlayerWeaponSlot(index) = InvNum Or GetPlayerArmorSlot(index) = InvNum Or GetPlayerShieldSlot(index) = InvNum Or GetPlayerHelmetSlot(index) = InvNum Or GetPlayerLegsSlot(index) = InvNum Or GetPlayerRingSlot(index) = InvNum Or GetPlayerNecklaceSlot(index) = InvNum Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "You can't deposit equipped items!" & END_CHAR) Exit Sub End If If Item(ItemNum).Type = ITEM_TYPE_CURRENCY Or Item(ItemNum).Stackable = 1 Then If Amount < 1 Then Call SendDataTo(index, "bankmsg" & SEP_CHAR & "You must deposit more than 0!" & END_CHAR) Exit Sub End If End If 'Shouldn't have to revert to this, but leaving it just in case 'Call TakeItem(index, ItemNum, Amount) If GetPlayerInvItemValue(index, InvNum) > Amount Then Call SetPlayerInvItemValue(index, InvNum, GetPlayerInvItemValue(index, InvNum) - Amount) ElseIf GetPlayerInvItemValue(index, InvNum) = Amount Then Call SetPlayerInvItemNum(index, InvNum, 0) Call SetPlayerInvItemValue(index, InvNum, 0) Call SetPlayerInvItemDur(index, InvNum, 0) End If Call SendInventoryUpdate(index, InvNum) Call GiveBankItem(index, ItemNum, Amount, BankSlot) Call SendBank(index)End Sub```Also, open up the **Client** and go to _modHandleData_. Find this:```If LCase$(parse(0)) = "bankmsg" Then frmBank.lblMsg.Caption = Trim$(parse(1)) Exit Sub End If```Replace it with this:```If LCase$(parse(0)) = "bankmsg" Then Call MsgBox(Trim(parse(1))) Exit Sub End If```You don't have to post this at the top, but I feel that people should have the option to choose whichever they prefer. Anyway, thanks a lot again!EDIT: I noticed that I kept my own messages there. You can change them as you like. Link to comment Share on other sites More sharing options...
balliztik1 Posted June 24, 2009 Author Share Posted June 24, 2009 I like the MsgBox idea. It's certainly more noticeable. Link to comment Share on other sites More sharing options...
balliztik1 Posted September 11, 2009 Author Share Posted September 11, 2009 Oh, just noticed this.In your post, Kimimaru, you used MsgBox, but that's the server. The player won't receive that message. The server hoster will.Sorry for double post, but I was going through old topics and noticed that. Link to comment Share on other sites More sharing options...
Owen F Posted September 11, 2009 Share Posted September 11, 2009 yeah i think if he's trying to get the play to get a white box itsAlertMsg right? Link to comment Share on other sites More sharing options...
balliztik1 Posted September 11, 2009 Author Share Posted September 11, 2009 @[God:> Owen link=topic=46695.msg543250#msg543250 date=1252650749]> yeah i think if he's trying to get the play to get a white box its> AlertMsg right?Not quite. AlertMsg kicks them from the game. ;PYou'd have to change it within the "bankmsg" packet. Instead of changing the form's text, it would show a MsgBox. Link to comment Share on other sites More sharing options...
Owen F Posted September 11, 2009 Share Posted September 11, 2009 i feel stupiddont trust my scripts, they could kick you from the game without warning..oh wait..xD Link to comment Share on other sites More sharing options...
damian666 Posted September 11, 2009 Share Posted September 11, 2009 can i ask if somebody knows the fix for the error with bank that sometimes occurs on connect?it only happens on certain fsystems, and ofcourse on mine…it errors with rte 9, and when in vb6, it highlights bank stuff.Damian666 Link to comment Share on other sites More sharing options...
The New World Posted September 11, 2009 Share Posted September 11, 2009 Corrupted Bank files in your Banks folder on the server side? Thats all I can think of right now. Just nuke the Bank files. Then run the server, :D Link to comment Share on other sites More sharing options...
damian666 Posted September 11, 2009 Share Posted September 11, 2009 thats the weird thing… the bank folder is empty...Damian666 Link to comment Share on other sites More sharing options...
The New World Posted September 11, 2009 Share Posted September 11, 2009 Oh, well maybe check your server source? It may not be writing the packets for the bank files to be made? Link to comment Share on other sites More sharing options...
damian666 Posted September 11, 2009 Share Posted September 11, 2009 well… its default Stable... does it work for you?Damian666 Link to comment Share on other sites More sharing options...
The New World Posted September 11, 2009 Share Posted September 11, 2009 I don't use stable often, and I haven't gotten to the Server PAckets for clean-up yet, so I don't know. Ask someone on your thread?I have my own 2d Engine, not mirage based =-= Link to comment Share on other sites More sharing options...
damian666 Posted September 11, 2009 Share Posted September 11, 2009 ah ok :)well, i know it works for others… but its also reported before in eclipse, not just stable luckely XDoh well... ill manageDamian666 Link to comment Share on other sites More sharing options...
The New World Posted September 11, 2009 Share Posted September 11, 2009 @[SB:> Damian666 link=topic=46695.msg543332#msg543332 date=1252672925]> ah ok :)> > well, i know it works for others… but its also reported before in eclipse, not just stable luckely XD> > oh well... ill manage> > Damian666I'm looking at the bank code (server side) its a total mess still x.x Link to comment Share on other sites More sharing options...
Kimimaru Posted September 12, 2009 Share Posted September 12, 2009 @Balliztik1:> Oh, just noticed this.> > In your post, Kimimaru, you used MsgBox, but that's the server. The player won't receive that message. The server hoster will.> > Sorry for double post, but I was going through old topics and noticed that.Okay, thanks for pointing that out; I never realized it since I am the only one online, and I have control of the server.If you still want the MsgBox, you can check out my other post with it on there; I updated it. Link to comment Share on other sites More sharing options...
kris_hole Posted September 15, 2009 Share Posted September 15, 2009 arnt bank files wrote into the players files now? i thoght that was changed over LONG ago Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now