Alef/JIP – User
Jump to navigation
Jump to search
m (→output) |
m (→JIP test) |
||
Line 79: | Line 79: | ||
name p = alef (2) ; name _u = alef (2) ; name player = alef (2) ; | name p = alef (2) ; name _u = alef (2) ; name player = alef (2) ; | ||
</pre> | </pre> | ||
===comments=== |
Revision as of 09:38, 15 April 2009
General
The server is already running a mission. At least has the mission.sqm processed. Instanced of object/vehicles are in the server address space.
Now, the JIP needs to download from the server the status and keep it updated.
mission.sqm can't be processed like the server does, because of the randomness of units/vehicles. What if server creates and object and the client not, or if the position is different? This should be an easy remember thing.
Client get data from server. Sickboy's page explains that.
JIP test
source
// JIP test only. Put "p" as variable name in mission.sqm for JIP player. #define TEST( xx ) if ( xx ) then { _s=_s+ #xx +" ;" }; #define PRINT( xx ) _s=_s+ #xx + " = " + xx +" ;" ; _s="init.sqf\n"; for [{ _x=0 },{ _x<2 },{ _x=_x+1 }] do { _u=player; // isNull // this happens in JIP if no sleep are performed before. TEST( isNull p ) TEST( isNull _u ) TEST( isNull player ) _s=_s+"\n"; // locality // get player dereferenced? is only the pointer tested? TEST( local p ) TEST( local _u ) TEST( local player ) _s=_s+"\n"; // isPlayer // should this check if a unit is pointed by player? TEST( isPlayer p ) TEST( isPlayer _u ) TEST( isPlayer player ) _s=_s+"\n"; // name // the root of all this, see ace/xeh bug PRINT( name p ) PRINT( name _u ) PRINT( name player ) // 20090415 "No vehicle", add an additional check for vehicle PRINT( vehicle p ) PRINT( vehicle _u ) PRINT( vehicle player ) _s=_s+"\nsleep 0.001;\n"; sleep 0.001; }; hint _s; localize _s;
output (edited)
hosting game
local p ; local _u ; local player ; isPlayer _u ; isPlayer player ; name p = Roberto Duarte ; name _u = alef ; name player = alef ; sleep 0.001; local p ; local _u ; local player ; isPlayer _u ; isPlayer player ; name p = Roberto Duarte ; name _u = alef ; name player = alef ;
JIP
isNull _u ; isNull player ; name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; sleep 0.001; isNull _u ; isNull player ; name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ;
JIP, changed to sleep 1 second
isNull _u ; isNull player ; name p = Roberto Duarte ; name _u = Error: No vehicle ; name player = Error: No vehicle ; sleep 1; local p ; local _u ; local player ; isPlayer p ; isPlayer _u ; isPlayer ; name p = alef (2) ; name _u = alef (2) ; name player = alef (2) ;