Quote:
Originally Posted by StarBucks
Alright, made a little bit of progress(sadly school started), but this is what i got so far.
[Only registered and activated users can see links. Click Here To Register...]
I'm a little confused on when the AuthClient receives why it doesn't has the AuthServer.Send function like AuthClient.Send.
Doesn't Sender.Send do the same thing as AuthServer.Send?
|
Move
AuthClient.Enable("209.172.33.201", 9957, ClientRecvBuffer);
to your AuthServer_OnClientConnect method, you shouldn't establish the connection until a client connects to your socket first.
AuthServer doesn't have a Send function because it's a listening port. Which could have more than just one connection to it, how would you send a packet to a client when there are two clients connect using just a Send? Which why you instead send the packet to the CustomWinsockClient instance which represents a single connection on your socket, I believe that is the "Sender" parameter in all three events for your AuthServer instance.
So what you need to do is, under public WinsockClient AuthClient;
you need to add, a public CustomWinsockClient ConnectedClient;
Then in your AuthServer_OnClientConnect method add ConnectedClient = Sender;
Now in your AuthClient_OnReceive method replace Sender.Send(Arg) with ConnectedClient.Send(Arg);
And i guess that should fix everything.