Register for your free account! | Forgot your password?

You last visited: Today at 21:48

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Few Questions

Discussion on Few Questions within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Few Questions

1st question i Noticed That Donation packets r handled using BinaryWriter so is it good or bad ?

2nd question ...is There any working Packet sniffer Yet with 5570+ ?

3rd How can i send String Effect to Both Ground And Npc ..

4th How can i Make Item Counter in my Inventory Cuz i've seen smthing good at Angelic Co which is Admin count the number of dbs in my inventory and give 180 * Number of Dbs
shadowman123 is offline  
Old 03/10/2012, 06:59   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,284
Received Thanks: 4,196
Quote:
Originally Posted by shadowman123 View Post
1st question i Noticed That Donation packets r handled using BinaryWriter so is it good or bad ?

2nd question ...is There any working Packet sniffer Yet with 5570+ ?

3rd How can i send String Effect to Both Ground And Npc ..

4th How can i Make Item Counter in my Inventory Cuz i've seen smthing good at Angelic Co which is Admin count the number of dbs in my inventory and give 180 * Number of Dbs
Q: 1st question i Noticed That Donation packets r handled using BinaryWriter so is it good or bad ?

Donation packets as in the packets for Nobility? I don't see why u'd use a binary writer to write a packet (unless you're working with differentiating lengths to strings and such). Do you mean the packets or saving info to the database?

Q: 2nd question ...is There any working Packet sniffer Yet with 5570+ ?

Well, no. I don't think there will be one for a very long time. I don't have permission to release mine since I didn't come up with the encryption on my own. I can always post packet logs for you if you ask for them though. There's also this:

Q: How can i send String Effect to Both Ground And Npc ..

Send a string effect using the identity of an entity to send it to their body. Send a string effect using the x & y values of a coordinate to send it to a point on the ground.

Q: How can i Make Item Counter in my Inventory Cuz i've seen smthing good at Angelic Co which is Admin count the number of dbs in my inventory and give 180 * Number of Dbs

I'm not sure if this is what you mean, but basically he's just checking the Inventory's dictionary for an item name and counting the results (probably).
Spirited is offline  
Old 03/10/2012, 10:31   #3
 
×Holo's Avatar
 
elite*gold: 0
Join Date: Mar 2012
Posts: 286
Received Thanks: 71
Quote:
Q: How can i Make Item Counter in my Inventory Cuz i've seen smthing good at Angelic Co which is Admin count the number of dbs in my inventory and give 180 * Number of Dbs
In all sources i've worked on.. you just have to use (itemID, itemPLUS, itemVALUE)
×Holo is offline  
Old 03/10/2012, 17:19   #4
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by ×Holo View Post
In all sources i've worked on.. you just have to use (itemID, itemPLUS, itemVALUE)
well i could say

Code:
if (client.Inventory.Contains(1088000))
{
    client.Entity.DBCount += 1; //DBCount is uint instance = 0 At Entity.cs
}
But This Means That When my inventory contains db it will Raise The DB Count to 1 i guess i SHould use foreach method

Quote:
Originally Posted by Fаng View Post
Q: 1st question i Noticed That Donation packets r handled using BinaryWriter so is it good or bad ?

Donation packets as in the packets for Nobility? I don't see why u'd use a binary writer to write a packet (unless you're working with differentiating lengths to strings and such). Do you mean the packets or saving info to the database?

Q: 2nd question ...is There any working Packet sniffer Yet with 5570+ ?

Well, no. I don't think there will be one for a very long time. I don't have permission to release mine since I didn't come up with the encryption on my own. I can always post packet logs for you if you ask for them though. There's also this:

Q: How can i send String Effect to Both Ground And Npc ..

Send a string effect using the identity of an entity to send it to their body. Send a string effect using the x & y values of a coordinate to send it to a point on the ground.

Q: How can i Make Item Counter in my Inventory Cuz i've seen smthing good at Angelic Co which is Admin count the number of dbs in my inventory and give 180 * Number of Dbs

I'm not sure if this is what you mean, but basically he's just checking the Inventory's dictionary for an item name and counting the results (probably).
1st : Thx Alot for helping ....The Donation which is handled inside packet handler.cs r calling Donation Class which contain the packet structure and its Built using Binary Writer ...

2nd : Could u do packet log of packet type 1314 And Team Arena Qualifier for me please ??
shadowman123 is offline  
Old 03/10/2012, 18:30   #5
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,284
Received Thanks: 4,196
I'm not sure. It's your source, not mine. Try reading it to get a better understanding of what it does. It's creating a packet you said, so it's retrieving the byte array of the stream at the end of the function, right? I wouldn't worry about it too much. You can always rewrite it so it doesn't use it. It depends on what it's writing.

Code:
Packet 90 -- TQClient -- Length: 24 | 32 -- Type: 1314
18 00 22 05 03 01 01 00 00 00 03 00 31 00 00 00 ;    "    1   
FF 0A 0B 00 00 00 00 00 54 51 53 65 72 76 65 72 ;   ÿ
     TQServer
I don't know the packet id for team qualifier.
It should be in here somewhere though.

Code:
Packet 48 -- TQServer -- Length: 44 | 52 -- Type: 2245
2C 00 C5 08 00 00 00 00 00 00 00 00 00 00 00 00 ;   , Å            
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 54 51 43 6C ;               TQCl
69 65 6E 74                                     ;   ient


Packet 49 -- TQServer -- Length: 52 | 60 -- Type: 2244
34 00 C4 08 00 00 00 00 00 00 00 00 00 00 00 00 ;   4 Ä            
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 54 51 43 6C 69 65 6E 74             ;       TQClient


Packet 50 -- TQServer -- Length: 72 | 80 -- Type: 2242
48 00 C2 08 01 00 00 00 06 00 00 00 00 00 00 00 ;   H Â          
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 54 51 43 6C 69 65 6E 74 ;           TQClient


Packet 51 -- TQClient -- Length: 48 | 56 -- Type: 2245
30 00 C5 08 00 00 00 00 00 00 00 00 06 00 00 00 ;   0 Å           
05 00 00 00 00 00 00 00 00 00 00 00 66 E7 07 00 ;              fç 
22 4C 00 00 A0 0F 00 00 00 00 00 00 00 00 00 00 ;   "L  *          
54 51 53 65 72 76 65 72                         ;   TQServer


Packet 52 -- TQClient -- Length: 452 | 460 -- Type: 2244
C4 01 C4 08 0A 00 00 00 78 58 43 61 73 69 6C 6C ;   ÄÄ
   xXCasill
61 73 58 78 00 00 00 00 01 00 00 00 2B AE 6C 3A ;   asXx       +®l:
0F 00 00 00 83 00 00 00 7E 17 00 00 18 00 00 00 ;      ƒ   ~     
07 00 00 00 6B 6C 61 77 79 00 00 00 00 00 00 00 ;      klawy       
00 00 00 00 02 00 00 00 9B 04 09 00 41 00 00 00 ;          ›	 A   
8A 00 00 00 40 17 00 00 12 00 00 00 00 00 00 00 ;   Š   @         
2A 45 61 72 74 68 4C 6F 72 64 2A 00 00 00 00 00 ;   *EarthLord*     
03 00 00 00 9B E6 0D 00 0F 00 00 00 83 00 00 00 ;      ݾ
    ƒ   
31 15 00 00 11 00 00 00 04 00 00 00 7E 41 7A 72 ;   1        ~Azr
61 65 4C 7E 00 00 00 00 00 00 00 00 04 00 00 00 ;   aeL~           
2B 28 14 00 41 00 00 00 85 00 00 00 1C 14 00 00 ;   +( A   …     
0D 00 00 00 05 00 00 00 58 78 7E 56 6F 6C 65 7E ;   
      Xx~Vole~
78 58 00 00 00 00 00 00 05 00 00 00 AB 60 15 00 ;   xX         «` 
0F 00 00 00 87 00 00 00 E7 13 00 00 0D 00 00 00 ;      ‡   ç  
   
05 00 00 00 44 75 74 63 68 70 72 69 64 65 00 00 ;      Dutchpride  
00 00 00 00 06 00 00 00 4B 94 0F 00 0F 00 00 00 ;          K”    
82 00 00 00 2D 13 00 00 0E 00 00 00 06 00 00 00 ;   ‚   -        
7C 7E 52 61 64 69 61 6E 63 65 7E 7C 00 00 00 00 ;   |~Radiance~|    
07 00 00 00 21 88 20 00 37 00 00 00 82 00 00 00 ;      !ˆ  7   ‚   
21 13 00 00 0E 00 00 00 07 00 00 00 4E 69 54 72 ;   !        NiTr
6F 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 ;   o              
3B 4F 14 00 41 00 00 00 8C 00 00 00 0D 13 00 00 ;   ;O A   Œ   
  
08 00 00 00 02 00 00 00 2A 49 6D 61 64 61 6D 72 ;         *Imadamr
2A 00 00 00 00 00 00 00 09 00 00 00 0B 52 00 00 ;   *       	   R  
87 00 00 00 8C 00 00 00 6D 12 00 00 0C 00 00 00 ;   ‡   Œ   m     
05 00 00 00 67 61 6D 61 6C 5F 6B 69 6E 67 00 00 ;      gamal_king  
00 00 00 00 0A 00 00 00 5B D9 0A 00 0F 00 00 00 ;       
   [Ù
    
80 00 00 00 55 12 00 00 08 00 00 00 03 00 00 00 ;   €   U        
00 00 00 00 54 51 53 65 72 76 65 72             ;       TQServer


Packet 53 -- TQClient -- Length: 76 | 84 -- Type: 2242
4C 00 C2 08 01 00 00 00 06 00 00 00 00 00 00 00 ;   L Â          
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ;                   
00 00 00 00 00 00 00 00 00 00 00 00 54 51 53 65 ;               TQSe
72 76 65 72                                     ;   rver


Packet 54 -- TQClient -- Length: 98 | 106 -- Type: 1004
62 00 EC 03 FF FF FF FF E5 07 00 00 43 01 00 00 ;   b ìÿÿÿÿå  C  
00 00 00 00 00 00 00 00 06 07 7C 4B 49 E0 55 A7 ;           |KIàU§
7C 04 41 6C 6C 20 00 35 53 45 4C 4C 20 3E 3E 20 ;   |All  5SELL >> 
5B 49 74 65 6D 20 43 65 6C 65 73 74 69 61 6C 53 ;   [Item CelestialS
74 6F 6E 65 20 34 39 30 32 37 37 38 36 37 20 34 ;   tone 490277867 4
32 39 33 33 39 35 37 30 39 5D 20 2E 2E 00 00 00 ;   293395709] ..   
00 00 54 51 53 65 72 76 65 72                   ;     TQServer


Packet 55 -- TQServer -- Length: 57 | 65 -- Type: 1004
39 00 EC 03 FF FF FF FF D0 07 00 00 BB 06 00 00 ;   9 ìÿÿÿÿÐ  »  
00 00 00 00 00 00 00 00 06 06 7E 46 61 6E 67 7E ;           ~Fang~
04 41 6C 6C 20 00 0D 7C 73 6E 69 66 66 70 61 63 ;   All  
|sniffpac
6B 65 74 73 00 00 00 00 00 54 51 43 6C 69 65 6E ;   kets     TQClien
74                                              ;   t
Spirited is offline  
Thanks
1 User
Old 03/10/2012, 20:14   #6
 
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
4th.
you can make one like this

Code:
public ushort InventoryItemCount(uint ID)
        {
            if (ID == 0)
                return 0;
            ushort count = 0;
            foreach (Interfaces.IConquerItem item in Inventory.Objects)
                if (item.ID == ID)
                    count++;
            return count;
        }
& this exm for command

Code:
case "itemcount":
                                {
                                    bool online = false;
                                    foreach (var Client in ServerBase.Kernel.GamePool.Values)
                                    {
                                        if (Client.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            client.Send(new Message("Entity Have (" + Client.InventoryItemCount(uint.Parse(Data[2])) + ") items.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                            online = true;
                                            break;
                                        }
                                    }
                                    if (!online)
                                        client.Send(new Message("Entity not online", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                    break;
                                }
& to test it "@itemcount char*name itemid"
dego4ever is offline  
Thanks
1 User
Old 03/10/2012, 23:05   #7
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Thx Alot All u guyz ..

@Fang Special Thx To you and smthing i wanted to say i watched Paradise proxy Tutorial and i think i can Analyise the Packet log

@Dego4Ever Dude u made my day ...i was Almost sure about using Foreach method
shadowman123 is offline  
Old 03/10/2012, 23:52   #8
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Quote:
Originally Posted by dego4ever View Post
4th.
you can make one like this

Code:
public ushort InventoryItemCount(uint ID)
        {
            if (ID == 0)
                return 0;
            ushort count = 0;
            foreach (Interfaces.IConquerItem item in Inventory.Objects)
                if (item.ID == ID)
                    count++;
            return count;
        }
& this exm for command

Code:
case "itemcount":
                                {
                                    bool online = false;
                                    foreach (var Client in ServerBase.Kernel.GamePool.Values)
                                    {
                                        if (Client.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            client.Send(new Message("Entity Have (" + Client.InventoryItemCount(uint.Parse(Data[2])) + ") items.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                            online = true;
                                            break;
                                        }
                                    }
                                    if (!online)
                                        client.Send(new Message("Entity not online", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                    break;
                                }
& to test it "@itemcount char*name itemid"
As I learned from InfamousNoone himself, a ushort is inefficient in this case, the inventory handles 40 objects, a byte is smaller then a ushort and a bytes max value is 255, ushorts max value is something like 65535, so as you can see a byte is much more efficient in this case.

Just saying.

#edit
An int would work great too, performance wise and int would work better, but efficiency wise a byte is more then big enough and more efficient.

Thanks fang^.


;;

Regardless, a ushort is far inefficient for this task, choose either a byte or an int, and I can also point out another flaw in the code ;O
_DreadNought_ is offline  
Thanks
1 User
Old 03/10/2012, 23:58   #9
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by _DreadNought_ View Post
As I learned from InfamousNoone himself, a ushort is inefficient in this case, the inventory handles 40 objects, a byte is smaller then a ushort and a bytes max value is 255, ushorts max value is something like 65535, so as you can see a byte is much more efficient in this case.

Just saying.
true Using Byte would be Much Professinaly but if i used uint , ushort , byte or even ulong it will work
shadowman123 is offline  
Old 03/11/2012, 00:02   #10
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,284
Received Thanks: 4,196
Quote:
Originally Posted by _DreadNought_ View Post
As I learned from InfamousNoone himself, a ushort is inefficient in this case, the inventory handles 40 objects, a byte is smaller then a ushort and a bytes max value is 255, ushorts max value is something like 65535, so as you can see a byte is much more efficient in this case.

Just saying.

#edit
An int would work great too, performance wise and int would work better, but efficiency wise a byte is more then big enough and more efficient.

Thanks fang^.
It depends on the machine. With mine, it's a long because I work on a *legitimate* 64bit processor (not just a 64bit operating system). Since the default word size of a 32bit processor is 32 bits, an int is more optimized to run on that processor. It'll be less expensive to increment and such in the for loop.
Spirited is offline  
Old 03/11/2012, 00:09   #11
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Quote:
Originally Posted by Fаng View Post
It depends on the machine. With mine, it's a long because I work on a *legitimate* 64bit processor (not just a 64bit operating system). Since the default word size of a 32bit processor is 32 bits, an int is more optimized to run on that processor. It'll be less expensive to increment and such in the for loop.
Right right, Regardless, I am going to assume by both of our posts that we both agree that a ushort is far too big for his task.
Quote:
Originally Posted by shadowman123 View Post
true Using Byte would be Much Professinaly but if i used uint , ushort , byte or even ulong it will work
If you used a uint, ulong or a ushort it would idiotic, Why would you want to free up a uint, ulong or ushort's max value in memory? It's a waste of memory that will never get totally used up(Untill it gets disposed, of course, not that I know what im on about...) but yeah, a byte would free up 255 bytes in memory, of those a max of 40 would get filled up, so getting a ushort and freeing up 65535(or w/e the max value is) worth of memory and knowing you can only ever be using 40 bytes of that(max value of your inventory is 40, your counting items, it isnt gong above 40 :P) why would you free up 65535 worth of memory, or in a uint or ulongs case far more memory when a byte(255 bytes of memory) is all thats required? Even thats too much, hell, If I were you I would use a sbyte(max value 128 or w/e)

Yeah, go use a sbyte, Occupies even less memory then a byte and an int.
_DreadNought_ is offline  
Thanks
2 Users
Old 03/11/2012, 00:40   #12
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Wooow u Pointed me to smthing very Good which is Memory Usage (Y) Good Pointer
shadowman123 is offline  
Old 03/11/2012, 08:20   #13
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,284
Received Thanks: 4,196
Quote:
Originally Posted by _DreadNought_ View Post
Right right, Regardless, I am going to assume by both of our posts that we both agree that a ushort is far too big for his task.


If you used a uint, ulong or a ushort it would idiotic, Why would you want to free up a uint, ulong or ushort's max value in memory? It's a waste of memory that will never get totally used up(Untill it gets disposed, of course, not that I know what im on about...) but yeah, a byte would free up 255 bytes in memory, of those a max of 40 would get filled up, so getting a ushort and freeing up 65535(or w/e the max value is) worth of memory and knowing you can only ever be using 40 bytes of that(max value of your inventory is 40, your counting items, it isnt gong above 40 :P) why would you free up 65535 worth of memory, or in a uint or ulongs case far more memory when a byte(255 bytes of memory) is all thats required? Even thats too much, hell, If I were you I would use a sbyte(max value 128 or w/e)

Yeah, go use a sbyte, Occupies even less memory then a byte and an int.
Actually... I was disagreeing o.o
It would be better to use an int or ulong in a loop that loops through a lot of objects.
A foreach would be much better though...

Code:
foreach (Item item in Inventory)
{
     if (item.Name == "DragonBall")
          Mind.Blow();
}
Edit: An int comparison would be better than a string comparison though, so I'd check the item id if I were you instead of the name.
Spirited is offline  
Old 03/11/2012, 10:08   #14
 
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
Quote:
Originally Posted by _DreadNought_ View Post
As I learned from InfamousNoone himself, a ushort is inefficient in this case, the inventory handles 40 objects, a byte is smaller then a ushort and a bytes max value is 255, ushorts max value is something like 65535, so as you can see a byte is much more efficient in this case.

Just saying.

#edit
An int would work great too, performance wise and int would work better, but efficiency wise a byte is more then big enough and more efficient.

Thanks fang^.


;;

Regardless, a ushort is far inefficient for this task, choose either a byte or an int, and I can also point out another flaw in the code ;O
there are some people using "item*stack" so count can be bigger than "byte" max value. it's pave, no more.
dego4ever is offline  
Reply




All times are GMT +2. The time now is 21:48.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.