Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 02:22

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

Advertisement



Trying with another packet (sound)

Discussion on Trying with another packet (sound) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Trying with another packet (sound)

Okay so I have this packet (in a command)
Code:
string[] Strings = new string[2];

                                            Strings[0] = (Data[1]);
                                            Strings[1] = "1";
                                            StringPacket SoundPacket = new StringPacket(true);
                                            SoundPacket.UID = client.Entity.UID;
                                            SoundPacket.Type = 20;
                                            SoundPacket.TextsCount = 2;
                                            SoundPacket.Texts.Add(Strings[0]);
                                            SoundPacket.Texts.Add(Strings[1]);
                                            client.Send(SoundPacket);
                                            break;
and I use the command
Quote:
@testsound sound\rain.wav
and it makes a slured sound for less then a second every time I do it, but any other sound like firstblood.wav it wont do anything. Help?

##Yes I did read the other sound packet threads but I'm terrible with packets full stop.
_DreadNought_ is offline  
Old 08/03/2010, 12:07   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
The first string should be:

Code:
sound/rain.mp3
Try that.
Korvacs is offline  
Old 08/03/2010, 13:42   #3
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Nope I tried changing the / to \ and a few other things but that didn't work either.
_DreadNought_ is offline  
Old 08/03/2010, 13:52   #4
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
as you see, he used .mp3, instead of .wav >_>
Basser is offline  
Old 08/03/2010, 19:28   #5
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Yeah nothing works. tried both, I did read his comment, Anybody know the prob?
_DreadNought_ is offline  
Old 08/03/2010, 20:26   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
I can only assume its an issue with your string packet.
Korvacs is offline  
Old 08/03/2010, 20:47   #7
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
String packet -
Code:
 using System;
using System.Collections.Generic;
using System.Text;

namespace Conquer_Online_Server.Network.GamePackets
{
    public class StringPacket : Writer, Interfaces.IPacket
    {
        public const byte GuildName = 3,
        Spouse = 6,
        Effect = 10,
        GuildList = 11,
        Unknown = 13,
        ViewEquipSpouse = 16,
        StartGamble = 17,
        EndGamble = 18,
        Sound = 20,
        GuildEnemies = 21,
        GuildAllies = 22,
        WhisperDetails = 26;

        byte[] Buffer;

        public StringPacket(bool Create)
        {
            if (Create)
            {
                Buffer = new byte[19];
                WriteUInt16(11, 0, Buffer);
                WriteUInt16(1015, 2, Buffer);
                Texts = new List<string>();
            }
        }
        public uint UID
        {
            get { return BitConverter.ToUInt32(Buffer, 4); }
            set { WriteUInt32(value, 4, Buffer); }
        }
        public byte Type
        {
            get { return Buffer[8]; }
            set { Buffer[8] = value; }
        }
        public byte TextsCount
        {
            get { return Buffer[9]; }
            set { Buffer[9] = value; }
        }
        public List<string> Texts;

        public void Send(Client.GameState client)
        {
            client.Send(Buffer);
        }
        public byte[] ToArray()
        {
            ushort entirelength = 19;
            foreach (string list in Texts)
                entirelength += (ushort)list.Length;
            byte[] buffer = new byte[entirelength];
            WriteUInt16((ushort)(entirelength - 8), 0, buffer);
            WriteUInt16(1015, 2, buffer);
            WriteUInt32(UID, 4, buffer);
            buffer[8] = Type;
            Buffer = buffer;
            WriteStringList(Texts, 9, Buffer);
            return Buffer;
        }
        public void Deserialize(byte[] buffer)
        {
            Buffer = buffer;
            Texts = new List<string>(buffer[9]);
            ushort offset = 10;
            byte count = 0;
            while (count != TextsCount)
            {
                ushort textlength = buffer[offset]; offset++;
                string text = Encoding.ASCII.GetString(buffer, offset, textlength); offset += textlength;
                Texts.Add(text);
                count++;
            }            
        }
    }
}
Looks fine to me.
_DreadNought_ is offline  
Reply


Similar Threads Similar Threads
[Release] CF German Sound Mod V 2.1 / Deutscher Sound mod 2.1
10/22/2010 - CrossFire Hacks, Bots, Cheats & Exploits - 13 Replies
Hey folks, As u saw in http://www.elitepvpers.com/forum/crossfire/394518-g erman-crossfire-sound-mod-deutscher-sound-mod.html i improved the sound modification. Now its supports: *male characters *female characters *the black market *the lobby sounds *the background music
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)
Sound Packet
05/07/2010 - CO2 Private Server - 7 Replies
Does anyone know the sound packet to play music on your client? Or a good packet logger so i can try and capture it.



All times are GMT +1. The time now is 02:22.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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