Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 06:19

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

Advertisement



[Release] Coupled Interactions (Correct)

Discussion on [Release] Coupled Interactions (Correct) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
[Release] Coupled Interactions (Correct)

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:



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
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:
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
}
}
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:
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
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
Spirited is offline  
Thanks
6 Users
Old 04/19/2013, 01:03   #2
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 67
i like how it have notes all the places lol, well done.
LordGragen. is offline  
Old 04/26/2013, 00:54   #3
 
Arco.'s Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
Stellar release, fantastical job
Arco. is offline  
Thanks
1 User
Old 04/26/2013, 19:50   #4
 
Yupmoh's Avatar
 
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 284
Thanks for sharing
Yupmoh is offline  
Old 04/27/2013, 06:50   #5
 
elite*gold: 0
Join Date: Nov 2010
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by Fаng View Post
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:



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
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 (from my ):
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
    }
}
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:
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
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
Hi sir,. can u help me about my PS, my problem is my site is free and when there is someone to register is not connected. can u help about this ,. to connect to my database so they can play. Thank you
laydz12 is offline  
Old 04/28/2013, 02:30   #6
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,977
I'd suggest for you to ask this in a separate thread as this thread has absolutely nothing to do with your question
JohnHeatz is offline  
Old 11/06/2017, 01:23   #7
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Restored. Sorry I took this down a few years back.
Spirited is offline  
Reply


Similar Threads Similar Threads
[Release] Full Interactions
10/01/2011 - CO2 PServer Guides & Releases - 14 Replies
Holding hands packet: namespace Kibou.Connections.Packets { using System; public unsafe class HoldingHands { public byte Buffer; public HoldingHands(byte direction, byte speed)
[Release] Interactions 5165
06/12/2010 - CO2 PServer Guides & Releases - 17 Replies
#Removed



All times are GMT +2. The time now is 06:19.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.