# INFSmartFoxiPhoneClient Class Reference

List of all members.

## Public Member Functions
(void) | - __logout
(void) | - addBuddy:
(void) | - autoJoin
(void) | - clearBuddyList
(void) | - clearRoomList
(void) | - connect:port:
(void) | - createRoom:roomId:
(void) | - debugMessage:
(void) | - disconnect
(INFSmartFoxRoom *) | - getActiveRoom
(NSMutableDictionary *) | - getAllRooms
(NSInteger) | - getBenchStartTime
(INFSmartFoxBuddy *) | - getBuddyById:
(INFSmartFoxBuddy *) | - getBuddyByName:
(void) | - getBuddyRoom:
(NSString *) | - getConnectionMode
(void) | - getRandomKey
(INFSmartFoxRoom *) | - getRoom:
(INFSmartFoxRoom *) | - getRoomByName:
(void) | - getRoomList
(NSString *) | - getUploadPath
(NSString *) | - getVersion
(id) | - initWithParams:delegate:
(void) | - joinRoom:pword:isSpectator:dontLeave:oldRoom:
(void) | - leaveRoom:
(void) | - loadBuddyList
(void) | - loadConfig:autoConnect:
(void) | - login:name:pass:
(void) | - logout
(void) | - removeBuddy:
(void) | - roundTripBench
(void) | - sendBuddyPermissionResponse:targetBuddy:
(void) | - sendModeratorMessage:type:id:
(void) | - sendObject:roomId:
(void) | - sendObjectToGroup:userList:roomId:
(void) | - sendPrivateMessage:recipientId:roomId:
(void) | - sendPublicMessage:roomId:
(void) | - sendString:
(void) | - sendXtMessage:cmd:paramObj:type:roomId:
(void) | - setBuddyBlockStatus:status:
(void) | - setBuddyVariables:
(void) | - setRoomVariables:roomId:setOwnership:
(void) | - setUserVariables:roomId:
(void) | - switchSpectator:
## Static Public Member Functions
(id) | + iPhoneClient:delegate:
## Public Attributes
NSInteger | _activeRoomId
BOOL | _amIModerator
NSString * | _blueBoxIpAddress
NSInteger | _blueBoxPort
NSMutableDictionary * | _buddyList
BOOL | _changingRoom
BOOL | _debug
NSString * | _defaultZone
NSInteger | _httpPort
NSString * | _ipAddress
NSMutableDictionary * | _myBuddyVars
NSInteger | _myUserId
NSString * | _myUserName
NSInteger | _playerId
NSInteger | _port
BOOL | _smartConnect
## Properties
NSInteger | activeRoomId
BOOL | amIModerator
NSMutableDictionary * | buddyList
BOOL | changingRoom
id< INFSmartFoxISFSEvents > | delegate
NSInteger | httpPollSpeed
NSString * | INFSMARTFOXCLIENT_CONNECTION_MODE_DISCONNECTED
NSString * | INFSMARTFOXCLIENT_CONNECTION_MODE_HTTP
NSString * | INFSMARTFOXCLIENT_CONNECTION_MODE_SOCKET
NSInteger | INFSMARTFOXCLIENT_EOM
NSString * | INFSMARTFOXCLIENT_MODMSG_TO_ROOM
NSString * | INFSMARTFOXCLIENT_MODMSG_TO_USER
NSString * | INFSMARTFOXCLIENT_MODMSG_TO_ZONE
NSString * | INFSMARTFOXCLIENT_MSG_JSON
NSString * | INFSMARTFOXCLIENT_MSG_XML
NSString * | INFSMARTFOXCLIENT_XTMSG_TYPE_JSON
NSString * | INFSMARTFOXCLIENT_XTMSG_TYPE_STR
NSString * | INFSMARTFOXCLIENT_XTMSG_TYPE_XML
BOOL | isConnected
mach_timebase_info_data_t | mach_timebase_info_data
NSMutableDictionary * | myBuddyVars
NSInteger | myUserId
NSString * | myUserName
NSInteger | playerId
NSString * | rawProtocolSeparator

## Detailed Description

SmartFoxClient is the main class in the SmartFoxServer API. This class is responsible for connecting to the server and handling all related events.

NOTE: in the provided examples, smartFox always indicates a SmartFoxClient instance.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  1.5.4

## Member Function Documentation

- (void) __logout |  |  |  |

- (void) addBuddy: |  | (NSString *) | buddyName |  |

Add a user to the buddy list. Since SmartFoxServer Pro 1.6.0, the buddy list feature can be configured to use a basic or advanced security mode (see the SmartFoxServer server-side configuration file). Check the following usage notes for details on the behavior of the addBuddy method in the two cases.

Basic security mode When a buddy is added, if the buddy list is already full, the onBuddyListError (INFSmartFoxISFSEvents) event is fired; otherwise the buddy list is updated and the onBuddyList (INFSmartFoxISFSEvents) event is fired.

