Some questions regarding transmitDatablocks()
by Robert Nall · in Torque Game Engine · 10/28/2004 (12:32 pm) · 4 replies
1. How do I tell transmitDatablocks which datablocks need to be sent?
2. Is it supposed to send all the datablocks currently loaded on the server?
3. When a datablock like say "MyData" is transmitted, should it then be in the client's memory and able to pass an isObject(MyData) check?
4. If a datablock that's on the server doesn't appear to be making it to the client, yet the engine is calling onDataBlocksDone(), what does that mean and how do I fix it?
5.a. What is the mission sequence?
5.b. What does it affect?
5.c. Do I need it in a game where a client isn't allowed to connect during mission loading or during mission running?
5.d. Does it need to change each mission if the the situation in 5.c. is true and the mission and datablocks are cleared after each mission? or can I set it to something like "1" everytime I load a mission?
If you have an answer to any or all of these questions, I loved to hear them.
Thanks,
-Rob
2. Is it supposed to send all the datablocks currently loaded on the server?
3. When a datablock like say "MyData" is transmitted, should it then be in the client's memory and able to pass an isObject(MyData) check?
4. If a datablock that's on the server doesn't appear to be making it to the client, yet the engine is calling onDataBlocksDone(), what does that mean and how do I fix it?
5.a. What is the mission sequence?
5.b. What does it affect?
5.c. Do I need it in a game where a client isn't allowed to connect during mission loading or during mission running?
5.d. Does it need to change each mission if the the situation in 5.c. is true and the mission and datablocks are cleared after each mission? or can I set it to something like "1" everytime I load a mission?
If you have an answer to any or all of these questions, I loved to hear them.
Thanks,
-Rob
#2
So then if I have call like this called on the server:
datablock someData(dataName)
{
data;
}
then I call:
client.transmitDatablocks(sequence);
I should expect the client to get a callback for onDataBlockObjectRecieved() then the server to get one for the onDataBlocksDone() call?
11/02/2004 (10:03 am)
Thanks Ben, that's pretty much the way I thought things worked.So then if I have call like this called on the server:
datablock someData(dataName)
{
data;
}
then I call:
client.transmitDatablocks(sequence);
I should expect the client to get a callback for onDataBlockObjectRecieved() then the server to get one for the onDataBlocksDone() call?
#3
Thanks again for clearing those questions up for me.
11/02/2004 (10:56 am)
Ok, I can answer that myself . . . yes that is the order of things, except that the client DOES NOT get a call to onDataBlockObjectRecieved() for the last datablock. So if you only have one datablock, that function will never be called.Thanks again for clearing those questions up for me.
#4
11/02/2004 (11:47 am)
Glad to help. Also, glad to see you discovering stuff on your own. :)
Associate Kyle Carter
2. Yes.
3. It will be in client memory but with no name. The ID is the same from client to server.
4. If it is in memory on the server when you call transmitDB, it should make it to the client.
5. a. Identifies each serving of a mission on the host uniquely. b. Acts to make sure that a client doesn't get confused when the server changes missions. c. It's a good idea to keep around. It's just a globally incrementing ID. Starts at zero and goes up. d. Increment each time you call deleteDatablocks(), I think, is the best strategy.Hope that clears things up.