|
You last visited: Today at 21:49
Advertisement
Time packet
Discussion on Time packet within the CO2 Private Server forum part of the Conquer Online 2 category.
07/23/2018, 08:29
|
#1
|
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
|
Time packet
Does anyone know what's the problem with time packet on 5017?
Code:
public static Packet CreateServerTime(this Packet stream, DateTime Time)
{
stream.InitWriter();
stream.Write(0);//type //int
stream.Write(Time.Year - 1900);//int
stream.Write(Time.Month - 1);//int
stream.Write(Time.DayOfYear);//int
stream.Write(Time.Day);//int
stream.Write(Time.Hour);//int
stream.Write(Time.Minute);//int
stream.Write(Time.Second);//int
stream.Finalize((ushort)NetPacketTypes._MSG_ServerTime);
return stream;
}
5017 don't accept time packet?
|
|
|
07/23/2018, 19:42
|
#2
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Can you provide a hex dump of the finalized packet? Also, what happens when you explicitly cast those time values to 32-bit integers?
|
|
|
07/28/2018, 09:14
|
#3
|
elite*gold: 67
Join Date: Aug 2014
Posts: 1,321
Received Thanks: 927
|
Never got time working on 5017 either. Just posting here to get notified
|
|
|
07/28/2018, 19:52
|
#4
|
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
|
Quote:
Originally Posted by Xio.
Never got time working on 5017 either. Just posting here to get notified
|
I managed to fix time with a hook. I only posted here maybe someone knew a solution to save some time.
#Closed
|
|
|
07/28/2018, 20:08
|
#5
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Quote:
Originally Posted by teroareboss1
I managed to fix time with a hook. I only posted here maybe someone knew a solution to save some time.
#Closed
|
A hook? So you're saying that patch 5017 doesn't support the time packet? Also, that could be a helpful bit of code to post here rather than it dying off with the community. We've lost a lot of collected knowledge from developers just leaving and not documenting anything they've discovered. I could make a client hook snippets section of my wiki if you'd like to contribute.
|
|
|
07/28/2018, 20:38
|
#6
|
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
|
Quote:
Originally Posted by Spirited
A hook? So you're saying that patch 5017 doesn't support the time packet? Also, that could be a helpful bit of code to post here rather than it dying off with the community. We've lost a lot of collected knowledge from developers just leaving and not documenting anything they've discovered. I could make a client hook snippets section of my wiki if you'd like to contribute.
|
I dont know if is working or not but i remembered that they use sprintf for this string.
|
|
|
07/28/2018, 20:44
|
#7
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Quote:
Originally Posted by teroareboss1
I dont know if is working or not but i remembered that they use sprintf for this string.
|
Oh, I see how you did that now. No worries then. If you'd like to share the code, then great, but that one seems simple enough with a hint. Are you sure it doesn't support the time packet though? Do any other 5017 sources implement it maybe?
|
|
|
07/28/2018, 21:39
|
#8
|
elite*gold: 0
Join Date: Feb 2009
Posts: 259
Received Thanks: 159
|
Quote:
Originally Posted by Spirited
Oh, I see how you did that now. No worries then. If you'd like to share the code, then great, but that one seems simple enough with a hint. Are you sure it doesn't support the time packet though? Do any other 5017 sources implement it maybe?
|
I dont know if "Time packet" is working or not
Code:
char StrFormat[] = { "[%s] (%03d,%03d) Ping: %04d; Fps: %02d; Time: %02d:%02d, %s" };
Code:
int my_sprintf(char *buffer, char *format, ...)
{
va_list args;
va_start(args, format);
if(!strcmp(StrFormat,format))
{
/*char* ServerName = va_arg(args, PCHAR);
int x = va_arg(args, int);
int y = va_arg(args, int);
//TO DO
*/
}
return vsprintf(buffer, format, args);
}
hook msvcrt.dll , function-> sprintf
well.... you can compare just first 10 bytes...
|
|
|
07/28/2018, 22:22
|
#9
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Hm. That seems to be a bit of a naive approach, looking for a value rather than a key, but if it works then it works. I looked into other 5017 sources just to be sure that time packet (packet 1033) really isn't implemented anywhere, but I found one that does implement it:
Code:
DateTime Now = DateTime.Now.ToLocalTime();
byte[] buffer = new byte[36];
fixed (byte* Packet = buffer)
{
*((ushort*)(Packet)) = (ushort)(36);
*((ushort*)(Packet + 2)) = 1033;
*((uint*)(Packet + 8)) = (uint)(Now.Year - 1900);
*((uint*)(Packet + 12)) = (uint)(Now.Month - 1);
*((uint*)(Packet + 16)) = (uint)Now.DayOfYear;
*((uint*)(Packet + 20)) = (uint)Now.Day;
*((uint*)(Packet + 24)) = (uint)Now.Hour;
*((uint*)(Packet + 28)) = (uint)Now.Minute;
*((uint*)(Packet + 32)) = (uint)Now.Second;
}
return buffer;
Could be that the source incorrectly assumes the time packet exists on this patch.
|
|
|
07/28/2018, 22:48
|
#10
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
|
As far as I know, the client 5017 doesn't support the time packet.
|
|
|
|
Similar Threads
|
[Help] Weather Packet (My First Packet)
06/07/2014 - CO2 Private Server - 95 Replies
delete this thread.
|
Understanding the Packet System - Basics of a Packet explained
11/03/2012 - Cabal Online - 30 Replies
Read the advice first...
*****************UPDATED 12/11/2011*********************************
**** ADDED VB6 PROXY BOT SOURCE-CODE, WORKING EXAMPLE OF PROXY BOT******
************************************************* *****************
The following CONSTANTS have been flagged, this means they appear in EVERY Packet exchange from client to server and server to client
Red = Packet Id - Each packet has a unique ID number, in this case AA02, Each Packet id Relates to a specific...
|
[Request] Packet Structure for CharData Packet
05/16/2011 - Silkroad Online - 4 Replies
can someone tell me which structure the CharData packet has? i would really appreciate this, since im still noob in such things. its just too high for me/ too much information for my head. :handsdown:
S->C(3013)...
|
[Question] Packet data , packet editing ??
10/13/2009 - 9Dragons - 2 Replies
I would like to know :
What is packet data?
How do i get the address for hacking a item in game?
How to use it ??
|
All times are GMT +2. The time now is 21:49.
|
|