Advanced security mode If the <addBuddyPermission> parameter is set to true in the buddy list configuration section of a zone, before the user is actually added to the buddy list he/she must grant his/her permission. The permission request is sent if the user is online only; the user receives the onBuddyPermissionRequest (INFSmartFoxISFSEvents) event. When the permission is granted, the buddy list is updated and the onBuddyList (INFSmartFoxISFSEvents) event is fired. If the permission is not granted (or the buddy didn't receive the permission request), the addBuddy method can be called again after a certain amount of time only. This time is set in the server configuration <permissionTimeOut> parameter. Also, if the <mutualAddBuddy> parameter is set to true, when user A adds user B to the buddy list, he/she is automatically added to user B's buddy list. Lastly, if the buddy list is full, the onBuddyListError (INFSmartFoxISFSEvents) event is fired.

Parameters:

  | buddyName | : the name of the user to be added to the buddy list.

SFSEvent::onBuddyList SFSEvent::onBuddyListError SFSEvent::onBuddyPermissionRequest

See also:
  _buddyList

  - removeBuddy:

  - setBuddyBlockStatus:status:

  onBuddyList (INFSmartFoxISFSEvents)

  onBuddyListError (INFSmartFoxISFSEvents)

  onBuddyPermissionRequest (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

SmartFoxServer Pro v1.6.0 - Buddy list's advanced security mode implemented.

Version:
  SmartFoxServer Basic (except advanced mode) / Pro

- (void) autoJoin |  |  |  |

Automatically join the the default room (if existing) for the current zone. A default room can be specified in the SmartFoxServer server-side configuration by adding the

     autoJoin = "true"

attribute to one of the <Room> tags in a zone. When a room is marked as autoJoin it becomes the default room where all clients are joined when this method is called.

SFSEvent::onJoinRoom SFSEvent::onJoinRoomError

See also:
  - joinRoom:pword:isSpectator:dontLeave:oldRoom:

  onJoinRoom (INFSmartFoxISFSEvents)

  onJoinRoomError (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) clearBuddyList |  |  |  |

Remove all users from the buddy list.

SFSEvent::onBuddyList

See also:
  buddyList

  onBuddyList (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

SmartFoxServer Pro v1.6.0 - Method deprecated.

Version:
  SmartFoxServer Basic / Pro

- (void) clearRoomList |  |  |  |

- (void) connect: |  | (NSString *) | ipAdr
port: |  | (NSInteger) | port |

Establish a connection to SmartFoxServer. The client usually gets connected to SmartFoxServer through a socket connection. In SmartFoxServer Pro, if a socket connection is not available and the smartConnect property is set to true, an http connection to the BlueBox module is attempted. When a successful connection is established, the getConnectionMode can be used to check the current connection mode.

Parameters:

  | ipAdr | : the SmartFoxServer ip address.
  | port | : the SmartFoxServer TCP port (optional).

SFSEvent::onConnection

See also:
  - disconnect

  - getConnectionMode

  _smartConnect

  onConnection (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

SmartFoxServer Pro v1.6.0 - BlueBox connection attempt in case of socket connection not available.

Version:
  SmartFoxServer Basic (except BlueBox connection) / Pro

- (void) createRoom: |  | (INFSmartFoxRoomCreateParams *) | roomObj
roomId: |  | (NSInteger) | roomId |

Dynamically create a new room in the current zone.

NOTE: if the newly created room is a game room, the user is joined automatically upon successful room creation.

Parameters:

  | roomObj | : an object with the properties described farther on.
  | roomId | : the id of the room from where the request is originated, in case the application allows multi-room join (optional, default value: activeRoomId ).

The roomObj parameter is an object containing the following properties:

Parameters:

  | name | : (String) the room name.
  | password | : (String) a password to make the room private (optional, default: none).
  | maxUsers | : (int) the maximum number of users that can join the room.
  | maxSpectators | : (int) in game rooms only, the maximum number of spectators that can join the room (optional, default value: 0).
  | isGame | : (Boolean) if true, the room is a game room (optional, default value: false).
  | exitCurrentRoom | : (Boolean) if true and in case of game room, the new room is joined after creation (optional, default value: true).
  | uCount | : (Boolean) if true, the new room will receive the onUserCountChange (INFSmartFoxISFSEvents) notifications (optional, default <u>recommended</u> value: false).
  | vars | : (Array) an array of Room Variables, as described in the setRoomVariables method documentation (optional, default: none).
  | extension | : (Object) which extension should be dynamically attached to the room, as described farther on (optional, default: none).

A Room-level extension can be attached to any room during creation; the extension property in the roomObj parameter is an object with the following properties:

Parameters:

  | name | : (String) the name used to reference the extension (see the SmartFoxServer server-side configuration).
  | script | : (String) the file name of the extension script (for Actionscript and Python); if Java is used, the fully qualified name of the extension must be provided. The file name is relative to the root of the extension folder ("sfsExtensions/" for Actionscript and Python, "javaExtensions/" for Java).

SFSEvent::onRoomAdded SFSEvent::onCreateRoomError

See also:
  onRoomAdded (INFSmartFoxISFSEvents)

  onCreateRoomError (INFSmartFoxISFSEvents)

  onUserCountChange (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) debugMessage: |  | (NSString *) | message |  |

- (void) disconnect |  |  |  |

Close the current connection to SmartFoxServer.

SFSEvent::onConnectionLost

See also:
  - connect:port:

  onConnectionLost (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (INFSmartFoxRoom *) getActiveRoom |  |  |  |

Get the currently active INFSmartFoxRoom object. SmartFoxServer allows users to join two or more rooms at the same time (multi-room join). If this feature is used, then this method is useless and the application should track the various room id(s) manually, for example by keeping them in an array.

Returns:
  the INFSmartFoxRoom object of the currently active room; if the user joined more than one room, the last joined room is returned.

See also:
  activeRoomId

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSMutableDictionary *) getAllRooms |  |  |  |

Get the list of rooms in the current zone. Unlike the getRoomList method, this method returns the list of INFSmartFoxRoom objects already stored on the client, so no request is sent to the server.

Returns:
  The list of rooms available in the current zone.

See also:
  - getRoomList

  INFSmartFoxRoom

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) getBenchStartTime |  |  |  |

- (INFSmartFoxBuddy *) getBuddyById: |  | (NSInteger) | id |  |

Get a buddy from the buddy list, using the user id as key. Refer to the buddyList property for a description of the buddy object's properties.

Parameters:

  | id | : the user id of the buddy.

Returns:
  The buddy object.

See also:
  buddyList

  - getBuddyByName:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (INFSmartFoxBuddy *) getBuddyByName: |  | (NSString *) | buddyName |  |

Get a buddy from the buddy list, using the buddy's username as key. Refer to the buddyList property for a description of the buddy object's properties.

Parameters:

  | buddyName | : the username of the buddy.

Returns:
  The buddy object.

See also:
  buddyList

  - getBuddyById:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (void) getBuddyRoom: |  | (INFSmartFoxBuddy *) | buddy |  |

Request the room id(s) of the room(s) where a buddy is currently located into.

Parameters:

  | buddy | : a buddy object taken from the buddyList array.

SFSEvent::onBuddyRoom

See also:
  buddyList

  onBuddyRoom (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) getConnectionMode |  |  |  |

Get the current connection mode.

Returns:
  The current connection mode, expressed by one of the following constants: INFSMARTFOXCLIENT_CONNECTION_MODE_DISCONNECTED (disconnected), INFSMARTFOXCLIENT_CONNECTION_MODE_SOCKET (socket mode), INFSMARTFOXCLIENT_CONNECTION_MODE_HTTP (http mode).

See also:
  INFSMARTFOXCLIENT_CONNECTION_MODE_DISCONNECTED

  INFSMARTFOXCLIENT_CONNECTION_MODE_SOCKET

  INFSMARTFOXCLIENT_CONNECTION_MODE_HTTP

  - connect:port:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (void) getRandomKey |  |  |  |

Retrieve a random string key from the server. This key is also referred in the SmartFoxServer documentation as the "secret key". It's a unique key, valid for the current session only. It can be used to create a secure login system.

SFSEvent::onRandomKey

See also:
  onRandomKey (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (INFSmartFoxRoom *) getRoom: |  | (NSInteger) | roomId |  |

Get a INFSmartFoxRoom object, using its id as key.

Parameters:

  | roomId | : the id of the room.

Returns:
  The INFSmartFoxRoom object.

See also:
  - getRoomByName:

  - getAllRooms

  - getRoomList

  INFSmartFoxRoom

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (INFSmartFoxRoom *) getRoomByName: |  | (NSString *) | roomName |  |

Get a INFSmartFoxRoom object, using its name as key.

Parameters:

  | roomName | : the name of the room.

Returns:
  The INFSmartFoxRoom object.

See also:
  - getRoom:

  - getAllRooms

  - getRoomList

  INFSmartFoxRoom

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) getRoomList |  |  |  |

Retrieve the updated list of rooms in the current zone. Unlike the getAllRooms method, this method sends a request to the server, which then sends back the complete list of rooms with all their properties and server-side variables (Room Variables).

If the default login mechanism provided by SmartFoxServer is used, then the updated list of rooms is received right after a successful login, without the need to call this method. Instead, if a custom login handler is implemented, the room list must be manually requested to the server using this method.

SFSEvent::onRoomListUpdate

See also:
  - getRoom:

  - getRoomByName:

  - getAllRooms

  onRoomListUpdate (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) getUploadPath |  |  |  |

Get the default upload path of the embedded webserver.

Returns:
  The http address of the default folder in which files are uploaded.

See also:
  uploadFile

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.5.0

Version:
  SmartFoxServer Basic / Pro

- (NSString *) getVersion |  |  |  |

Get the SmartFoxServer Flash API version.

Returns:
  The current version of the SmartFoxServer client API.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (id) initWithParams: |  | (BOOL) | debug
delegate: |  | (id <INFSmartFoxISFSEvents>) | delegate |

The SmartFoxClient contructor.

Parameters:

  | debug | : turn on the debug messages (optional).
  | delegate | : specifies the delegate object which will receive events.(optional).

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

+ (id) iPhoneClient: |  | (BOOL) | debug
delegate: |  | (id <INFSmartFoxISFSEvents>) | delegate |

- (void) joinRoom: |  | (id) | newRoom
pword: |  | (NSString *) | pword
isSpectator: |  | (BOOL) | isSpectator
dontLeave: |  | (BOOL) | dontLeave
oldRoom: |  | (NSInteger) | oldRoom |

Join a room.

Parameters:

  | newRoom | : the name (String) or the id (int) of the room to join.
  | pword | : the room's password, if it's a private room (optional).
  | isSpectator | : a boolean flag indicating wheter you join as a spectator or not (optional).
  | dontLeave | : a boolean flag indicating if the current room must be left after successfully joining the new room (optional).
  | oldRoom | : the id of the room to leave (optional, default value: activeRoomId ). NOTE: the last two optional parameters enable the advanced multi-room join feature of SmartFoxServer, which allows a user to join two or more rooms at the same time. If this feature is not required, the parameters can be omitted.

SFSEvent::onJoinRoom SFSEvent::onJoinRoomError

See also:
  onJoinRoom (INFSmartFoxISFSEvents)

  onJoinRoomError (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) leaveRoom: |  | (NSInteger) | roomId |  |

Disconnect the user from the given room. This method should be used only when users are allowed to be present in more than one room at the same time (multi-room join feature).

Parameters:

  | roomId | : the id of the room to leave.

SFSEvent::onRoomLeft

See also:
  - joinRoom:pword:isSpectator:dontLeave:oldRoom:

  onRoomLeft (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) loadBuddyList |  |  |  |

Load the buddy list for the current user.

SFSEvent::onBuddyList SFSEvent::onBuddyListError

See also:
  _buddyList

  onBuddyList (INFSmartFoxISFSEvents)

  onBuddyListError (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) loadConfig: |  | (NSString *) | configFile
autoConnect: |  | (BOOL) | autoConnect |

Load a client configuration file. The SmartFoxClient instance can be configured through an external xml configuration file loaded at run-time. By default, the loadConfig method loads a file named "config.xml", placed in the same folder of the application swf file. If the autoConnect parameter is set to true, on loading completion the connect method is automatically called by the API, otherwise the onConfigLoadSuccess (INFSmartFoxISFSEvents) event is dispatched. In case of loading error, the onConfigLoadFailure (INFSmartFoxISFSEvents) event id fired.

NOTE: the SmartFoxClient configuration file (client-side) should not be confused with the SmartFoxServer configuration file (server-side).

The external xml configuration file has the following structure; ip, port and zone parameters are mandatory, all other parameters are optional.

                                    <SmartFoxClient>
                                            <ip>127.0.0.1</ip>
                                            <port>9339</port>
                                            <zone>simpleChat</zone>
                                            <debug>true</debug>
                                            <blueBoxIpAddress>127.0.0.1</blueBoxIpAddress>
                                            <blueBoxPort>9339</blueBoxPort>
                                            <smartConnect>true</smartConnect>
                                            <httpPort>8080</httpPort>
                                            <httpPollSpeed>750</httpPollSpeed>
                                            <rawProtocolSeparator>%</rawProtocolSeparator>
                                    </SmartFoxClient>

Parameters:

  | configFile | : external xml configuration file name (optional).
  | autoConnect | : a boolean flag indicating if the connection to SmartFoxServer must be attempted upon configuration loading completion (optional).

SFSEvent::onConfigLoadSuccess SFSEvent::onConfigLoadFailure

See also:
  _ipAddress

  _port

  _defaultZone

  _debug

  _blueBoxIpAddress

  _blueBoxPort

  _smartConnect

  _httpPort

  httpPollSpeed

  rawProtocolSeparator

  onConfigLoadSuccess (INFSmartFoxISFSEvents)

  onConfigLoadFailure (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (void) login: |  | (NSString *) | zone
name: |  | (NSString *) | name
pass: |  | (NSString *) | pass |

Perform the default login procedure. The standard SmartFoxServer login procedure accepts guest users. If a user logs in with an empty username, the server automatically creates a name for the client using the format guest_n, where n is a progressive number. Also, the provided username and password are checked against the moderators list (see the SmartFoxServer server-side configuration) and if a user matches it, he is set as a Moderator.

NOTE 1: duplicate names in the same zone are not allowed.

NOTE 2: for SmartFoxServer Basic, where a server-side custom login procedure can't be implemented due to the lack of extensions support, a custom client-side procedure can be used, for example to check usernames against a database using a php/asp page. In this case, this should be done BEFORE calling the login method. This way, once the client is validated, the stadard login procedure can be used.

Parameters:

  | zone | : the name of the zone to log into.
  | name | : the user name.
  | pass | : the user password.

SFSEvent::onLogin

See also:
  - logout

  onLogin (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) logout |  |  |  |

Log the user out of the current zone. After a successful logout the user is still connected to the server, but he/she has to login again into a zone, in order to be able to interact with the server.

SFSEvent::onLogout

See also:
  - login:name:pass:

  onLogout (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.5.5

Version:
  SmartFoxServer Basic / Pro

- (void) removeBuddy: |  | (NSString *) | buddyName |  |

Remove a buddy from the buddy list. Since SmartFoxServer Pro 1.6.0, the buddy list feature can be configured to use a basic or advanced security mode (see the SmartFoxServer server-side configuration file). Check the following usage notes for details on the behavior of the removeBuddy method in the two cases.

Basic security mode When a buddy is removed, the buddy list is updated and the onBuddyList (INFSmartFoxISFSEvents) event is fired.

Advanced security mode In addition to the basic behavior, if the <mutualRemoveBuddy> server-side configuration parameter is set to true, when user A removes user B from the buddy list, he/she is automatically removed from user B's buddy list.

Parameters:

  | buddyName | : the name of the user to be removed from the buddy list.

SFSEvent::onBuddyList

See also:
  _buddyList

  - addBuddy:

  onBuddyList (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

SmartFoxServer Pro v1.6.0 - Buddy list's advanced security mode implemented.

Version:
  SmartFoxServer Basic (except advanced mode) / Pro

- (void) roundTripBench |  |  |  |

Send a roundtrip request to the server to test the connection' speed. The roundtrip request sends a small packet to the server which immediately responds with another small packet, and causing the onRoundTripResponse (INFSmartFoxISFSEvents) event to be fired. The time taken by the packet to travel forth and back is called "roundtrip time" and can be used to calculate the average network lag of the client. A good way to measure the network lag is to send continuos requests (every 3 or 5 seconds) and then calculate the average roundtrip time on a fixed number of responses (i.e. the last 10 measurements).

SFSEvent::onRoundTripResponse

See also:
  onRoundTripResponse (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) sendBuddyPermissionResponse: |  | (BOOL) | allowBuddy
targetBuddy: |  | (NSString *) | targetBuddy |

Grant current user permission to be added to a buddy list. If the SmartFoxServer Pro 1.6.0 advanced security mode is used (see the SmartFoxServer server-side configuration), when a user wants to add a buddy to his/her buddy list, a permission request is sent to the buddy. Once the onBuddyPermissionRequest (INFSmartFoxISFSEvents) event is received, this method must be used by the buddy to grant or refuse permission. When the permission is granted, the requester's buddy list is updated.

Parameters:

  | allowBuddy | : true to grant permission, false to refuse to be added to the requester's buddy list.
  | targetBuddy | : the username of the requester.

See also:
  - addBuddy:

  onBuddyPermissionRequest (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (void) sendModeratorMessage: |  | (NSString *) | message
type: |  | (NSString *) | type
id: |  | (NSInteger) | id |

Send a Moderator message to the current zone, the current room or a specific user in the current room. In order to send these kind of messages, the user must have Moderator's privileges, which are set by SmartFoxServer when the user logs in (see the INFSmartFoxiPhoneClient#login:name:pass: method).

Parameters:

  | message | : the text of the message.
  | type | : the type of message. The following constants can be passed: INFSMARTFOX_MODMSG_TO_USER, INFSMARTFOX_MODMSG_TO_ROOM and INFSMARTFOX_MODMSG_TO_ZONE, to send the message to a user, to the current room or to the entire current zone respectively.
  | id | : the id of the recipient room or user (ignored if the message is sent to the zone).

SFSEvent::onModeratorMessage

See also:
  - login:name:pass:

  INFSMARTFOXCLIENT_MODMSG_TO_USER

  INFSMARTFOXCLIENT_MODMSG_TO_ROOM

  INFSMARTFOXCLIENT_MODMSG_TO_ZONE

  onModMessage (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.4.5

Version:
  SmartFoxServer Basic / Pro

- (void) sendObject: |  | (NSDictionary *) | obj
roomId: |  | (NSInteger) | roomId |

Send an Actionscript object to the other users in the current room. This method can be used to send complex/nested data structures to clients, like a game move or a game status change. Supported data types are: Strings, Booleans, Numbers, Arrays, Objects.

Parameters:

  | obj | : the Actionscript object to be sent.
  | roomId | : the id of the target room, in case of multi-room join (optional, default value: activeRoomId ).

SFSEvent::onObjectReceived

See also:
  - sendObjectToGroup:userList:roomId:

  onObjectReceived (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) sendObjectToGroup: |  | (NSMutableDictionary *) | obj
userList: |  | (NSArray *) | userList
roomId: |  | (NSInteger) | roomId |

Send an Actionscript object to a group of users in the room. See sendObject for more info.

Parameters:

  | obj | : the Actionscript object to be sent.
  | userList | : an array containing the id(s) of the recipients.
  | roomId | : the id of the target room, in case of multi-room join (optional, default value: activeRoomId ).

SFSEvent::onObjectReceived

See also:
  - sendObject:roomId:

  onObjectReceived (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) sendPrivateMessage: |  | (NSString *) | message
recipientId: |  | (NSInteger) | recipientId
roomId: |  | (NSInteger) | roomId |

Send a private message to a user. The message is broadcasted to the recipient and the sender.

Parameters:

  | message | : the text of the private message.
  | recipientId | : the id of the recipient user.
  | roomId | : the id of the room from where the message is sent, in case of multi-room join (optional, default value: activeRoomId ).

SFSEvent::onPrivateMessage

See also:
  - sendPublicMessage:roomId:

  onPrivateMessage (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) sendPublicMessage: |  | (NSString *) | message
roomId: |  | (NSInteger) | roomId |

Send a public message. The message is broadcasted to all users in the current room, including the sender.

Parameters:

  | message | : the text of the public message.
  | roomId | : the id of the target room, in case of multi-room join (optional, default value: activeRoomId ).

SFSEvent::onPublicMessage

See also:
  - sendPrivateMessage:recipientId:roomId:

  onPublicMessage (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) sendString: |  | (NSString *) | strMessage |  |

- (void) sendXtMessage: |  | (NSString *) | xtName
cmd: |  | (NSString *) | cmd
paramObj: |  | (NSDictionary *) | paramObj
type: |  | (NSString *) | type
roomId: |  | (NSInteger) | roomId |

Send a request to a server side extension. The request can be serialized using three different protocols: XML, JSON and String-based (aka "raw protocol"). XML and JSON can both serialize complex objects with any level of nested properties, while the String protocol allows to send linear data delimited by a separator (see the rawProtocolSeperator property).

NOTE: the use JSON instead of XML is highly recommended, as it can save a lot of bandwidth. The String-based protocol can be very useful for realtime applications/games where reducing the amount of data is the highest priority.

Parameters:

  | xtName | : the name of the extension (see also the INFSmartFoxiPhoneClient#createRoom:roomId: method).
  | cmd | : the name of the action/command to execute in the extension.
  | paramObj | : an object containing the data to be passed to the extension (set to empty object if no data is required).
  | type | : the protocol to be used for serialization (optional). The following constants can be passed: INFSMARTFOX_XTMSG_TYPE_XML, INFSMARTFOX_XTMSG_TYPE_STR, INFSMARTFOX_XTMSG_TYPE_JSON.
  | roomId | : the id of the room where the request was originated, in case of multi-room join (optional, default value: activeRoomId ).

See also:
  rawProtocolSeparator

  INFSMARTFOXCLIENT_XTMSG_TYPE_XML

  INFSMARTFOXCLIENT_XTMSG_TYPE_JSON

  INFSMARTFOXCLIENT_XTMSG_TYPE_STR

  onExtensionResponse (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (void) setBuddyBlockStatus: |  | (NSString *) | buddyName
status: |  | (BOOL) | status |

Block or unblock a user in the buddy list. When a buddy is blocked, SmartFoxServer does not deliver private messages from/to that user.

Parameters:

  | buddyName | : the name of the buddy to be blocked or unblocked.
  | status | : true to block the buddy, false to unblock the buddy.

See also:
  _buddyList

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (void) setBuddyVariables: |  | (NSDictionary *) | varList |  |

Set the current user's Buddy Variables. This method allows to set a number of properties of the current user as buddy of other users; in other words these variables will be received by the other users who have the current user as a buddy.

Buddy Variables are the best way to share user's informations with all the other users having him/her in their buddy list.: for example the nickname, the current audio track the user is listening to, etc. The most typical usage is to set a variable containing the current user status, like "available", "occupied", "away", "invisible", etc.).

NOTE: before the release of SmartFoxServer Pro v1.6.0, Buddy Variables could not be stored, and existed during the user session only. SmartFoxServer Pro v1.6.0 introduced the ability to persist (store) all Buddy Variables and the possibility to save "offline Buddy Variables" (see the following usage notes).

Let's assume that three users (A, B and C) use an "istant messenger"-like application, and user A is part of the buddy lists of users B and C. If user A sets his own variables (using the setBuddyVariables method), the myBuddyVars array on his client gets populated and a onBuddyListUpdate (INFSmartFoxISFSEvents) event is dispatched to users B and C. User B and C can then read those variables in their own buddy lists by means of the variables property on the buddy object (which can be retrieved from the buddyList array by means of the getBuddyById or getBuddyByName methods).

If the buddy list's advanced security mode is used (see the SmartFoxServer server-side configuration), Buddy Variables persistence is enabled: in this way regular variables are saved when a user goes offline and they are restored (and dispatched to the other users) when their owner comes back online. Also, setting the <offLineBuddyVariables> parameter to true, offline variables can be used: this kind of Buddy Variables is loaded regardless the buddy is online or not, providing further informations for each entry in the buddy list. A typical usage for offline variables is to define a buddy image or additional informations such as country, email, rank, etc. To creare an offline Buddy Variable, the "$" character must be placed before the variable name.

Parameters:

  | varList | : an associative array, where the key is the name of the variable and the value is the variable's value. Buddy Variables should all be strings. If you need to use other data types you should apply the appropriate type casts.

SFSEvent::onBuddyListUpdate

See also:
  _myBuddyVars

  onBuddyListUpdate (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

SmartFoxServer Pro v1.6.0 - Buddy list's advanced security mode implemented (persistent and offline Buddy Variables).

Version:
  SmartFoxServer Basic (except advanced mode) / Pro

- (void) setRoomVariables: |  | (NSArray *) | varList
roomId: |  | (NSInteger) | roomId
setOwnership: |  | (BOOL) | setOwnership |

Set one or more Room Variables. Room Variables are a useful feature to share data across the clients, keeping it in a centralized place on the server. When a user sets/updates/deletes one or more Room Variables, all the other users in the same room are notified. Allowed data types for Room Variables are Numbers, Strings and Booleans; in order save bandwidth, Arrays and Objects are not supported. Nevertheless, an array of values can be simulated, for example, by using an index in front of the name of each variable (check one of the following examples). If a Room Variable is set to null, it is deleted from the server.

Parameters:

  | varList | : an array of objects with the properties described farther on.
  | roomId | : the id of the room where the variables should be set, in case of molti-room join (optional, default value: activeRoomId ).
  | setOwnership | : false to prevent the Room Variable change ownership when its value is modified by another user (optional).

Each Room Variable is an object containing the following properties:

Parameters:

  | name | : (String) the variable name.
  | val | : (*) the variable value.
  | priv | : (Boolean) if true, the variable can be modified by its creator only (optional, default value: false).
  | persistent | : (Boolean) if true, the variable will exist until its creator is connected to the current zone; if false, the variable will exist until its creator is connected to the current room (optional, default value: false).

SFSEvent::onRoomVariablesUpdate

See also:
  - getVariable: (INFSmartFoxRoom)

  - getVariables (INFSmartFoxRoom)

  onRoomVariablesUpdate (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) setUserVariables: |  | (NSDictionary *) | varObj
roomId: |  | (NSInteger) | roomId |

Set on or more User Variables. User Variables are a useful tool to store user data that has to be shared with other users. When a user sets/updates/deletes one or more User Variables, all the other users in the same room are notified. Allowed data types for User Variables are Numbers, Strings and Booleans; Arrays and Objects are not supported in order save bandwidth. If a User Variable is set to null, it is deleted from the server. Also, User Variables are destroyed when their owner logs out or gets disconnected.

Parameters:

  | varObj | : an object in which each property is a variable to set/update.
  | roomId | : the room id where the request was originated, in case of molti-room join (optional, default value: activeRoomId ).

SFSEvent::onUserVariablesUpdate

See also:
  - getVariable: (INFSmartFoxUser)

  - getVariables (INFSmartFoxUser)

  onUserVariablesUpdate (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (void) switchSpectator: |  | (NSInteger) | roomId |  |

Turn a spectator inside a game room into a player. All spectators have their player id property set to -1; when a spectator becomes a player, his player id gets a number > 0, representing the player number. The player id values are assigned by the server, based on the order in which the players joined the room. If the user joined more than one room, the id of the room where the switch should occurr must be passed to this method. The switch operation is successful only if at least one player slot is available in the room.

Parameters:

  | roomId | : the id of the room where the spectator should be switched, in case of molti-room join (optional, default value: activeRoomId ).

SFSEvent::onSpectatorSwitched

See also:
  - isSpectator (INFSmartFoxUser)

  onSpectatorSwitched (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

## Member Data Documentation

- (NSInteger) _activeRoomId

The property stores the id of the last room joined by the current user. In most multiuser applications users can join one room at a time: in this case this property represents the id of the current room. If multi-room join is allowed, the application should track the various id(s) in an array (for example) and this property should be ignored.

See also:
  - getActiveRoom

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (BOOL) _amIModerator

A boolean flag indicating if the user is recognized as Moderator.

See also:
  - sendModeratorMessage:type:id:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString*) _blueBoxIpAddress

The BlueBox IP address.

See also:
  _smartConnect

  - loadConfig:autoConnect:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSInteger) _blueBoxPort

The BlueBox connection port.

See also:
  _smartConnect

  - loadConfig:autoConnect:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSMutableDictionary*) _buddyList

An array containing the objects representing each buddy of the user's buddy list. The buddy list can be iterated with a for-in loop, or a specific object can be retrieved by means of the getBuddyById and getBuddyByName methods.

NOTE: this property and all the buddy-related method are available only if the buddy list feature is enabled for the current zone. Check the SmartFoxServer server-side configuration.

Each element in the buddy list is an object with the following properties:

Parameters:

  | id | : (int) the buddy id.
  | name | : (String) the buddy name.
  | isOnline | : (Boolean) the buddy online status: true if the buddy is online; false if the buddy is offline.
  | isBlocked | : (Boolean) the buddy block status: true if the buddy is blocked; false if the buddy is not blocked; when a buddy is blocked, SmartFoxServer does not deliver private messages from/to that user.
  | variables | : (Object) an object with extra properties of the buddy (Buddy Variables); see also setBuddyVariables .

See also:
  _myBuddyVars

  - loadBuddyList

  - getBuddyById:

  - getBuddyByName:

  - removeBuddy:

  - setBuddyBlockStatus:status:

  - setBuddyVariables:

  onBuddyList (INFSmartFoxISFSEvents)

  onBuddyListUpdate (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

SmartFoxServer Pro v1.6.0 - Buddy's isBlocked property added.

Version:
  SmartFoxServer Basic (except block status) / Pro

- (BOOL) _changingRoom

A boolean flag indicating if the process of joining a new room is in progress.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

- (BOOL) _debug

Toggle the client-side debugging informations. When turned on, the developer is able to inspect all server messages that are sent and received by the client in the Flash authoring environment. This allows a better debugging of the interaction with the server during application developement.

See also:
  onDebugMessage (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString*) _defaultZone

The default login zone.

See also:
  - loadConfig:autoConnect:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (NSInteger) _httpPort

The TCP port used by the embedded webserver. The default port is 8080; if the webserver is listening on a different port number, this property should be set to that value.

See also:
  uploadFile

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.5.0

Version:
  SmartFoxServer Basic / Pro

- (NSString*) _ipAddress

The SmartFoxServer IP address.

See also:
  - connect:port:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (NSMutableDictionary*) _myBuddyVars

The current user's Buddy Variables. This is an associative array containing the current user's properties when he/she is present in the buddy lists of other users. See the setBuddyVariables method for more details.

See also:
  - setBuddyVariables:

  - getBuddyById:

  - getBuddyByName:

  onBuddyList (INFSmartFoxISFSEvents)

  onBuddyListUpdate (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSInteger) _myUserId

The current user's SmartFoxServer id. The id is assigned to a user on the server-side as soon as the client connects to SmartFoxServer successfully.

NOTE: client-side, the myUserId property is available only after a successful login is performed using the default login procedure. If a custom login process is implemented, this property must be manually set after the successful login! If not, various client-side modules (SmartFoxBits, RedBox, etc.) may not work properly.

See also:
  myUserName

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString*) _myUserName

The current user's SmartFoxServer username.

NOTE: client-side, the myUserName property is available only after a successful login is performed using the default login procedure. If a custom login process is implemented, this property must be manually set after the successful login! If not, various client-side modules (SmartFoxBits, RedBox, etc.) may not work properly.

See also:
  myUserId

  - login:name:pass:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) _playerId

The current user's id as a player in a game room. The playerId is available only after the user successfully joined a game room. This id is 1-based (player 1, player 2, etc.), but if the user is a spectator or the room is not a game room, its value is -1. When a user joins a game room, a player id (or "slot") is assigned to him/her, based on the slots available in the room at the moment in which the user entered it; for example:

- in a game room for 2 players, the first user who joins it becomes player one (playerId = 1) and the second user becomes player two (player = 2);
- in a game room for 4 players where only player three is missing, the next user who will join the room will be player three (playerId = 3);

NOTE: if multi-room join is allowed, this property contains only the last player id assigned to the user, and so it's useless. In this case the getMyPlayerIndex method should be used to retrieve the player id for each joined room.

See also:
  - getMyPlayerIndex (INFSmartFoxRoom)

  - isGame (INFSmartFoxRoom)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSInteger) _port

The SmartFoxServer connection port. The default port is 9339.

See also:
  - connect:port:

Version:
  SmartFoxServer Pro

- (BOOL) _smartConnect

A boolean flag indicating if the BlueBox http connection should be used in case a socket connection is not available. The default value is true.

See also:
  - loadConfig:autoConnect:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

## Property Documentation

- (NSInteger) activeRoomId`[read, write, assign]`

- (BOOL) amIModerator`[read, write, assign]`

- (NSMutableDictionary*) buddyList`[read, assign]`

- (BOOL) changingRoom`[read, write, assign]`

- (id<INFSmartFoxISFSEvents>) delegate`[read, assign]`

- (NSInteger) httpPollSpeed`[read, write, assign]`

The minimum interval between two polling requests when connecting to SmartFoxServer via BlueBox module. The default value is 750 milliseconds. Accepted values are between 0 and 10000 milliseconds (10 seconds).

Which is the optimal value for polling speed? A value between 750-1000 ms is very good for chats, turn-based games and similar kind of applications. It adds minimum lag to the client responsiveness and it keeps the server CPU usage low. Lower values (200-500 ms) can be used where a faster responsiveness is necessary. For super fast real-time games values between 50 ms and 100 ms can be tried. With settings < 200 ms the CPU usage will grow significantly as the http connection and packet wrapping/unwrapping is more expensive than using a persistent connection. Using values below 50 ms is not recommended.

See also:
  _smartConnect

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSString *) INFSMARTFOXCLIENT_CONNECTION_MODE_DISCONNECTED`[read, assign]`

Connection mode: "disconnected". The client is currently disconnected from SmartFoxServer.

See also:
  - getConnectionMode

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSString *) INFSMARTFOXCLIENT_CONNECTION_MODE_HTTP`[read, assign]`

Connection mode: "http". The client is currently connected to SmartFoxServer via http.

See also:
  - getConnectionMode

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSString *) INFSMARTFOXCLIENT_CONNECTION_MODE_SOCKET`[read, assign]`

Connection mode: "socket". The client is currently connected to SmartFoxServer via socket.

See also:
  - getConnectionMode

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.6.0

Version:
  SmartFoxServer Pro

- (NSInteger) INFSMARTFOXCLIENT_EOM`[read, assign]`

- (NSString *) INFSMARTFOXCLIENT_MODMSG_TO_ROOM`[read, assign]`

Moderator message type: "to room". The Moderator message is sent to all the users in a room.

See also:
  - sendModeratorMessage:type:id:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) INFSMARTFOXCLIENT_MODMSG_TO_USER`[read, assign]`

Moderator message type: "to user". The Moderator message is sent to a single user.

See also:
  - sendModeratorMessage:type:id:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) INFSMARTFOXCLIENT_MODMSG_TO_ZONE`[read, assign]`

Moderator message type: "to zone". The Moderator message is sent to all the users in a zone.

See also:
  - sendModeratorMessage:type:id:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (NSString *) INFSMARTFOXCLIENT_MSG_JSON`[read, assign]`

- (NSString *) INFSMARTFOXCLIENT_MSG_XML`[read, assign]`

- (NSString *) INFSMARTFOXCLIENT_XTMSG_TYPE_JSON`[read, assign]`

Server-side extension request/response protocol: JSON.

See also:
  - sendXtMessage:cmd:paramObj:type:roomId:

  onExtensionResponse (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (NSString *) INFSMARTFOXCLIENT_XTMSG_TYPE_STR`[read, assign]`

Server-side extension request/response protocol: String (aka "raw protocol").

See also:
  - sendXtMessage:cmd:paramObj:type:roomId:

  onExtensionResponse (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (NSString *) INFSMARTFOXCLIENT_XTMSG_TYPE_XML`[read, assign]`

Server-side extension request/response protocol: XML.

See also:
  - sendXtMessage:cmd:paramObj:type:roomId:

  onExtensionResponse (INFSmartFoxISFSEvents)

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Pro

- (BOOL) isConnected`[read, write, assign]`

A boolean flag indicating if the current user is connected to the server.

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Version:
  SmartFoxServer Basic / Pro

- (mach_timebase_info_data_t) mach_timebase_info_data`[read, assign]`

- (NSMutableDictionary*) myBuddyVars`[read, assign]`

- (NSInteger) myUserId`[read, write, assign]`

- (NSString*) myUserName`[read, write, retain]`

- (NSInteger) playerId`[read, write, assign]`

- (NSString *) rawProtocolSeparator`[read, write, assign]`

Get/set the character used as separator for the String (raw) protocol. The default value is % (percentage character).

NOTE: this separator must match the one set in the SmartFoxServer server-side configuration file through the <RawProtocolSeparator> parameter.

See also:
  INFSMARTFOXCLIENT_XTMSG_TYPE_STR

  - sendXtMessage:cmd:paramObj:type:roomId:

Author:
  Infosfer Game and Visualization Technologies Ltd. http://www.infosfer.com

  Cem Uzunlar cem.uzunlar@infosfer.com

Since:
  SmartFoxServer Pro v1.5.5

Version:
  SmartFoxServer Pro