|
You last visited: Today at 17:05
Advertisement
[Releaase] Packet Tutorial (general and SRO-specific)
Discussion on [Releaase] Packet Tutorial (general and SRO-specific) within the SRO Coding Corner forum part of the Silkroad Online category.
08/21/2012, 22:20
|
#16
|
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
|
I just wanted to mention, that your website is unreachable.
We are patient.
EDIT: While you're about rewriting the tuts, can you tell us some about using packets in C#? That would give some of us a real boost - me, for example.
|
|
|
08/21/2012, 23:25
|
#17
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by intercsaki
I just wanted to mention, that your website is unreachable.
We are patient.
|
I know that it's still offline. I've been trying to turn it on for hours. I blame Host1Free.
|
|
|
08/21/2012, 23:40
|
#18
|
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
|
I keep trying tomorrow. ^^
|
|
|
08/22/2012, 07:30
|
#19
|
elite*gold: 0
Join Date: Feb 2008
Posts: 284
Received Thanks: 90
|
attached rar with pictures for offline view. have fun
//removed by lesderid request
|
|
|
08/22/2012, 10:03
|
#20
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by evolution007
attached rar with pictures for offline view. have fun
|
Could you please remove them? "Though no rights were ever claimed, please do not distribute these pictures separately."
You can download them from my site, but I don't want people sharing them on forums.
The site is now online again, sorry for the inconvenience.
|
|
|
08/22/2012, 13:11
|
#21
|
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
|
Quote:
Originally Posted by intercsaki
I just wanted to mention, that your website is unreachable.
We are patient.
EDIT: While you're about rewriting the tuts, can you tell us some about using packets in C#? That would give some of us a real boost - me, for example. 
|
Well I could give you a few tips. The easiest way to write a packet in .net is with the BinaryWriter and BinaryReader class.
Code:
byte[] packet;
using (MemoryStream memoryStream = new MemoryStream())
{
using (BinaryWriter writer = new BinaryWriter(memoryStream))
{
writer.Write((short)1);
writer.Write((short)0x5000);
writer.Write((short)0);
writer.Write((byte)1);
}
packet = memoryStream.ToArray();
}
using (MemoryStream memoryStream = new MemoryStream(packet))
{
using (BinaryReader reader = new BinaryReader(memoryStream))
{
short dataSize = reader.ReadInt16();
short opcode = reader.ReadInt16();
short securityBytes = reader.ReadInt16();
byte flag = reader.ReadByte();
Console.WriteLine("Data in packet is: {0}", dataSize);
Console.WriteLine("Opcode is: {0:X4}", opcode);
Console.WriteLine("Security bytes are: {0}", securityBytes);
Console.WriteLine("Encryption flag: {0}", flag);
}
}
This is a very small and basic example of how to write and read packets in C#. The first piece of code with the BinaryWriter created a packet and the 2nd part reads the packet we just created.
Once you have written a packet you can send it to the client or server using a Socket. You use a byte array to send and receive packets.
|
|
|
08/23/2012, 11:22
|
#22
|
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
|
Quote:
Originally Posted by kevin_owner
Well I could give you a few tips. The easiest way to write a packet in .net is with the BinaryWriter and BinaryReader class.
Code:
byte[] packet;
using (MemoryStream memoryStream = new MemoryStream())
{
using (BinaryWriter writer = new BinaryWriter(memoryStream))
{
writer.Write((short)1);
writer.Write((short)0x5000);
writer.Write((short)0);
writer.Write((byte)1);
}
packet = memoryStream.ToArray();
}
using (MemoryStream memoryStream = new MemoryStream(packet))
{
using (BinaryReader reader = new BinaryReader(memoryStream))
{
short dataSize = reader.ReadInt16();
short opcode = reader.ReadInt16();
short securityBytes = reader.ReadInt16();
byte flag = reader.ReadByte();
Console.WriteLine("Data in packet is: {0}", dataSize);
Console.WriteLine("Opcode is: {0:X4}", opcode);
Console.WriteLine("Security bytes are: {0}", securityBytes);
Console.WriteLine("Encryption flag: {0}", flag);
}
}
This is a very small and basic example of how to write and read packets in C#. The first piece of code with the BinaryWriter created a packet and the 2nd part reads the packet we just created.
Once you have written a packet you can send it to the client or server using a Socket. You use a byte array to send and receive packets.
|
Wow.  Thanks. I save that for further examination. ;P Honestly, I'm not there (yet) to use these, I recently started to learn C# more comprhensively.  But I'm sure this will be handy.
|
|
|
08/23/2012, 17:45
|
#23
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by intercsaki
Wow.  Thanks. I save that for further examination. ;P Honestly, I'm not there (yet) to use these, I recently started to learn C# more comprhensively.  But I'm sure this will be handy. 
|
You should honestly just use Drew's SilkroadSecurityAPI instead of reinventing the wheel.
|
|
|
08/23/2012, 18:01
|
#24
|
elite*gold: 0
Join Date: Feb 2008
Posts: 284
Received Thanks: 90
|
Quote:
Originally Posted by lesderid
You should honestly just use Drew's SilkroadSecurityAPI instead of reinventing the wheel.
|
its quite hard to understand every part of program when you're newbie
|
|
|
08/23/2012, 20:03
|
#25
|
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
|
Quote:
Originally Posted by lesderid
You should honestly just use Drew's SilkroadSecurityAPI instead of reinventing the wheel.
|
Why though, I would know every single particle well. Which would help me in my future work.
After I gained enough experience (that sounds sro-ish), I'll concentrate on performance.
|
|
|
03/07/2013, 15:06
|
#26
|
elite*gold: 0
Join Date: Jan 2013
Posts: 2
Received Thanks: 0
|
Great tutorials
But please can you fix :
-Tutorial 03: Using Packets in C#
-Tutorial 04: Using a Database
|
|
|
03/07/2013, 17:47
|
#27
|
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
|
Quote:
Originally Posted by mohgabr
Great tutorials
But please can you fix :
-Tutorial 03: Using Packets in C#
-Tutorial 04: Using a Database
|
Read the first post.
|
|
|
03/08/2013, 00:01
|
#28
|
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
|
Hey, I didn't even know I was looking for this!
Thanks Fate!
|
|
|
 |
