In networking. Connection passing.
How much can I pass the connection
from a message
pulled from server.messages
in for loop?
And why sometimes the connection doesn't send anything at all?
In severUpdate()
I'm calling a function called hdl_messages()
which is a function in the same file that will loop through server.messages
and pass the message
to an object called WorldEntity via the trigger function worldEntity.trigger(message)
, the trigger function will look the message and send the message again to another entity in the worldEntity
object.
When the message reaches its destination and tries to use the connection
object in the message
object that was passed. the connection doesn't work at all. I had traced the execution until the connection.send(object _name='players-data' _value=this.players_data end)
but in the client end, I don't receive any message with the name players-data
.
before this object is sent, I send to the client his ID
in the same manner, the client sends request-id
then the same process goes on until the entity that has the ID sends it back to the client.
What I mean the first time I could send the ID, but the second time I couldn't send the players_data
which is just a list. both the ID entity and the players-data entity have the same travel distance.
for ID:serverUpdate()
-> hdl_messages()
-> worldEntity.trigger(message)
-> entity_ID.trigger(message)
-> connection.send(object _name='request-id' _value=this.ID end)
for players-data:serverUpdate()
-> hdl_messages()
-> worldEntity.trigger(message)
-> entity_players.trigger(message)
-> connection.send(object _name='players-data' _value=this.players_data end)
Another question how can I link my desktop app with my account here?
Thanks.