- This topic has 6 replies, 3 voices, and was last updated 11 years ago by Anonymous.
-
AuthorPosts
-
December 19, 2013 at 02:50 #1327AnonymousInactive
How can I make tcpConn.AppendIncomingPacketHandler works with a client that wasn’t created using this library? My client sends basically byte[] to the server. After receiving the byte[] it must be decrypted (my custom method) and then it should be handled according it’s opcode. The decrypted packet has this structure:
int size;
int opcode;
byte[] data;December 19, 2013 at 08:48 #1333AnonymousInactiveFirst of all thank you for your interest in NetworkComms.Net. Unfortunately at this stage we only support communication between NetworkComms.Net based clients. This is a much requested feature that we are looking into adding at our next major version.
One question I have though is why are you using NetworkComms.Net to do a simple byte[] send? If this is between just two machines and there is no complex serialisation it is not that hard to achieve just using a basic TcpClient instance. I only ask to better understand the use case for this as normally NetworkComms.Net comes into it’s own when trying to either manage many persistent connections or when sending a custom object that requires complex serialization/compression.
Regards,
Matt
December 19, 2013 at 12:21 #1335AnonymousInactiveI would like to use NetworkComms.Net because I didn’t want to create all the TcpClient code, but use one already created, like your library. It would save me a lot of time coding network basics and I would have more time to focus in my program core.
Any chance that one day you might add this feature? It is one server and multiple clients. If yes, do you have any date available of when you’ll release it? Just so I can organize myself.
December 19, 2013 at 12:45 #1337AnonymousInactiveWhy not use NetworkComms.Net for all clients. Why do you need a feature that interfaces with other libraries?
December 19, 2013 at 12:50 #1338AnonymousInactiveBecause I am developing an online game emulator, and I don’t have the client source-code, so I can’t modify how client networking works.
December 19, 2013 at 12:56 #1339AnonymousInactiveMany thanks for the quick response.
We don’t have a date yet for supporting other libraries as everyone potentially implements their own network structure making it, possibly impossible, for us to support a general case.
If you could tell us which online game emulator you are using it would be useful to investigate how they have approached their networking support.
Kind regards,
MarcDecember 19, 2013 at 13:12 #1341AnonymousInactiveI am creating an emulator for a game called Priston Tale. It works like every other winsock application. It just sends byte[] to the server, which I parse according the opcode and then I answer with another byte[]. Not much complicated.
This is how I did to receive the packets, using TcpClient:
`/// <summary>
/// Waits until a packet is received from client
/// </summary>
void Run(object stateInfo)
{
var data = new byte[0x1000];
byte[] packet;
var read = 0;while (true)
{
try { read = stream.Read(data, 0, 0x1000); }
catch (Exception)
{
Clients.pInfo.Remove(this.key);
break;
}if (read == 0)
{
Clients.pInfo.Remove(this.key);
break;
}packet = new byte[read];
Array.ConstrainedCopy(data, 0, packet, 0, read);
packets.Queue(packet, this);
}
client.Close();
}`the stream variable is obtained using tcpclient.GetStream() method.
-
AuthorPosts
- You must be logged in to reply to this topic.