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
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).
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)
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
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 ??
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.
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
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
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.
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
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.
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.
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.