<function name="rpcf_get_user_othersets" id="0x9021"> <input> <integer name="user_id" /> </input> <output> <integer name="count" /> <for name="i" from="0" count="count"> <integer name="type" array_index="i" /> <if variable="type" value="1" condition="eq"> <integer name="switch_id" /> <integer name="port" /> </if> <if variable="type" value="3" condition="eq"> <integer name="cur_id" /> <string name="name" /> </if> </for> </output> </function>
function rpcf_get_user_othersets($user_id=0) { //0x9021 $ret=array(); if (!$this->connection->urfa_call(0x9021)) { print "Error calling function ". __FUNCTION__ ."\n"; return FALSE; } $packet = $this->connection->getPacket(); $packet->DataSetInt($user_id); $this->connection->urfa_send_param($packet); if( $x = $this->connection->urfa_get_data() ) { $count=$x->DataGetInt(); $ret['count']=$count; for ($i=0;$i<$count;$i++) { $othersets['type']=$x->DataGetInt(); if( $othersets['type'] == 1 ) { $othersets['switch_id'] = $x->DataGetInt(); $othersets['port'] = $x->DataGetInt(); } elseif( $othersets['type'] == 3 ) { $othersets['cur_id'] = $x->DataGetInt(); $othersets['name'] = $x->DataGetString(); } $ret['othersets'][]=$othersets; unset( $othersets ); } } return $ret; }