|
Similar Threads
|
[Poll] Packet/Proxy/General coding learning units
06/19/2011 - Conquer Online 2 - 7 Replies
Ok so I decided to give this a thread so it gets more than like 2 replies. I was bored yesterday and someone with impeccable timing was asking me questions about proxies... as a result I built them a proxy base source over team viewer while explaining what each thing sorta 'did'. I recorded most of it but as it took me a couple hours of going afk/coming back and fighting with me needing to remember all the steps, the videos would be far too large and boring for anyone here to make much use of....
|
Information about newish subtypes of the general data packet. (Again)
06/18/2011 - CO2 Private Server - 4 Replies
I'm working on a proxy for the Turkish servers, wondering if anyone has information about any of the following subtypes for the general data packet (type 0x271A).
0x6F, 0x7D, 0x81, 0x83-0x88, 0x8A-0x90, 0x92-0x96, 0x98-0x9B, 0x9D-0xA0, 0xA4, 0xA5, 0xAB, 0xAE, 0xAF, 0x193 - server->client (yes, the dashes represent the range)
0x66, 0x6F, 0x7B, 0x84, 0x91, 0x92, 0x94, 0x97, 0x98, 0x99, 0xA1, 0xAD, 0xAC, 0x136, 0x192 - client->server
and 0x77, 0x67, 0x7C, 0x3E8, and 0x3E9 (these I've been...
|
Packet Bot Tutorial?
07/13/2010 - General Coding - 3 Replies
I've did a little C++ as well as C# and I consider myself good in Python. I'm looking into making a proxy bot for the browser game Evony. So far, I have found no tutorials for programming such a thing for any game.
I have no idea on how to start network programming. If anyone has a tutorial or an open source bot you could link me to, I would greatly appreciate it.
Thanks,
NETio
|
5065 General Data Packet
07/08/2010 - CO2 Private Server - 8 Replies
Well I'm currently upgrading Hybrid's to 5065.
I successfully got it logged into a 5065 client, updated the characterinfo packet, iteminfo packet, and now I'm working on GeneralData packet.
I'm trying to turn this dump into a structure.
18 00 F2 03 8E A0 49 00 F2 D4 4C 00 00 00 00 00 00 00 00 00 00 00 4A 00 54 51 43 6C 69 65 6E 74
As much as Nullable taught me about dumps, all I got from that is
0x18 = 24, which is the length.
0x3F2 = 1010, which is the packet id.
It's the rest...
|
Packet Tutorial
05/22/2006 - Conquer Online 2 - 3 Replies
I dont seem to find a good tutorial about Packets. If someone could make one DECENTLY, or point me heh i'll b glad to provide many many packed-based tools. Also i'd like to have the packet sender/logger source code.
Thats it =)
text2schild.php?smilienummer=1&text=Don't you guys get mad because I'm doig a request here, this is the most readed section of ConquerOnline EPVP Forum so I'm kinda forced to post here, but if you guys want to move it to the right section feel free =) no hard...
|
All times are GMT +1. The time now is 17:05.
|
|