Hey Guys,
I have been working with the network system and have figured out how the system for listening and connecting server and client sockets work, but I need some clarification though on how the system proceeds from there. The two events I see next that seem to set up the actors/views are, EvtData_Remote_Client
which is created and queued on the server side immediately after a client's connection is accepted. Now, this is where the confusion starts for me, the first comment in the only delegate which listens for this event says
I was initially thinking this somehow meant that the client socket had streamed an event over to the server, but when looking at it closer, I think it means that the client attempts to connect, is then accepted, and the server side generates an event with the socket ID and IP address of the client, correct? The event is then listened to on the server side by the game logic, which attempts to find an unused NetworkView which should be created by the server prior to connection (in a network game setup screen or something). Now that the server side has successfully associated a local network view with a client socket ID, it then sends a 'NetMsg_PlayerLoginOK', which is a signal that the client was succesful in its connection. This message is then streamed back to the client which uses the data to construct an 'EvtData_Network_Player_Actor_Assignment'.
This event is listened to by the game logic as well on the client side, first off though, what is the point of this line
Is it for cases where the player does not necessarily associate with an actor, like a puzzle game? What confuses me more is this,
So the first code block says, if the actor ID is invalid, then set m_remotePlayerID to the socketID, however the next code block says, if the remote player ID is equal to the socket ID (which assumes that the actorID was invalid in the previous block), then set the views controlled actor to...invalid? I am unsure about
how this code works as it seems like the actor ID must be invalid, only to set the views controlled actor to the invalid ID.
At this point I think I understand these points
- The Server has listened on a port, and a client has connected, associating a human view and a network view both on the client and server sides with a socketID, which is uniquely generated on the server side
- Both of these views are also associated with an ActorID which is also generated on the server, which leaves me to wonder, is this assuming that both the server and the actor have identical actor objects, I mean, if an actor was loaded on one machine and got a different number, this could be bad, like possibly
the server attaching the clients human view to a table or something instead of the actual player actor, am I wrong here, or is this something that needs to be kept in sync completely.
- I understand that a network event forwarder is created in response to a EvtData_Remote_Client on the server side, but where is created on the client side, how does the client side human view forward events to the server?
I had considered using networking for our current game, but I think I will hold off until a future project, however I would like to figure this out anyway as it is really confusing.
Thanks again
I have been working with the network system and have figured out how the system for listening and connecting server and client sockets work, but I need some clarification though on how the system proceeds from there. The two events I see next that seem to set up the actors/views are, EvtData_Remote_Client
which is created and queued on the server side immediately after a client's connection is accepted. Now, this is where the confusion starts for me, the first comment in the only delegate which listens for this event says
I was initially thinking this somehow meant that the client socket had streamed an event over to the server, but when looking at it closer, I think it means that the client attempts to connect, is then accepted, and the server side generates an event with the socket ID and IP address of the client, correct? The event is then listened to on the server side by the game logic, which attempts to find an unused NetworkView which should be created by the server prior to connection (in a network game setup screen or something). Now that the server side has successfully associated a local network view with a client socket ID, it then sends a 'NetMsg_PlayerLoginOK', which is a signal that the client was succesful in its connection. This message is then streamed back to the client which uses the data to construct an 'EvtData_Network_Player_Actor_Assignment'.
This event is listened to by the game logic as well on the client side, first off though, what is the point of this line
Is it for cases where the player does not necessarily associate with an actor, like a puzzle game? What confuses me more is this,
So the first code block says, if the actor ID is invalid, then set m_remotePlayerID to the socketID, however the next code block says, if the remote player ID is equal to the socket ID (which assumes that the actorID was invalid in the previous block), then set the views controlled actor to...invalid? I am unsure about
how this code works as it seems like the actor ID must be invalid, only to set the views controlled actor to the invalid ID.
At this point I think I understand these points
- The Server has listened on a port, and a client has connected, associating a human view and a network view both on the client and server sides with a socketID, which is uniquely generated on the server side
- Both of these views are also associated with an ActorID which is also generated on the server, which leaves me to wonder, is this assuming that both the server and the actor have identical actor objects, I mean, if an actor was loaded on one machine and got a different number, this could be bad, like possibly
the server attaching the clients human view to a table or something instead of the actual player actor, am I wrong here, or is this something that needs to be kept in sync completely.
- I understand that a network event forwarder is created in response to a EvtData_Remote_Client on the server side, but where is created on the client side, how does the client side human view forward events to the server?
I had considered using networking for our current game, but I think I will hold off until a future project, however I would like to figure this out anyway as it is really confusing.
Thanks again
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz