Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Client() {
- this.state = "loggedoff"
- }
- //attempt to say something, will attempt login every time and keep you at as far as you have gotten
- Client.prototype.say = function(msg) {
- switch(this.state) {
- case "loggedoff":
- this.queueLogin()
- case "authenticated":
- this.queueVoiceRequest()
- case "voiced":
- this.queueMessage(msg)
- break
- //banned etc.
- default:
- throw "not allowed"
- }
- }
Add Comment
Please, Sign In to add comment