Hey everyone,
Before I release anything, I wanted to bring this to everyone's attention. I strongly believe that developers should work together on researching into the conquer online client. If we shared more information, we might see better and more creative servers (which I strongly support).
Alright. So in this release, I'll be publishing the research required for programming coupled interactions. I've posted something similar before, and I'd like to correct myself on a few things (I have found the correct methods for displaying interactions, allowing for a smoother gameplay experience). If you're not sure which feature I'm referring to, here's a picture of it working in my project:
[Only registered and activated users can see links. Click Here To Register...]
First, here is a list of the subtypes of the interaction packet (1022) required for interactions. They range from 46 to 50.
Here is a list of action types that I mentioned above. The action types encapsulate possible actions that a character can perform. These include the couple interaction types.
The last thing required to make couple interactions work is the couple movement packet. This controls the movements of couples while holding hands. This packet is sent in placement of the movement packet (10005). Be careful when assigning actions to the characters' data. The action of the character should remain HOLD_HANDS at all times while holding hands. Here is the packet structure for couple movements:
There are other interactions as well that you could program (that were deleted in patch 5127). If you're running a server that is before the monks expansion, you will be able to add the following code to the GUI.ini file (for high resolution clients), and re-add those interactions:
That is all I have for now. The rest is up to you. Don't forget about changing directions while holding hands, checking against changing directions while performing any other kind of interaction, and ending interactions for disconnecting clients. Good luck with your server.
Cheers,
Spirited Fang
Before I release anything, I wanted to bring this to everyone's attention. I strongly believe that developers should work together on researching into the conquer online client. If we shared more information, we might see better and more creative servers (which I strongly support).
Alright. So in this release, I'll be publishing the research required for programming coupled interactions. I've posted something similar before, and I'd like to correct myself on a few things (I have found the correct methods for displaying interactions, allowing for a smoother gameplay experience). If you're not sure which feature I'm referring to, here's a picture of it working in my project:
[Only registered and activated users can see links. Click Here To Register...]
First, here is a list of the subtypes of the interaction packet (1022) required for interactions. They range from 46 to 50.
- 46 - Request Couple Interaction: Find the targeted player in the client pool and send the unchanged interaction packet to that client. Create a request on the server (if you wish to, to prevent spamming).
- 47 - Accept Couple Interaction: Accept the interaction. If the request exists (if you're doing antispam checks), send the unchanged interaction to the sender and back to the client processing the packet.
- 48 - Reject Couple Interaction: Find the sender of the packet and send the unchanged packet back to the sender, confirming the rejection.
- 49 - Start Couple Interaction: Accept the request (if you're doing antispam checks), change the characters' actions to the interaction type (listed below), change their directions to 0, and send the interaction to the observers in the screens (as well as the couple). Create structures to control the interaction if you wish so others cannot request interactions while the couple is interacting.
- 50 - Stop Couple Interaction: Clear the structures, set the couple's actions back to the Stand action, and send the packet to the couple and the observers in the couple's screens.
Here is a list of action types that I mentioned above. The action types encapsulate possible actions that a character can perform. These include the couple interaction types.
Code:
DANCE = 1, STAND = 100, HAPPY = 150, ANGRY = 160, SAD = 170, WAVE = 190, BOW = 200, KNEEL = 210, COOL = 230, SIT = 250, LIE = 270, KISS = 100003, HOLD_HANDS = 100004, HUG = 100005
Code:
namespace Kibou.Networking.Packets
{
using System.Runtime.InteropServices;
/// <summary>
/// Packet Identifier: 1114 / 0x45A - This packet structure encapsulates a couple's combined action while
/// performing an interaction. It manages the action for holding hands and showing coupled movements in the
/// client. This packet is used with the interaction packet (1022), which controls the start and termination
/// of actions that enable this packet, and the movement packet (10005), which is replaced by this packet
/// during processing.
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public unsafe struct HoldingHands : IPacketStructure
{
// Packet Structure:
public ushort Length; // 0 - The length of the packet.
public PacketType Identifier; // 2 - The packet type.
public HoldingHandsAction Action; // 4 - The type of action being performed while holding hands.
public ushort X; // 6 - The x-coordinate of the jump (only used for jumping).
public ushort Y; // 8 - The y-coordinate of the jump (only used for jumping).
private fixed byte _spacer[2]; // 10 - Unknown Space
public int Amount; // 12 - The amount of people involved with the action.
public int Identity; // 16 - The identity of the player controlling the action.
public int Target; // 20 - The identity of the target player (holding hands with).
private fixed byte _stamp[8]; // TQ Digital's End of Packet Stamp
// Access methods for walking:
public byte Direction
{
get { return (byte)X; }
set { X = (ushort)((Speed << 8) | value); }
}
public byte Speed
{
get { return (byte)(X >> 8); }
set { X = (ushort)((value << 8) | Direction); }
}
/// <summary>
/// Packet Identifier: 1114 / 0x45A - This packet structure encapsulates a couple's combined action while
/// performing an interaction. It manages the action for holding hands and showing coupled movements in the
/// client. This packet is used with the interaction packet (1022), which controls the start and termination
/// of actions that enable this packet, and the movement packet (10005), which is replaced by this packet
/// during processing.
/// </summary>
/// <param name="identity">The identity of the player controlling the action.</param>
/// <param name="target">The identity of the target player.</param>
/// <param name="x">The x-coordinate of the players.</param>
/// <param name="y">The y-coordinate of the players.</param>
public HoldingHands(int identity, int target, ushort x, ushort y)
{
Length = (ushort)(sizeof(HoldingHands) - 8);
Identifier = PacketType.COUPLE_MOVEMENT;
Action = HoldingHandsAction.JUMP_WHILE_HOLDING_HANDS;
X = x;
Y = y;
Amount = 2;
Identity = identity;
Target = target;
}
/// <summary>
/// Packet Identifier: 1114 / 0x45A - This packet structure encapsulates a character's action while performing
/// an interaction with another person. It manages the action for holding hands and showing it in the clients.
/// This packet is used with the interaction packet (1022), which controls the start and termination of actions
/// that use this packet.
/// </summary>
/// <param name="direction">The direction of the players holding hands.</param>
/// <param name="identity">The identity of the player controlling the action.</param>
/// <param name="target">The identity of the target player.</param>
public HoldingHands(byte direction, byte speed, int identity, int target)
{
Length = (ushort)(sizeof(HoldingHands) - 8);
Identifier = PacketType.COUPLE_MOVEMENT;
Action = HoldingHandsAction.WALK_WHILE_HOLDING_HANDS;
X = Y = 0;
Amount = 2;
Identity = identity;
Target = target;
Direction = direction;
Speed = speed;
}
/// <summary>
/// This method builds the packet structure into a managed byte array for managed sending by the client's
/// server-response socket. It takes the address of the current class and uses it to construct the encrypted
/// array.
/// </summary>
/// <param name="cipher">The cipher being used to encrypt the packet.</param>
public unsafe byte[] Build(ICipher cipher)
{
HoldingHands packetStruct = this;
return cipher.Encrypt((byte*)&packetStruct, sizeof(HoldingHands));
}
}
/// <summary> This enumerated type defines the types of interactions that can be executed by the client. </summary>
public enum HoldingHandsAction : ushort
{
WALK_WHILE_HOLDING_HANDS = 1,
JUMP_WHILE_HOLDING_HANDS = 2
}
}
Code:
// ;ÌðÃÛÖ�ÎÇ [360-2432] x=15 y=0 w=100 h=30 // ;ÊÀ�ÍÖ�ÎÇ [360-2433] x=130 y=0 w=100 h=30 // ;Çå�¿Ö�ÎÇ [360-2434] x=15 y=30 w=100 h=30 // ;¿ñÒ�Ö�ÎÇ [360-2435] x=130 y=30 w=100 h=30 // ;Ç�ÊÖ [360-2436] x=15 y=60 w=100 h=30 // ;Ó��� [360-2437] x=130 y=60 w=100 h=30 // ;Ï�Ó��øÐÐ [360-2438] x=15 y=90 w=100 h=30 // ;É�Çø����É�Ç�È�ÈÏ¿ò [0-361] x=220 y=300 h=180 w=250 // ;É�Ç�ÈË [361-2433] x=20 y=20 w=50 h=30 // ;É�Ç�ÄÍ�Æ� [361-2434] x=70 y=50 w=110 h=60 // ;�ÄÇ�Çó [361-2435] x=110 y=115 w=70 h=20 // ;Í�Ò� [361-1668] x=50 y=150 w=62 h=20 // ;�Ü�ø [361-1669] x=130 y=150 w=62 h=20
Cheers,
Spirited Fang