|
You last visited: Today at 02:22
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.
08/03/2010, 11:37
|
#1
|
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.
|
|
|
08/03/2010, 12:07
|
#2
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
The first string should be:
Try that.
|
|
|
08/03/2010, 13:42
|
#3
|
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.
|
|
|
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 >_>
|
|
|
08/03/2010, 19:28
|
#5
|
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?
|
|
|
08/03/2010, 20:26
|
#6
|
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.
|
|
|
08/03/2010, 20:47
|
#7
|
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.
|
|
|
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.
|
|