Play sound via Packet Send?? [Question String Packet]

07/13/2010 19:19 ~Yuki~#1
Yow im trying to figure out why i cant play music with the string packet


What im doin is;

PHP Code:
MyChar.Client.SendPacket(Game.Packet.String(MyChar.UID20Splitter[1])); 
My Packet is:

PHP Code:
public byte[] String(long CharIdbyte Typestring name)
        {
            
ushort PacketType 1015;
            
byte[] Packet = new byte[13 name.Length];

            
fixed (bytePacket)
            {
                *((
ushort*)p) = (ushort)Packet.Length;
                *((
ushort*)(2)) = (ushort)PacketType;
                *((
uint*)(4)) = (uint)CharId;

                *(
8) = Type;
                *(
9) = 1;
                *(
10) = (byte)name.Length;

                for (
int i 0name.Lengthi++)
                {
                    *(
11 i) = Convert.ToByte(name[i]);
                }
            }

            return 
Packet;
        } 
Suggestions?
07/13/2010 19:42 CptSky#2
[Only registered and activated users can see links. Click Here To Register...]

Also, you can make something like this.
Code:
        public byte[] SoundPacket(uint CharId, string File) 
        { 
            ushort PacketType = 1015; 
            byte[] Packet = new byte[15 + File.Length]; 

            fixed (byte* p = Packet) 
            { 
                *((ushort*)p) = (ushort)Packet.Length; 
                *((ushort*)(p + 2)) = (ushort)PacketType; 
                *((uint*)(p + 4)) = (uint)CharId; 
                *(p + 8) = 20; //Sound 
                *(p + 9) = 2; 
                *(p + 10) = (byte)File.Length; 
                for (byte i = 0; i < File.Length; i++) 
                    *(p + 11 + i) = (byte)File[i]; 
                *(p + 11 + File.Length) = (byte)1; 
                *(p + 12 + File.Length) = (byte)'1'; 
            } 
            return Packet; 
        }
07/13/2010 19:55 ~Yuki~#3
damn. how to send a packet with 2 strings 0.o
07/14/2010 00:31 Korvacs#4
Did you search before doing this? I remember going to lengths explaining it, its also already in the cofuture source.
07/14/2010 01:36 ~Yuki~#5
Im sorry korfags next time im going to download every released source to check if thers is a piece of code wich i could use :) thanks
07/14/2010 09:27 Korvacs#6
Quote:
Originally Posted by ~Yuki~ View Post
Im sorry korfags next time im going to download every released source to check if thers is a piece of code wich i could use :) thanks
Well if you had searched you would have known that.

Second result on the search was:

[Only registered and activated users can see links. Click Here To Register...]

Third result:

[Only registered and activated users can see links. Click Here To Register...]

Fourth:

[Only registered and activated users can see links. Click Here To Register...]

In that fourth one you even state yourself that the source you need to look at is the cofuture reloaded source. So it seems youve already got it.

Closed.