| Mirage Source http://www.miragesource.net/forums/ |
|
| Update item http://www.miragesource.net/forums/viewtopic.php?f=210&t=1507 |
Page 1 of 1 |
| Author: | William [ Tue Mar 13, 2007 7:10 pm ] |
| Post subject: | Update item |
Introduction The reason I posted this is that it currently just updates a small part of the items attributes. And I dont see why that should be. Since it all sends from the server but only recieves a few of them. Don't think this will make a difference to the game but it might save you sometime. Client Side Find this: Code: ' :::::::::::::::::::::::: ' :: Update item packet :: ' :::::::::::::::::::::::: If (LCase(Parse(0)) = "updateitem") Then n = Val(Parse(1)) ' Update the item Item(n).Name = Parse(2) Item(n).Pic = Val(Parse(3)) Item(n).Type = Val(Parse(4)) Item(n).Data1 = 0 Item(n).Data2 = 0 Item(n).Data3 = 0 Exit Sub End If Replace it with: Code: ' :::::::::::::::::::::::: ' :: Update item packet :: ' :::::::::::::::::::::::: If (LCase(Parse(0)) = "updateitem") Then n = Val(Parse(1)) ' Update the item Item(n).Name = Parse(2) Item(n).Pic = Val(Parse(3)) Item(n).Type = Val(Parse(4)) Item(n).Data1 = Val(Parse(5)) Item(n).Data2 = Val(Parse(6)) Item(n).Data3 = Val(Parse(7)) Exit Sub End If Server Side Find: Code: Sub SendUpdateItemTo(ByVal Index As Long, ByVal ItemNum As Long) Dim Packet As String Packet = "UPDATEITEM" & SEP_CHAR & ItemNum & SEP_CHAR & Trim(Item(ItemNum).Name) & SEP_CHAR & Item(ItemNum).Pic & SEP_CHAR & Item(ItemNum).Type & SEP_CHAR & END_CHAR Call SendDataTo(Index, Packet) End Sub Should be: Code: Sub SendUpdateItemTo(ByVal Index As Long, ByVal ItemNum As Long)
Dim Packet As String Packet = "UPDATEITEM" & SEP_CHAR & ItemNum & SEP_CHAR & Trim(Item(ItemNum).Name) & SEP_CHAR & Item(ItemNum).Pic & SEP_CHAR & Item(ItemNum).Type & SEP_CHAR & Item(ItemNum).Data1 & SEP_CHAR & Item(ItemNum).Data2 & SEP_CHAR & Item(ItemNum).Data3 & SEP_CHAR & END_CHAR Call SendDataTo(Index, Packet) End Sub |
|
| Author: | Xlithan [ Tue Mar 13, 2007 10:00 pm ] |
| Post subject: | |
What exactly was the error? |
|
| Author: | Coke [ Tue Mar 13, 2007 10:01 pm ] |
| Post subject: | |
it wasnt updating the items data1, data2, or data3... |
|
| Author: | William [ Tue Mar 13, 2007 10:10 pm ] |
| Post subject: | |
Im not sure what difference it will make, but it was sending from the server on the first one. But it didnt recieve it. |
|
| Author: | Xlithan [ Wed Mar 14, 2007 2:44 pm ] |
| Post subject: | |
hmm, never noticed this before. I'll check it out later. |
|
| Author: | William [ Wed Mar 14, 2007 2:55 pm ] |
| Post subject: | |
Well basicly, all the item attributes are handled server side. The one point when the client needs them is upon a added request or for the item editor. But still it will be good to update all the parts of the item. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|