Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Functions
SMCONNEC

State Machine for connecting to server. More...

Data Structures

struct  T_smClientData
 

Functions

void HangUp (void)
 
T_void SMClientConnectAbortConnection (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectBusyMessage (T_stateMachineHandle handle, T_word32 extraData)
 
E_Boolean SMClientConnectCheckFlag (T_stateMachineHandle handle, T_word32 flag)
 
T_void SMClientConnectConnectionResolved (T_stateMachineHandle handle, T_word32 extraData, E_Boolean isDestroyed)
 
T_void SMClientConnectConnectToServer (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectDisplayExitMessage (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectFinish (T_void)
 
T_void SMClientConnectFinishData (T_stateMachineHandle handle)
 
T_void SMClientConnectGetServerID (T_stateMachineHandle handle, T_word32 extraData)
 
T_connUIStructSMClientConnectGetServerInfo (T_void)
 
T_void SMClientConnectGotoStart (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectIncorrectServerID (T_stateMachineHandle handle, T_word32 extraData)
 
T_stateMachineHandle SMClientConnectInit (T_void)
 
T_void SMClientConnectInitData (T_stateMachineHandle handle)
 
E_Boolean SMClientConnectIsDone (T_void)
 
T_void SMClientConnectLogoutAndHangup (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectLookForServerID (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectNoConnectMessage (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectNoServerID (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectReady (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectSelectServer (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectSelectServerIdle (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectSendLogin (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectServerNotAckLogin (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectServerSelected (T_stateMachineHandle handle, T_word32 extraData, E_Boolean isDestroyed)
 
T_void SMClientConnectSetFlag (T_word32 flag, E_Boolean state)
 
T_void SMClientConnectSetServerInfo (T_connUIStruct *p_server)
 
T_void SMClientConnectUpdate (T_void)
 
T_void SMClientConnectWaitForLogin (T_stateMachineHandle handle, T_word32 extraData)
 
T_void SMClientConnectWaitForStart (T_stateMachineHandle handle, T_word32 extraData)
 

Detailed Description

State Machine for connecting to server.

Connect to server state machine. Deprecated?

See Also
http://www.amuletsandarmor.com/AALicense.txt

Function Documentation

void HangUp ( void  )
T_void SMClientConnectAbortConnection ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectAbortConnection

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectBusyMessage ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectBusyMessage states that the connection failed because the line was busy.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
E_Boolean SMClientConnectCheckFlag ( T_stateMachineHandle  handle,
T_word32  flag 
)

SMClientConnectCheckFlag checks to see if one of the state flags of the client connect state machine is set.

Parameters
handle– State machine
flag– Flag to get value of
Returns
State of flag
T_void SMClientConnectConnectionResolved ( T_stateMachineHandle  handle,
T_word32  extraData,
E_Boolean  isDestroyed 
)

SMClientConnect

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
isDestroyed– Flag if state machine destroyed
T_void SMClientConnectConnectToServer ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnect

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectDisplayExitMessage ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectDisplayExitMessage displays the exit message that the server sent down when it exited.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectFinish ( T_void  )

SMClientConnectFinish cleans up the client connect state machine's data.

T_void SMClientConnectFinishData ( T_stateMachineHandle  handle)

SMClientConnectFinishData destroys the data attached to the client connect state machine.

Parameters
handle– state machine
T_void SMClientConnectGetServerID ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectGetServerID starts a request to the server for its unique server id.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_connUIStruct* SMClientConnectGetServerInfo ( T_void  )

SMClientConnectGetServerInfo returns a pointer to the connection ui server structure.

Returns
POinter to structure
T_void SMClientConnectGotoStart ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectGotoStart requests to enter the server.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectIncorrectServerID ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectIncorrectServerID is called when the server responds with a different server ID than what is expected. The client then logs off with an error message.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_stateMachineHandle SMClientConnectInit ( T_void  )

SMClientConnectInit sets up the state machine and its data.

T_void SMClientConnectInitData ( T_stateMachineHandle  handle)

SMClientConnectInitData creates the data necessary to be associated to the client connect state machine.

Parameters
handle– state machine
E_Boolean SMClientConnectIsDone ( T_void  )

SMClientConnectIsDone checks if the client connect state machine has reached its end and is done.

Returns
Done if TRUE
T_void SMClientConnectLogoutAndHangup ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnect

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectLookForServerID ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectLookForServerID sits and constantly checks to see if the client has gotten a server id. When it gets it, it compares to see if this is what was supposed to be gotten.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectNoConnectMessage ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectNoConnectMessage states that a time out occured and a connection could not be established.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectNoServerID ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectNoServerID is called when the request for the server ID times out and doesn't get a response. This routine politely hangs up the phone and returns to the main screen.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectReady ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnect

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectSelectServer ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectSelectServer is called at the beginning of the SELECT_SERVER state. This routine brings up the UI for choosing a server.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectSelectServerIdle ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectSelectServerIdle is called while in the state of SELECT_SERVER.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectSendLogin ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectSendLogin starts up the actual login process with the server. A login packet is sent and the state will wait until it times out or receives login acknowledgement.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectServerNotAckLogin ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnect

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectServerSelected ( T_stateMachineHandle  handle,
T_word32  extraData,
E_Boolean  isDestroyed 
)

SMClientConnectServerSelected is called after the conn ui screen has been shown and is now done.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
isDestroyed– End flag
T_void SMClientConnectSetFlag ( T_word32  flag,
E_Boolean  state 
)

SMClientConnectSetFlag sets a flag for the client connect state machine to process as part of its states.

Parameters
flag– Flag to set
state– State to set flag to
T_void SMClientConnectSetServerInfo ( T_connUIStruct p_server)

SMClientConnectSetServerInfo declares which server the connection will occur with.

Parameters
p_server– Server info to use
T_void SMClientConnectUpdate ( T_void  )

SMClientConnectUpdate updates the client connect state machine.

T_void SMClientConnectWaitForLogin ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectWaitForLogin is the idle routine for the state of SEND_LOGIN_AND_WAIT. This routine checks to see if the client is logged in or times out.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used
T_void SMClientConnectWaitForStart ( T_stateMachineHandle  handle,
T_word32  extraData 
)

SMClientConnectWaitForState waits until it is decided where the player will start the game.

Parameters
handle– Handle to PHASE A client state machine
extraData– Not used