Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/client/src/AphlictClient.as
| Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | final public class AphlictClient extends Aphlict { | ||||
| private function connectToMaster():void { | private function connectToMaster():void { | ||||
| this.timer.stop(); | this.timer.stop(); | ||||
| // Try to become the master. | // Try to become the master. | ||||
| try { | try { | ||||
| this.log('Attempting to become the master...'); | this.log('Attempting to become the master...'); | ||||
| this.master = new AphlictMaster(this.remoteServer, this.remotePort); | this.master = new AphlictMaster(this.remoteServer, this.remotePort); | ||||
| this.log('I am the master.'); | this.log('I am the master.'); | ||||
| } catch (x:Error) { | } catch (err:ArgumentError) { | ||||
| // Couldn't become the master | |||||
| this.log('Cannot become the master... probably one already exists'); | this.log('Cannot become the master... probably one already exists'); | ||||
| } catch (err:Error) { | |||||
| this.error(err); | |||||
| } | } | ||||
| this.send.send('aphlict_master', 'register', this.client); | this.send.send('aphlict_master', 'register', this.client); | ||||
| this.expiry = new Date().getTime() + (5 * AphlictClient.INTERVAL); | this.expiry = new Date().getTime() + (5 * AphlictClient.INTERVAL); | ||||
| this.log('Registered client ' + this.client); | this.log('Registered client ' + this.client); | ||||
| this.timer.start(); | this.timer.start(); | ||||
| } | } | ||||
| Show All 36 Lines | |||||