You last visited: Today at 14:19
Advertisement
[Help] with Warehouse issue
Discussion on [Help] with Warehouse issue within the CO2 Private Server forum part of the Conquer Online 2 category.
04/20/2015, 01:11
#1
elite*gold: 0
Join Date: Mar 2012
Posts: 4
Received Thanks: 0
[Help] with Warehouse issue
So I've got an issue with (Warehouse's / VIP / Slash) not allowing me to place items into them. instead the item just stay in my inventory.
asking if anyone could look over the code below and give me some results to fixing this problem.
Thanks in advance
..../Gamepackets/warehouse
PHP Code:
namespace COServer . Network . GamePackets { public unsafe class Warehouse : Writer , Interfaces . IPacket { Byte [] Packet ; public Warehouse ( Boolean Create ) { if ( Create ) { Packet = new Byte [ 92 ]; WriteUInt16 (( UInt16 )( Packet . Length - 8 ), 0 , Packet ); WriteUInt16 ( 1102 , 2 , Packet ); WriteUInt32 (( UInt32 ) Time32 . timeGetTime (). GetHashCode (), 4 , Packet ); } } public enum Mode : byte { Entire , AddItem , RemoveItem } public UInt32 NpcID { get { return BitConverter . ToUInt32 ( Packet , 4 ); } set { WriteUInt32 ( value , 4 , Packet ); } } public Mode Action { get { return ( Mode ) Packet [ 12 ]; } set { Packet [ 12 ] = ( Byte ) value ; } } public Byte Type { get { return Packet [ 12 ]; } set { Packet [ 12 ] = value ; } } public UInt32 UID { get { return BitConverter . ToUInt32 ( Packet , 20 ); } set { WriteUInt32 ( value , 20 , Packet ); } } public UInt32 Count { get { return BitConverter . ToUInt32 ( Packet , 24 ); } set { if ( value > 20 ) throw new Exception ( "Invalid Count value." ); Byte [] packet = new Byte [ 8 + 28 + ( 76 * value )]; WriteUInt16 (( UInt16 )( packet . Length - 8 ), 0 , packet ); WriteUInt16 ( 1102 , 2 , packet ); WriteUInt32 ( NpcID , 4 , packet ); WriteUInt32 ( Type , 12 , packet ); packet [ 13 ] = Packet [ 13 ]; WriteUInt32 ( value , 24 , packet ); Packet = packet ; } } public void Append ( ConquerItem item ) { WriteUInt32 ( item . UID , 28 , Packet ); WriteUInt32 ( item . ID , 32 , Packet ); WriteByte (( Byte ) item . SocketOne , 37 , Packet ); WriteByte (( Byte ) item . SocketTwo , 38 , Packet ); WriteByte ( item . Plus , 45 , Packet ); WriteByte ( item . Bless , 46 , Packet ); WriteByte (( Byte )( item . Bound == true ? 1 : 0 ), 47 , Packet ); WriteUInt16 ( item . Enchant , 48 , Packet ); WriteUInt16 (( ushort ) item . Effect , 50 , Packet ); WriteByte (( Byte )( item . Suspicious == true ? 1 : 0 ), 52 , Packet ); WriteByte ( item . Lock , 54 , Packet ); WriteByte (( Byte ) item . Color , 55 , Packet ); WriteUInt32 ( item . SocketProgress , 56 , Packet ); WriteUInt32 ( item . PlusProgress , 60 , Packet ); WriteBoolean ( item . Inscribed , 64 , Packet ); WriteUInt32 ( item . TimeLeftInMinutes , 68 , Packet ); WriteUInt32 ( item . StackSize , 76 , Packet ); } public Byte [] ToArray () { return Packet ; } public void Deserialize ( Byte [] buffer ) { Packet = buffer ; } public void Send ( Client . GameState client ) { client . Send ( Packet ); } public static void Process ( Byte [] packet , Client . GameState client ) { if ( client . Action != 2 ) return; Warehouse warehouse = new Warehouse ( false ); warehouse . Deserialize ( packet ); switch ( warehouse . Action ) { case Warehouse . Mode . Entire : { Game . ConquerStructures . Warehouse wh = client . Warehouses [( Game . ConquerStructures . Warehouse . WarehouseID ) warehouse . NpcID ]; if ( wh == null ) return; Byte count = 0 ; warehouse . Count = 1 ; warehouse . Action = Warehouse . Mode . AddItem ; for (; count < wh . Count ; count ++) { warehouse . Append ( wh . Objects [ count ]); client . Send ( warehouse ); ItemLock itemLock = new ItemLock ( true ); itemLock . UID = wh . Objects [ count ]. UID ; itemLock . ID = ItemLock . UnlockDate ; itemLock . dwParam = ( UInt32 )( wh . Objects [ count ]. UnlockEnd . Year * 10000 + wh . Objects [ count ]. UnlockEnd . Month * 100 + wh . Objects [ count ]. UnlockEnd . Day ); client . Send ( itemLock ); ItemAdding add = new ItemAdding ( true ); if ( wh . Objects [ count ]. Purification . Available ) add . Append ( wh . Objects [ count ]. Purification ); if ( wh . Objects [ count ]. ExtraEffect . Available ) if ( wh . Objects [ count ]. ExtraEffect . Available ) add . Append ( wh . Objects [ count ]. ExtraEffect ); if ( wh . Objects [ count ]. Purification . Available || wh . Objects [ count ]. ExtraEffect . Available ) client . Send ( add ); if ( client . Entity . HeavenBlessing == 0 && client . Entity . GuiHeavenBlessing == 0 ) { Data Data = new Data ( true ); Data . UID = client . Entity . UID ; Data . ID = 116 ; Data . dwParam = Data . CustomCommands . GuiHeavenBlessing ; client . Send ( Data ); client . Entity . GuiHeavenBlessing ++; } } break; } case Warehouse . Mode . AddItem : { if ( client . Booth != null ) return; foreach ( ConquerItem itemx in client . Inventory . Objects ) { if (( itemx . ID == 1100003 ) || ( itemx . ID == 1100006 ) || ( itemx . ID == 1100009 )) { if (! client . Warehouses . ContainsKey (( Game . ConquerStructures . Warehouse . WarehouseID )( uint ) itemx . UID )) { client . Warehouses . Add (( Game . ConquerStructures . Warehouse . WarehouseID )( uint ) itemx . UID , new COServer . Game . ConquerStructures . Warehouse ( client , ( Game . ConquerStructures . Warehouse . WarehouseID )( uint ) itemx . UID )); } } } Game . ConquerStructures . Warehouse wh = client . Warehouses [( Game . ConquerStructures . Warehouse . WarehouseID ) warehouse . NpcID ]; if ( wh == null ) return; ConquerItem item = null ; if ( client . Inventory . TryGetItem ( warehouse . UID , out item )) { if ( item . ID >= 729960 && item . ID <= 729970 ) return; if (! ConquerItem . isRune ( item . UID )) { if ( wh . Add ( item )) { warehouse . UID = 0 ; warehouse . Count = 1 ; warehouse . Append ( item ); client . Send ( warehouse ); ItemLock itemLock = new ItemLock ( true ); itemLock . UID = item . UID ; itemLock . ID = ItemLock . UnlockDate ; itemLock . dwParam = ( UInt32 )( item . UnlockEnd . Year * 10000 + item . UnlockEnd . Month * 100 + item . UnlockEnd . Day ); client . Send ( itemLock ); ItemAdding add = new ItemAdding ( true ); if ( item . Purification . Available ) add . Append ( item . Purification ); if ( item . ExtraEffect . Available ) add . Append ( item . ExtraEffect ); if ( item . Purification . Available || item . ExtraEffect . Available ) client . Send ( add ); return; } } else client . Send (new Message ( "You can not store Flame Stone Rune's in Warehouse" , System . Drawing . Color . Red , Message . TopLeft )); } break; } case Warehouse . Mode . RemoveItem : { Game . ConquerStructures . Warehouse wh = client . Warehouses [( Game . ConquerStructures . Warehouse . WarehouseID ) warehouse . NpcID ]; if ( wh == null ) return; if ( wh . ContainsUID ( warehouse . UID )) { if ( wh . Remove ( warehouse . UID )) { client . Send ( warehouse ); return; } } break; } default: Console . WriteLine ( "[Warehouse] Unknown type: " + warehouse . Action ); break; } } } }
....Game/Conquerstructures/warehouse
PHP Code:
namespace COServer . Game . ConquerStructures { public unsafe class Warehouse { ConquerItem [] objects ; Client . GameState Owner ; WarehouseID _ID ; byte MaxCount = 20 ; Dictionary < uint , ConquerItem > items ; public Warehouse ( Client . GameState client , WarehouseID ID ) { Owner = client ; _ID = ID ; MaxCount = 60 ; items = new Dictionary < uint , ConquerItem >( MaxCount ); objects = new ConquerItem [ 0 ]; } public bool Add ( ConquerItem item ) { if (! items . ContainsKey ( item . UID ) && Count < MaxCount ) { item . Warehouse = ( ushort ) _ID ; item . Position = 0 ; Owner . Inventory . Remove ( item , Game . Enums . ItemUse . Move ); items . Add ( item . UID , item ); objects = items . Values . ToArray (); return true ; } return false ; } public bool Remove ( ConquerItem item ) { if ( items . ContainsKey ( item . UID )) { item . Warehouse = 0 ; if ( Owner . Inventory . Add ( item , Enums . ItemUse . Move )) { items . Remove ( item . UID ); objects = items . Values . ToArray (); Network . GamePackets . Warehouse warehouse = new Network . GamePackets . Warehouse ( true ); warehouse . Action = Network . GamePackets . Warehouse . Mode . RemoveItem ; warehouse . Count = 1 ; warehouse . Append ( item ); Owner . Send ( warehouse ); return true ; } } return false ; } public bool Remove ( uint UID ) { if ( items . ContainsKey ( UID )) { ConquerItem item = items [ UID ]; item . Warehouse = 0 ; if ( Owner . Inventory . Add ( item , Enums . ItemUse . Move )) { items . Remove ( item . UID ); objects = items . Values . ToArray (); return true ; } } return false ; } public ConquerItem [] Objects { get { return objects ; } } public byte Count { get { return ( byte ) Objects . Length ; } } public ConquerItem GetItem ( uint UID ) { ConquerItem item = null ; items . TryGetValue ( UID , out item ); return item ; } public bool ContainsUID ( uint UID ) { return items . ContainsKey ( UID ); } public enum WarehouseID : ushort { TwinCity = 8 , PhoenixCity = 10012 , ApeCity = 10028 , DesertCity = 10011 , BirdCity = 10027 , StoneCity = 4101 , Market = 44 , House = 100 } } }
...NPC
PHP Code:
Warehousemen case 8 : case 44 : case 4101 : case 10012 : case 10028 : case 10011 : case 10027 : case 30658 : { switch ( npcRequest . OptionID ) { case 0 : { Data data = new Data ( true ); INpc npc = null ; if ( client . Map . Npcs . TryGetValue ( client . ActiveNpc , out npc )) { if ( client . WarehousePW == 0 && client . Entity . NotHavePassword == false ) { dialog . Text ( "First time here? Well, for the security of your warehouse, please set a warehouse password (Setting - Secondary)." ); dialog . Option ( "Alright. Thanks, man." , 1 ); dialog . Avatar ( 30 ); dialog . Send (); return; } if (! client . WarehouseOpen ) client . Send (new Message ( "" , System . Drawing . Color . Maroon , Message . TopLeft )); else { if (! client . WarehouseOpen ) { data = new Data ( true ); data . ID = Data . OpenWindow ; data . UID = client . Entity . UID ; data . TimeStamp = Time32 . Now ; data . dwParam = 568 ; data . wParam1 = client . Entity . X ; data . wParam2 = client . Entity . Y ; client . Send ( data ); return; } } data = new Data ( true ); data . ID = Data . OpenWindow ; data . UID = client . Entity . UID ; data . TimeStamp = Time32 . Now ; data . dwParam = Data . WindowCommands . Warehouse ; data . wParam1 = npc . X ; data . wParam2 = npc . Y ; client . Send ( data ); } break; } case 1 : { client . Entity . NotHavePassword = true ; break; } } break; }
..../ Packethandler
PHP Code:
case PacketID . Warehouses : { Warehouse . Process ( packet , client ); break; }
..../ Packethandler
PHP Code:
#region WarehouseOpen if ( req . InteractType == NpcReply . MessageBox ) { if ( client . Entity . ActivePOPUP == 99995 ) { client . Entity . ActivePOPUP = 0 ; break; } if ( req . OptionID == 255 && client . MessageOK != null ) client . MessageOK . Invoke ( client ); else if ( client . MessageCancel != null ) client . MessageCancel . Invoke ( client ); client . MessageOK = null ; client . MessageCancel = null ; } else { Data data = new Data ( true ); if ( ID == 2031 ) client . ActiveNpc = req . NpcID ; if ( req . NpcID == 12 ) { if ( client . WarehousePW != 0 ) { if (! client . WarehouseOpen ) { data = new Data ( true ); data . ID = Data . OpenWindow ; data . UID = client . Entity . UID ; data . TimeStamp = Time32 . Now ; data . dwParam = 568 ; data . wParam1 = client . Entity . X ; data . wParam2 = client . Entity . Y ; client . Send ( data ); break; } } else { client . Send (new Message ( "To protect your items that are stored in warehouse, you should set a Secondary password at Settings." , System . Drawing . Color . Red , Message . TopLeft )); } if ( client . Entity . VIPLevel > 0 ) { data = new Data ( true ); data . ID = Data . OpenWindow ; data . UID = client . Entity . UID ; data . TimeStamp = Time32 . Now ; data . dwParam = Data . WindowCommands . VIPWarehouse ; data . wParam1 = client . Entity . X ; data . wParam2 = client . Entity . Y ; client . Send ( data ); break; } } #endregion
Any clue will help Thanks.
04/20/2015, 23:33
#2
elite*gold: 15
Join Date: Dec 2008
Posts: 332
Received Thanks: 137
Here's my clue: Delete that ****, close your computer and throw it from the CN Tower's roof.
04/20/2015, 23:39
#3
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
xD Emulator Source
----------------------
try breakpoint with debug
04/20/2015, 23:56
#4
elite*gold: 0
Join Date: Mar 2012
Posts: 4
Received Thanks: 0
First Thanks for moving this to its right section.
@Novakhan - cool story bruh but id rather not.
@abdoumatrix - Yes you are correct this is Emulator Source
if anyone needs more information to help me solve this problem please let me know. thanks
04/21/2015, 03:23
#5
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
Breakpoint is ur answer
04/21/2015, 12:27
#6
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
public UInt32 NpcID
{
get { return BitConverter.ToUInt32(Packet, 8 ); }
set { WriteUInt32(value, 8 , Packet); }
}
public UInt32 Count
{
get { return BitConverter.ToUInt32(Packet, 24); }
set
{
if (value > 20)
throw new Exception("Invalid Count value.");
Byte[] packet = new Byte[8 + 28 + (76 * value)];
WriteUInt16((UInt16)(packet.Length - 8), 0, packet);
WriteUInt16(1102, 2, packet);
WriteUInt32(NpcID, 8 , packet);
WriteUInt32(Type, 12, packet);
packet[13] = Packet[13];
WriteUInt32(value, 24, packet);
Packet = packet;
}
}
04/21/2015, 20:10
#7
elite*gold: 0
Join Date: Mar 2012
Posts: 4
Received Thanks: 0
@teroareboss1 - changing the values to [8] didnt help its the same as it has been.
i can open the warehouses/slash/vipWH but when i place my item into My VIP Warehouse/ Slash/or any of the warehouse located around CO they just stay into my Inventory and wont transfer into the bank storage.
Note: I've tried depositing money and it worked!
also tried Depositing Items with different Quality like Normal/refine/elite/super 2soc /Bound/Nonbound/Inscribed gear/ and locked / unlocked gear..etc But still nothing help the situation
Now i did add to my main topic the Npc info / packhandler info
Hope someone with a good understanding of the Warehouse can provide some suggestions
04/22/2015, 15:42
#8
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
you're use wrong client. try to update your client. your packet is for new versions.
Similar Threads
AO/AR Bug's Warehouse
01/04/2013 - Ace Online / AirRivals - 20 Replies
Hello i know some player make weapons use remonte warehouse how to make this ? please give me instruction :D
[HELP]Warehouse
08/08/2010 - EO PServer Hosting - 7 Replies
i just wanna ask little stupid question.. :D my warehouse cant set password,after there say please once again put password nothing happen.. hope can help me.. :o
Warehouse.
01/11/2010 - Conquer Online 2 - 3 Replies
I was wondering if they still have a warehouse crack so we could open the warehouse without the password. I forgot my warehouse password and obviously i dont have a valid email for the wh..So can someone help me out here?
Warehouse pw
08/16/2009 - Conquer Online 2 - 20 Replies
Is there an way the bypass orsomething warehouse pw there whas tread but i cant find it anymore .. plz help me!
Help with warehouse
04/17/2008 - Conquer Online 2 - 3 Replies
Need a program to unlock the warehouse please.
All times are GMT +2. The time now is 14:21 .