Changeset 42 for tabled.tac

Show
Ignore:
Timestamp:
02/07/08 15:46:20 (4 years ago)
Author:
mike
Message:

updated stuff

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tabled.tac

    r40 r42  
    8585clientChannels = [ r"\/poker" ] 
    8686 
    87 class WebClient(cometd.Client,BasePokerTableHandler): 
     87class PokerSubscription(cometd.ClientSubscription, BasePokerTableHandler): 
     88    def __init__(self, channel): 
     89        BasePokerTableHandler.__init__(self) 
     90        cometd.ClientSubscription.__init__(self, channel) 
     91 
     92    def messageReceived(self,message): 
     93        self.dataReceived(message) 
     94 
     95    def sendMessageViaTransport(self,data): 
     96        self.sendMessage(data) 
     97 
     98class WebClient(cometd.Client): 
    8899     
    89     def __init__(self, id=None, authSuccessful=False, authToken=None, lastError=""): 
    90         cometd.Client.__init__(self,id,authSuccessful,authToken,lastError) 
    91         print "INITIALIZING WEB CLIENT ((((" 
    92         BasePokerTableHandler.__init__(self) 
    93  
    94     def messageReceived(self,message,channel): 
    95         self.dataReceived(message) 
    96  
    97     def sendMessageViaTransport(self,data): 
    98         cometd.Client.sendMessage(self,data,"/poker") 
     100    def generateSubscription(self, channel): 
     101        return PokerSubscription( channel ) 
     102 
     103    def subscribe(self, channel): 
     104        #we only want poker channels 
     105        print "SUB ---------------- CHAN " + channel 
     106        if channel == "/poker": 
     107            return cometd.Client.subscribe(self,channel) 
     108        else: return False 
    99109 
    100110 
     
    217227print "Listening on localhost:%d(tcp) %d(http)" % (port, port2) 
    218228 
    219  
     229# vim:filetype=python