Well, im sure that this isnt anything new to anyone. But every source I looked at either didnt have the packet added yet, or the member list was bugged. So I just decided to toggle with it until it was working flawlessly for me.
PHP Code:
ushort PacketLength, Offset = 0
ushort PacketType, Offset = 2
uint GuildID, Offset = 4
byte Type, Offset = 8 //Value of 0xB for member list
byte Count, Offset = 9 //How many members are being listed
For Each Member:
byte MemberStringLength, Offset = 10 + Current Offset
string MemberString, Offset = 11 + Current Offset
eh, either works, i was just too lazy to write all that out + add the system.text namespace.
is there a performance difference between the two methods?
eh, either works, i was just too lazy to write all that out + add the system.text namespace.
is there a performance difference between the two methods?
Using string += string + string + string + string etc. will create a new string for every time, where StringBuilder writes in memory, so it's way faster and efficient and that's what you should focus at when creating a server, not if it works.
Hum. Your implementation will fail for big guilds. Imagine a guild with 100+ member? Your packet will be too big... And its limit the members to 255. Not the real implementation. You need to split the members per pages.
It's not the optimal implementation, but it's the way you should do it.
Code:
Player Player = Client.User;
if (Player == null)
return;
if (Player.Syndicate == null)
return;
Syndicate.Info Syn = Player.Syndicate;
String[] List = Syn.GetMemberList();
if (Data == -1)
Data = 0;
Int32 Amount = List.Length - (Data * 10);
if (Amount > 10)
Amount = 10;
String[] Tmp = new String[Amount];
Array.Copy(List, Data * 10, Tmp, 0, Amount);
Player.Send(MsgName.Create(Data + 1, Tmp, Action.MemberList));
as cpt said I'd combine the idea of using a stringbuilder with a 'sendpage' option. Tq only sends one page of members at a time and when you scroll through them it uses the page index to pull just the next... 10 entries for example to send per packet.
You would still use stringbuilder, just not clog it up with EVERY member in the entire guild.
How do I interpret the 4 byte value packet 0x3F7 subtype 0x0B? (list guild members) 10/27/2011 - CO2 Private Server - 1 Replies For clients < 51xx; though it may be more, it just appears to have changed in the current version. No source that I've seen has this done correctly. I've analyzed it with olly; I figure a picture of what I've discovered so far is more helpful than explaining it. Read comments to the right.
http://img11.imageshack.us/img11/6769/unledofq.jp g
Yeah, I have no idea why they don't just pass the index as the value since it'd be much easier to use and it's already obviously defined either.
[Release] String/Float Value List 10/22/2010 - S4 League Hacks, Bots, Cheats & Exploits - 42 Replies I Think
the title
say all
Screen:
http://www3.pic-upload.de/21.10.10/p267csthj81k.p ng
VirusTotal is Down? o.ô
Updatelog:
Play sound via Packet Send?? [Question String Packet] 07/14/2010 - CO2 Private Server - 5 Replies Yow im trying to figure out why i cant play music with the string packet
What im doin is;
MyChar.Client.SendPacket(Game.Packet.String(MyCha r.UID, 20, Splitter));
My Packet is:
public byte String(long CharId, byte Type, string name)