|
You last visited: Today at 07:46
Advertisement
Nobility Impulse 5165
Discussion on Nobility Impulse 5165 within the CO2 Private Server forum part of the Conquer Online 2 category.
09/01/2012, 07:25
|
#1
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Nobility Impulse 5165
I started working on Impulse 5165, first thing I did was to add Nobility, but the icon won't appear in the screen. The table was loaded, and I'm calling ( don't know, what term shall I use -.-) the nobility during log in. What I am missing?
Does the Nobility on higher version work on 5165?
Edit: I was checking on my previous threads, and I have decided to update it to remind myself of what I accomplished 2 years ago. I have fixed the Nobility, it was just an offset that needed to be corrected.
|
|
|
09/01/2012, 07:30
|
#2
|
elite*gold: 0
Join Date: Sep 2012
Posts: 69
Received Thanks: 7
|
Quote:
|
Does the Nobility on higher version work on 5165?
|
No,don't try it might crash your source
Did u add Nobility.dat.svn-base
|
|
|
09/01/2012, 07:52
|
#3
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Quote:
Originally Posted by EpicNinjaKick
No,don't try it might crash your source
Did u add Nobility.dat.svn-base
|
Nobility.dat.svn-base? Pardon me, what is that?
|
|
|
09/01/2012, 22:26
|
#4
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
The nobility icon did not appear because you didn't send the packet you should have.
Basic knowledge
There are specific packets and specific data sets (structs) for each feature that the client can handle.
For nobility the packet id is 2064 and an example of struct for nobility is:
Code:
public class NobilityInformation
{
public string Name;
public uint EntityUID;
public uint Mesh;
public ulong Donation;
public byte Gender;
public int Position;
public NobilityRank Rank;
}
Whereas NobilityRank is:
Code:
public enum NobilityRank : byte
{
Serf = 0,
Knight = 1,
Baron = 3,
Earl = 5,
Duke = 7,
Prince = 9,
King = 12
}
NB: There are lots of sources nowadays that have nobility added including the leaked trinity source for version 5335. You can get it from there.
Packet (for Impulse(and/or Trinity) like sources)
Code:
public class NobilityInfo : Writer, Interfaces.IPacket
{
public const uint
Donate = 1,
List = 2,
Icon = 3,
NextRank = 4;
byte[] Buffer;
public NobilityInfo(bool Create)
{
if (Create)
{
Buffer = new byte[33 + 8];
WriteUInt16(33, 0, Buffer);
WriteUInt16(2064, 2, Buffer);
}
Strings = new List<string>();
}
public uint Type
{
get { return BitConverter.ToUInt32(Buffer, 4); }
set { WriteUInt32(value, 4, Buffer); }
}
public uint dwParam
{
get { return BitConverter.ToUInt32(Buffer, 8); }
set { WriteUInt32(value, 8, Buffer); }
}
public ulong qwParam
{
get { return BitConverter.ToUInt64(Buffer, 8); }
set { WriteUInt64(value, 8, Buffer); }
}
public ushort wParam1
{
get { return BitConverter.ToUInt16(Buffer, 8); }
set { WriteUInt16(value, 8, Buffer); }
}
public ushort wParam2
{
get { return BitConverter.ToUInt16(Buffer, 10); }
set { WriteUInt16(value, 10, Buffer); }
}
public uint dwParam2
{
get { return BitConverter.ToUInt32(Buffer, 16); }
set { WriteUInt32(value, 16, Buffer); }
}
public uint dwParam3
{
get { return BitConverter.ToUInt32(Buffer, 20); }
set { WriteUInt32(value, 20, Buffer); }
}
public uint dwParam4
{
get { return BitConverter.ToUInt32(Buffer, 24); }
set { WriteUInt32(value, 24, Buffer); }
}
public byte StringCount
{
get { return Buffer[32]; }
set { Buffer[32] = value; }
}
public List<string> DecodedStrings
{
get
{
List<string> list = new List<string>(StringCount);
int offset = 33;
for (int count = 0; count < StringCount; count++)
{
byte stringLength = Buffer[offset]; offset++;
string String = Encoding.Default.GetString(Buffer, offset, stringLength);
offset += stringLength;
list.Add(String);
}
return list;
}
}
public List<string> Strings;
public void UpdateString(Game.ConquerStructures.NobilityInformation info)
{
string buildString = info.EntityUID + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;
buildString = (char)buildString.Length + buildString;
Strings.Add(buildString);
}
public void ListString(Game.ConquerStructures.NobilityInformation info)
{
string buildString = info.EntityUID + " " + info.Gender + " 0 " + info.Name + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;
buildString = (char)buildString.Length + buildString;
Strings.Add(buildString);
}
public void Send(Client.GameClient client)
{
client.Send(ToArray());
}
public byte[] ToArray()
{
if (Strings.Count == 0)
return Buffer;
string theString = "";
for (int count = 0; count < Strings.Count; count++)
{
theString += Strings[count];
}
byte[] newBuffer = new byte[33 + 8 + theString.Length];
Buffer.CopyTo(newBuffer, 0);
WriteUInt16((ushort)(newBuffer.Length - 8), 0, newBuffer);
newBuffer[32] = (byte)Strings.Count;
WriteString(theString, 33, newBuffer);
return newBuffer;
}
public void Deserialize(byte[] buffer)
{
Buffer = buffer;
}
}
Pseudo-tutorial
First you have to add the packet and the specific data set into the source.
Considering this step is finished, you have to make database entries(a table for the data set) to store information for each character.
Once that is done (including save/load) you go on and send the icon in the body of the 'LoginMessages' function that can be found in PacketHandler.cs.
Code:
NobilityInfo update = new NobilityInfo(true);
update.Type = NobilityInfo.Icon;
update.dwParam = client.NobilityInformation.EntityUID;
update.UpdateString(client.NobilityInformation);
client.Send(update);
Whereas client.NobilityInformation is a variable of the specific data set named 'NobilityInformation'.
The rest will be a lot harder, but that's all I am willing to write about.
As of 'Nobility.dat.svn-base', nevermind that. It wouldn't work for a source that didn't use a SVN software while it was developed.
Regards.
|
|
|
09/02/2012, 15:24
|
#5
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Quote:
Originally Posted by -impulse-
The nobility icon did not appear because you didn't send the packet you should have.
Basic knowledge
There are specific packets and specific data sets (structs) for each feature that the client can handle.
For nobility the packet id is 2064 and an example of struct for nobility is:
Code:
public class NobilityInformation
{
public string Name;
public uint EntityUID;
public uint Mesh;
public ulong Donation;
public byte Gender;
public int Position;
public NobilityRank Rank;
}
Whereas NobilityRank is:
Code:
public enum NobilityRank : byte
{
Serf = 0,
Knight = 1,
Baron = 3,
Earl = 5,
Duke = 7,
Prince = 9,
King = 12
}
NB: There are lots of sources nowadays that have nobility added including the leaked trinity source for version 5335. You can get it from there.
Packet (for Impulse(and/or Trinity) like sources)
Code:
public class NobilityInfo : Writer, Interfaces.IPacket
{
public const uint
Donate = 1,
List = 2,
Icon = 3,
NextRank = 4;
byte[] Buffer;
public NobilityInfo(bool Create)
{
if (Create)
{
Buffer = new byte[33 + 8];
WriteUInt16(33, 0, Buffer);
WriteUInt16(2064, 2, Buffer);
}
Strings = new List<string>();
}
public uint Type
{
get { return BitConverter.ToUInt32(Buffer, 4); }
set { WriteUInt32(value, 4, Buffer); }
}
public uint dwParam
{
get { return BitConverter.ToUInt32(Buffer, 8); }
set { WriteUInt32(value, 8, Buffer); }
}
public ulong qwParam
{
get { return BitConverter.ToUInt64(Buffer, 8); }
set { WriteUInt64(value, 8, Buffer); }
}
public ushort wParam1
{
get { return BitConverter.ToUInt16(Buffer, 8); }
set { WriteUInt16(value, 8, Buffer); }
}
public ushort wParam2
{
get { return BitConverter.ToUInt16(Buffer, 10); }
set { WriteUInt16(value, 10, Buffer); }
}
public uint dwParam2
{
get { return BitConverter.ToUInt32(Buffer, 16); }
set { WriteUInt32(value, 16, Buffer); }
}
public uint dwParam3
{
get { return BitConverter.ToUInt32(Buffer, 20); }
set { WriteUInt32(value, 20, Buffer); }
}
public uint dwParam4
{
get { return BitConverter.ToUInt32(Buffer, 24); }
set { WriteUInt32(value, 24, Buffer); }
}
public byte StringCount
{
get { return Buffer[32]; }
set { Buffer[32] = value; }
}
public List<string> DecodedStrings
{
get
{
List<string> list = new List<string>(StringCount);
int offset = 33;
for (int count = 0; count < StringCount; count++)
{
byte stringLength = Buffer[offset]; offset++;
string String = Encoding.Default.GetString(Buffer, offset, stringLength);
offset += stringLength;
list.Add(String);
}
return list;
}
}
public List<string> Strings;
public void UpdateString(Game.ConquerStructures.NobilityInformation info)
{
string buildString = info.EntityUID + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;
buildString = (char)buildString.Length + buildString;
Strings.Add(buildString);
}
public void ListString(Game.ConquerStructures.NobilityInformation info)
{
string buildString = info.EntityUID + " " + info.Gender + " 0 " + info.Name + " " + info.Donation + " " + (byte)info.Rank + " " + info.Position;
buildString = (char)buildString.Length + buildString;
Strings.Add(buildString);
}
public void Send(Client.GameClient client)
{
client.Send(ToArray());
}
public byte[] ToArray()
{
if (Strings.Count == 0)
return Buffer;
string theString = "";
for (int count = 0; count < Strings.Count; count++)
{
theString += Strings[count];
}
byte[] newBuffer = new byte[33 + 8 + theString.Length];
Buffer.CopyTo(newBuffer, 0);
WriteUInt16((ushort)(newBuffer.Length - 8), 0, newBuffer);
newBuffer[32] = (byte)Strings.Count;
WriteString(theString, 33, newBuffer);
return newBuffer;
}
public void Deserialize(byte[] buffer)
{
Buffer = buffer;
}
}
Pseudo-tutorial
First you have to add the packet and the specific data set into the source.
Considering this step is finished, you have to make database entries(a table for the data set) to store information for each character.
Once that is done (including save/load) you go on and send the icon in the body of the 'LoginMessages' function that can be found in PacketHandler.cs.
Code:
NobilityInfo update = new NobilityInfo(true);
update.Type = NobilityInfo.Icon;
update.dwParam = client.NobilityInformation.EntityUID;
update.UpdateString(client.NobilityInformation);
client.Send(update);
Whereas client.NobilityInformation is a variable of the specific data set named 'NobilityInformation'.
The rest will be a lot harder, but that's all I am willing to write about.
As of 'Nobility.dat.svn-base', nevermind that. It wouldn't work for a source that didn't use a SVN software while it was developed.
Regards.
|
Glad to hear them from the maker of the source, but I am using the one used in other leaked sources of yours, and it didn't seem to work.
|
|
|
09/02/2012, 17:33
|
#6
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
Impulse... StringBuilder
|
|
|
09/02/2012, 18:53
|
#7
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Quote:
Originally Posted by I don't have a username
Impulse... StringBuilder 
|
The difference could be close to nothing in this case. Anyway, somethings are just not meant to be built with StringBuilder... (not really, but eh, w/e).
|
|
|
09/03/2012, 10:13
|
#8
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
The small difference are important when working on client/server stuff.
|
|
|
09/07/2012, 18:53
|
#9
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
#Bump...
Its kinda weird why the Nobility Icon won't show up in the screen.
Character 1 [Donater]
Character 2 [Observer]
ICON
Since, the icon is not visible I manually added Character1 on the nobility.
|
|
|
09/07/2012, 23:48
|
#10
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
My quick response to you is: the observer can see the nobility because it's part of another packet.
Question: You said my code didn't quite work. Exactly what did you mean by that? How much effort did you actually put in?
Do this: create a file (if doesn't already exist) and put the packet in it (Solution explorer\Conquer_Online_Server\Network\GamePackets \).
Then, send the basic stuff (already showed you how to create the icon packet).
Let me know what doesn't work right.
|
|
|
09/08/2012, 18:02
|
#11
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
at Conquer_Online_Server.Network.PacketHandler.LoginMessagers<GameState client> in
E:\..........Conquer_Online_Server\Network\PacketHandler.cs:line 3594
at Conquer_Online_Server.Network.PacketHandler.SetLocation<GeneralData generalData, GameState client>
in E:\......PacketHandler.cs:line 3529
at Conquer_Online_Server\Network.PacketHandler.HandlePacket<Byte[] packet, GameState client>
in E:\.........PacketHandler.cs:line 131
Where line 3594 is:
update.dwParam = client.NobilityInformation.EntityUID;
line 3529 is:
line 131 is:
SetLocation(gData, client);
|
|
|
09/09/2012, 11:21
|
#12
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Quote:
before that line do this:
client.NobilityInformation = new NobilityInformation();
client.NobilityInformation.Name = client.Entity.Name;
client.NobilityInformation.EntityUID = client.Entity.UID;
client.NobilityInformation.Mesh = client.Entity.Mesh;
It will work afterwards. That is because you don't load any info for nobility yet.
|
|
|
09/09/2012, 15:29
|
#13
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Still, the icon is not showing in the screen. And I checked if its client side but the texture for the icon is there.
Does my concern has something to do with the CharacterInfo too?
|
|
|
09/11/2012, 07:08
|
#14
|
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
|
#Bump
it has to do with spawnpacket?
|
|
|
09/11/2012, 12:12
|
#15
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
No, it does not.
If you send the packet it should show the icon. :S
|
|
|
 |
|
Similar Threads
|
Help with Impulse's 5165
03/09/2013 - CO2 Private Server - 8 Replies
I've looked at the database, looked through the code, looked at code that wasn't even relevant to the error and I still cannot find the error to the following, I just don't understand it. (Wow, what it be real easy...)
Error Message:
Load the character stats.
System.NullReferenceException: Object reference not set to an instance of an object.
at Conquer_Online_Server.Program.Main<String args> in D:\Conquer\impluse 5165\Conquer_Online_Server\Program.cs:line46
Line 40-51 in...
|
[Request]Impulse's 5165 Source
03/09/2013 - CO2 Private Server - 28 Replies
Well considering megaupload is down, i am having issues finding this source, if anyone would mind providing it that would be great, figured if I am going to start getting into C# (Conquer Online Coding) again id like to start with some of the basics.
|
Guilds impulse source(5165)
05/24/2012 - CO2 Private Server - 0 Replies
Hey everyone.
well maybe u will see this thread and will think "wtf is this guy doing!", but this is the first time i try to structure a packet.
I'm trying to see a guild's status window, but i know i'm missing something but don't know what :c
this is the packet
using System;
|
CoolEffect 5165 (impulse)
05/21/2012 - CO2 PServer Guides & Releases - 5 Replies
emmm yes, this a noob release i know, but i'm starting to "work" in this source and i want to share somethings including when they are easy to do, so maybe u can help me to improve the code and improve my skills at coding :p
look for this in entity.cs
public Enums.ConquerAction Action
under the set statment (i dk how to call it :c)
HandleCoolEffect((Enums.ConquerAction)SpawnPacket );
|
[Release] Few commands ( Impulse's 5165 )
06/18/2010 - CO2 PServer Guides & Releases - 8 Replies
Here's a few commands...
In console you can't type @restart to restart so add this at <Program.cs under
public static void CommandsAI(string command)
{
try
{
string data = command.Split(' ');
switch (data)
|
All times are GMT +1. The time now is 07:48.
|
|