Editing Conquer Server Socket [ creating new client ]

04/18/2014 19:58 abdeen#1
Hello Epvp members , as title say i am editing conquer server socket to make it conquer client socket , actually i tried it many times but fails , spent more time on that , well ,, here is my idea..

Server and client each one have 2 sockets... Login Socket , Game Socket

Server socket working very well , but i need to edit it to work with the client , just receiving and sending data , bytes and packets.. and don`t listen for incoming connections ... as i said i spent long time on this i got it worked successfully , but not as i am looking for ...

i want it sending and receiving at same time as Conquer Socket server doing ... i am working on Conquer_Online_Server 5517+ Impulse one ...

here is Socket Files ...


04/20/2014 13:00 GameHackerPM#2
You want to make an inverse of the socket? From being server to send commands and steps to be client receiving and send the stats?
04/20/2014 14:03 KraHen#3
You can not receive data without accepting incoming connections, so obviously you don`t understand the code you are working with. I`d recommend reading this :

[Only registered and activated users can see links. Click Here To Register...]

After this, please refer to MSDN for .NET sockets, then try to answer your own question.
04/20/2014 14:13 abdeen#4
Quote:
Originally Posted by GameHacker-PM- View Post
You want to make an inverse of the socket? From being server to send commands and steps to be client receiving and send the stats?
hey bro i am not that good at sockets ,, all i need to do is edit the provided socket to make is as a client ... is it hard to this point ? and i don't someone code for me , just help with some points . this server socket is working like this ...

Code:
AsyncSocket ServerSocket = new AsyncSocket(9999); ServerSocket.OnClientConnect += new Action(AuthServer_AnnounceNewConnection); ServerSocket.OnClientReceive += new Action<byte[],>(AuthServer_AnnounceReceive); ServerSocket.OnClientDisconnect += new Action(AuthServer_AnnounceDisconnection);
and as you see the socket in the thread ,,, its just listening and binding ,,, i need it to connect to the specified ip and port ... then receive and send packets same as server socket doing
04/20/2014 14:18 abdoumatrix#5
Quote:
Originally Posted by KraHen View Post
You can not receive data without accepting incoming connections, so obviously you don`t understand the code you are working with. I`d recommend reading this :

[Only registered and activated users can see links. Click Here To Register...]

After this, please refer to MSDN for .NET sockets, then try to answer your own question.
Nice but i first one will be useless at this point as he developing in c#.

good reference anyway.
04/20/2014 14:19 abdeen#6
Quote:
Originally Posted by KraHen View Post
You can not receive data without accepting incoming connections, so obviously you don`t understand the code you are working with. I`d recommend reading this :

[Only registered and activated users can see links. Click Here To Register...]

After this, please refer to MSDN for .NET sockets, then try to answer your own question.
i am already have System.Net.Sockets info and i am working with tcp clients , tcp listeners and socket ... but actually this point stops me.. need some help ... that's all :)
04/20/2014 14:21 abdoumatrix#7
Quote:
Originally Posted by abdeen View Post
hey bro i am not that good at sockets ,, all i need to do is edit the provided socket to make is as a client ... is it hard to this point ? and i don't someone code for me , just help with some points . this server socket is working like this ...

Code:
AsyncSocket ServerSocket = new AsyncSocket(9999); ServerSocket.OnClientConnect += new Action(AuthServer_AnnounceNewConnection); ServerSocket.OnClientReceive += new Action<byte[],>(AuthServer_AnnounceReceive); ServerSocket.OnClientDisconnect += new Action(AuthServer_AnnounceDisconnection);
and as you see the socket in the thread ,,, its just listening and binding ,,, i need it to connect to the specified ip and port ... then receive and send packets same as server socket doing
Learning How Socket work is the best Solution.
that what i gonna do to improve my limeted knowledge about sockets.
04/20/2014 14:22 abdeen#8
Quote:
Originally Posted by abdoumatrix View Post
Nice but i first one will be useless at this point as he developing in c#.

good reference anyway.
i don't think so ... it's bad ref ..

Quote:
Originally Posted by abdoumatrix View Post
Learning How Socket work is the best Solution.
that what i gonna do to improve my limeted knowledge about sockets.
Well, i wouldnt think its too hard for developers to show me how to edit or convert it to work as client socket to connect, receive and send data from-to server .

i thought it would be something like this ...

for example at AsyncSocket.cs

PHP Code:

public AsyncSocket(string ipushort port)
        {
            if (!
this.enabled)
            {

                
this.port port;
                
this.Connection.Connect(ipport);
                
//and i need to add here some code to make it receive coming data with an socket even just like Co source
            
}
        } 
04/20/2014 16:55 CptSky#9
Quote:
Originally Posted by abdeen View Post
i don't think so ... it's bad ref ..
Bad reference because it's not in C# and you don't understand it ?


Quote:
Originally Posted by abdeen View Post
Well, i wouldnt think its too hard for developers to show me how to edit or convert it to work as client socket to connect, receive and send data from-to server .
Hard ? No. But you don't really understand at all the concept of socket and the concept of client/server architecture when it comes to socket. So, maybe trying to understand that before doing anything ? The C# API is well documented. If you know what you're doing, it's easy to do a client socket class.
04/20/2014 20:00 Super Aids#10
I would post my socket tutorial but unfortunately last time I got 3 infractions
04/21/2014 14:06 Yupmoh#11
Quote:
Originally Posted by Super Aids View Post
I would post my socket tutorial but unfortunately last time I got 3 infractions
Oh yeah, I really liked your tutorial :D
04/21/2014 23:44 KraHen#12
I suggest you to lose the concept of C# or any other programming language. Learn the method, understand what you`re doing first, then USE the programming language to IMPLEMENT a solution. You guys seem to be controlled by the language you`re using, not the other way around. It`s like if a hammer factory told you that you can only nail this or that way.