Some question about the client-server model
by Nachi Lau · in Torque Game Engine · 12/08/2003 (3:16 pm) · 3 replies
Hello,
As a beginner of the Torque engine, I wish to ask some questions about the server-client model. I have traced the script files in the client side, and I found out that when the user presses a key to update the player movement, function "moveforward(%val)" will be called. I found out that this function is actually update the global variable "$mvForwardAction". I wonder what is this variable for and how come the player will perform the movement update by just update this variable? Also, I ddo not find any code in the script that send the variable to the server-side..... so I wonder how come the server know the player will perform its movement update? Can someone give me some explaination about how the whole thing work..... ? I am really appericated of it!!!
Thanks!
Nachi
As a beginner of the Torque engine, I wish to ask some questions about the server-client model. I have traced the script files in the client side, and I found out that when the user presses a key to update the player movement, function "moveforward(%val)" will be called. I found out that this function is actually update the global variable "$mvForwardAction". I wonder what is this variable for and how come the player will perform the movement update by just update this variable? Also, I ddo not find any code in the script that send the variable to the server-side..... so I wonder how come the server know the player will perform its movement update? Can someone give me some explaination about how the whole thing work..... ? I am really appericated of it!!!
Thanks!
Nachi
#2
A quick grep reviles that the script global variable $mvForwardAction is defined in engine\game\gameConnectionMoves.cc within the function void MoveManager::init(). This variable is set to the C++ variable mForwardAction, which is used in the function bool GameConnection::getNextMove(Move &curMove).
Rich
12/09/2003 (8:25 am)
Nachi,A quick grep reviles that the script global variable $mvForwardAction is defined in engine\game\gameConnectionMoves.cc within the function void MoveManager::init(). This variable is set to the C++ variable mForwardAction, which is used in the function bool GameConnection::getNextMove(Move &curMove).
Rich
Torque Owner Ben Woodhead
Ben