|
You last visited: Today at 10:31
Advertisement
Jumping Problem
Discussion on Jumping Problem within the CO2 Private Server forum part of the Conquer Online 2 category.
09/11/2010, 22:53
|
#16
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
|
The client send a jump packet...
Data + TQClient
You process the jump packet...
Data + TQClient
You broadcast the jump packet...
Data + TQClient (+ TQServer)
Make sure that all out-going packets don't have two seals and have the right one. A good solution is to add TQServer before sending the data and to remove TQClient before processing the data.
|
|
|
09/12/2010, 00:05
|
#17
|
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 140
|
.Arco
The problem is not in the packet processing of jumping. The problem most likely lies in your packet itself. Check the packets to be sure there correct.
|
|
|
09/12/2010, 10:04
|
#18
|
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
|
Lets see your GetDistance function and your jump packet.
|
|
|
09/12/2010, 12:04
|
#19
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Put a breakpoint in at the beginning of the Jump handler and step through untill the client bombs out. Which method does it crash on? Let us know.
|
|
|
09/12/2010, 16:34
|
#20
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
See that's the thing though Jack, I can't find out where the client bombs cause it gets through the entire jump handler without any exception, it just dcs at the end.
@Ian
Code:
public static short GetDistance(ushort X, ushort Y, ushort X2, ushort Y2)
{
return (short)Math.Max(Math.Abs(X - X2), Math.Abs(Y - Y2));
}
|
|
|
09/12/2010, 16:38
|
#21
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
In that case, are you modifying the TQString at the end of the packets? That appears to be the only cause in that case.
|
|
|
09/12/2010, 16:40
|
#22
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Well if I wasn't sending the TQString, then wouldn't ALL mypackets be invalid? o.O
|
|
|
09/12/2010, 16:44
|
#23
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Quote:
Originally Posted by .Arco
Well if I wasn't sending the TQString, then wouldn't ALL mypackets be invalid? o.O
|
Yes, however the packets your sending this time are existing ones that require modifying not new ones.
I havent seen your send method so i cant know can i
|
|
|
09/12/2010, 16:54
|
#24
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
My method for sending packets?
Well here you go.
Code:
public void Send(IClassPacket Packet)
{
lock (this)
{
this.Socket.Send(Packet.Serialize());
}
}
public void Send(byte[] Packet)
{
lock (this)
{
this.Socket.Send(Packet);
}
}
}
public interface IClassPacket
{
void Deserialize(byte[] Bytes);
byte[] Serialize();
}
|
|
|
09/12/2010, 16:56
|
#25
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Whats your Serialize() Method for the General Data packet?
Edit:
In fact whats this method aswell SendScreen()
|
|
|
09/12/2010, 17:01
|
#26
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Korvacs
Whats your Serialize() Method for the General Data packet?
Edit:
In fact whats this method aswell SendScreen()
|
I'll just give you my entire gendata packet.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
using OpenSSL;
namespace Arco_Online
{
public class DataPacket : IClassPacket
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct PacketHeader
{
public ushort Length;
public ushort Type;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct GeneralData
{
public PacketHeader Header;
public uint TimeStamp;
public uint UniqueID;
public uint Param;
public ushort PosX;
public ushort PosY;
public ushort Direction;
public ushort Action;
}
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
public static extern unsafe void* memcpy(void* dest, void* src, int count);
public const ushort
SetLocation = 74,
Hotkeys = 75,
ConfirmFriends = 76,
ConfirmProfincies = 77,
ConfirmSpells = 78,
ChangeDirection = 79,
ChangeAction = 81,
Portal = 86,
EndXpList = 93,
Revive = 94,
ChangePkMode = 96,
ConfirmGuild = 97,
BEGIN_MINE = 99,
EntitySpawn = 102,
CompleteMapChange = 104,
CorrectCords = 108,
Shop = 111,
OpenShop = 113,
GetSurroundings = 114,
RemoteCommands = 116,
PickupCashEffect = 121,
Dialog = 126,
GuardJump = 129,
CompleteLogin = 130,
RemoveEntity = 132,
Jump = 133,
RemoveWeaponMesh = 135,
RemoveWeaponMesh2 = 136,
Avatar = 132;
private GeneralData RealPacket;
public DataPacket(bool CreateInstance)
{
this.RealPacket = new GeneralData();
if (CreateInstance)
{
this.RealPacket.Header.Length = (ushort)Marshal.SizeOf(this.RealPacket);
this.RealPacket.Header.Type = 1010;
this.TimeStamp = (uint)Environment.TickCount;
}
}
public unsafe void Deserialize(byte[] Bytes)
{
fixed (byte* pckt = Bytes)
{
fixed (GeneralData* rlPacket = &this.RealPacket)
{
memcpy(rlPacket, pckt, Bytes.Length);
}
}
}
public unsafe byte[] Serialize()
{
byte[] Packet = new byte[Marshal.SizeOf(this.RealPacket)];
fixed (byte* pckt = Packet)
{
fixed (GeneralData* rlPacket = &this.RealPacket)
{
memcpy(pckt, rlPacket, Marshal.SizeOf(this.RealPacket));
}
}
return Packet;
}
public uint dwParam
{
get
{
return this.RealPacket.Param;
}
set
{
this.RealPacket.Param = value;
}
}
public uint TimeStamp
{
get
{
return this.RealPacket.TimeStamp;
}
set
{
this.RealPacket.TimeStamp = value;
}
}
public uint UID
{
get
{
return this.RealPacket.UniqueID;
}
set
{
this.RealPacket.UniqueID = value;
}
}
public ushort wParam1
{
get
{
return this.RealPacket.PosX;
}
set
{
this.RealPacket.PosX = value;
}
}
public ushort wParam2
{
get
{
return this.RealPacket.PosY;
}
set
{
this.RealPacket.PosY = value;
}
}
public ushort wParam3
{
get
{
return this.RealPacket.Action;
}
set
{
this.RealPacket.Action = value;
}
}
public ushort wParam4
{
get
{
return this.RealPacket.Direction;
}
set
{
this.RealPacket.Direction = value;
}
}
}
}
Code:
public void SendScreen(IClassPacket CMsg, bool SendSelf)
{
SendScreen(CMsg.Serialize(), SendSelf);
}
|
|
|
09/12/2010, 17:05
|
#27
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
Yeah, so you never modify the TQstring at the end of the packet, so the client sends the packet with TQClient, and you send it back without changing it to TQServer, so the client receives an invalid packet and disconnects.
Atleast thats what it looks like from here, unless its somewhere in this.RealPacket.
|
|
|
09/12/2010, 17:07
|
#28
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Ah thanks Jack, I've never really messed with the TQSeal before, soexactly how do I implement that into the packet?
|
|
|
09/12/2010, 17:10
|
#29
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
|
You write an additional 8 bytes onto the end of the packet without modifying the length, any packet sent from the server requires TQServer, other than that you dont need to worry about it since its not a proxy.
Code:
public static byte[] TQServer = Encoding.ASCII.GetBytes("TQServer");
Dump that somewhere and memcpy onto the end of the packet everytime you send.
|
|
|
09/12/2010, 17:21
|
#30
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
So something like this.
Code:
public unsafe void Send(byte[] Packet)
{
lock (this)
{
fixed (byte* p = Packet)
for (int i = 0; i < 8; i++)
*(p + i + Packet.Length - 8) = (byte)PacketBuilder.TQServer;
this.Socket.Send(Packet);
}
}
|
|
|
|
|
Similar Threads
|
[Problem] Jumping and Walking being Viewed
08/04/2010 - CO2 Private Server - 2 Replies
Hey! I fixed Character Spawning...
but there's a problem with walking and jumping.
It does it right for the character running or walking; but when the walking action is being viewed, the viewed character is just standing there... but he's supposed to be walking and is walking.
Same with jump. They appear in the screen - not even in a half jump... and then they jump out to the top right no matter where you jump.
public static byte Walk(int Direction, int UID)
{
...
|
anyone has this problem? ms jumping very fast
11/05/2008 - Dekaron - 5 Replies
ok i was wondering if anyone has this problem. everything was working fine at the start. but after a few hours i started to have this problem. whenever i went into the game, the ms would keep increasing from 200 to 20000 and ill just dc. its impossible for me to trainn like this. even when i restart my computer and stuff, its still occuring. My internet connection has no problem so it should not be the cause.
Does anyone else face this problem too, and can anyone teach me how to fix this? help...
|
Jumping problem
01/19/2006 - Conquer Online 2 - 7 Replies
I get a jumping problem after reinstalling conquer last night. I used to jump my two legs togheter, but now, I jump like if i was walking in the air, the two legs moving and I also see other players jumping like that.Can anyone help me?(I also feel that im jumping slower this way)Thank you in advance for anyone who could help!
|
Jumping problem
12/08/2005 - Conquer Online 2 - 0 Replies
OK, here is what happened, after CO2 came out, too many errors and glitches happened, so I decided to redownload and reinstall the whole game all over again, after reinstalling, everything is fine, but once i logged into my tro, i realize it jumps totally different than it used to be. I have a small male tro. Before, it jumps with its leg close together, you guys should know what i mean. But now, it jumps like a small male tao, or a female tao, it jumps with its legs moving back and forth. The...
|
All times are GMT +2. The time now is 10:31.
|
|