comparison orpg/networking/mplay_client.py @ 2:d5e81dac98ff grumpy-goblin

Made some changes to the way the player list colors. Also fixed an annoyence with images and the Message box that no longer shows.
author sirebral
date Tue, 14 Jul 2009 20:52:56 -0500
parents 4385a7d0efd1
children c54768cffbd4
comparison
equal deleted inserted replaced
1:f24c6e431a15 2:d5e81dac98ff
116 self.id = "0" 116 self.id = "0"
117 self.group_id = "0" 117 self.group_id = "0"
118 self.name = "" 118 self.name = ""
119 self.role = "GM" 119 self.role = "GM"
120 self.ROLE_GM = "GM" 120 self.ROLE_GM = "GM"
121 self.ROLE_PLAYER = "PLAYER" 121 self.ROLE_PLAYER = "Player"
122 self.ROLE_LURKER = "LURKER" 122 self.ROLE_LURKER = "Lurker"
123 self.ip = socket.gethostbyname(socket.gethostname()) 123 self.ip = socket.gethostbyname(socket.gethostname())
124 self.remote_ip = None 124 self.remote_ip = None
125 self.version = VERSION 125 self.version = VERSION
126 self.protocol_version = PROTOCOL_VERSION 126 self.protocol_version = PROTOCOL_VERSION
127 self.client_string = CLIENT_STRING 127 self.client_string = CLIENT_STRING
132 self.sock = None 132 self.sock = None
133 self.text_status = "Idle" 133 self.text_status = "Idle"
134 self.statLock = Lock() 134 self.statLock = Lock()
135 self.useroles = 0 135 self.useroles = 0
136 self.ROLE_GM = "GM" 136 self.ROLE_GM = "GM"
137 self.ROLE_PLAYER = "PLAYER" 137 self.ROLE_PLAYER = "Player"
138 self.ROLE_LURKER = "LURKER" 138 self.ROLE_LURKER = "Lurker"
139 self.lastmessagetime = time.time() 139 self.lastmessagetime = time.time()
140 self.connecttime = time.time() 140 self.connecttime = time.time()
141 141
142 def sendThread( self, arg ): 142 def sendThread( self, arg ):
143 "Sending thread. This thread reads from the data queue and writes to the socket." 143 "Sending thread. This thread reads from the data queue and writes to the socket."
629 self.outbox.put("<create_group from=\""+self.id+"\" pwd=\""+pwd+"\" name=\""+ 629 self.outbox.put("<create_group from=\""+self.id+"\" pwd=\""+pwd+"\" name=\""+
630 name+"\" boot_pwd=\""+boot_pwd+"\" min_version=\"" + minversion +"\" />") 630 name+"\" boot_pwd=\""+boot_pwd+"\" min_version=\"" + minversion +"\" />")
631 631
632 def send_join_group(self,group_id,pwd): 632 def send_join_group(self,group_id,pwd):
633 if (group_id != 0): 633 if (group_id != 0):
634 self.update_role("LURKER") 634 self.update_role("Lurker")
635 self.outbox.put("<join_group from=\""+self.id+"\" pwd=\""+pwd+"\" group_id=\""+str(group_id)+"\" />") 635 self.outbox.put("<join_group from=\""+self.id+"\" pwd=\""+pwd+"\" group_id=\""+str(group_id)+"\" />")
636 636
637 def poll(self, evt=None): 637 def poll(self, evt=None):
638 try: 638 try:
639 msg = self.inbox.get_nowait() 639 msg = self.inbox.get_nowait()