Пример #1
0
def main(pc):
	usermap_obj = usermaps.get_usermap_from_map_id(pc.map_obj.map_id)
	if not usermap_obj:
		script.msg(pc, "rope error: usermap id %s not exist"%pc.map_obj.map_id)
		return
	general.log(usermap_obj.master, pc)
	if usermap_obj.master == pc:
		master_event(pc, usermap_obj)
	else:
		guest_event(pc, usermap_obj)
Пример #2
0
def main(pc):
    usermap_obj = usermaps.get_usermap_from_map_id(pc.event_id)
    if not usermap_obj:
        script.msg(pc, "rope error: usermap id %s not exist" % pc.event_id)
        return
    general.log(usermap_obj.master, pc)
    if usermap_obj.master == pc:
        master_event(pc)
    else:
        guest_event(pc)
Пример #3
0
 def _set_map(self, map_id=None):
     if not map_id:
         map_id = self.map_id
     if usermaps.map_id_in_range_flygarden(map_id):
         map_obj = usermaps.get_usermap_from_map_id(map_id)
     else:
         map_obj = db.map_obj.get(map_id)
     if not map_obj:
         return False
     #general.log(self, "set_map", map_obj)
     with self.user.lock:
         self.unset_pet()
         if map_id:
             self.map_send_map_without_self("1211", self)  #PC消去
     self.map_id = map_id
     if self.map_obj:
         with self.map_obj.lock:
             self.map_obj.pc_list.remove(self)
     self.map_obj = map_obj
     with self.map_obj.lock:
         if self not in self.map_obj.pc_list:
             with self.map_obj.lock:
                 self.map_obj.pc_list.append(self)
     return True
Пример #4
0
	def _set_map(self, map_id=None):
		if not map_id:
			map_id = self.map_id
		if usermaps.map_id_in_range_flygarden(map_id):
			map_obj = usermaps.get_usermap_from_map_id(map_id)
		else:
			map_obj = db.map_obj.get(map_id)
		if not map_obj:
			return False
		#general.log(self, "set_map", map_obj)
		with self.user.lock:
			self.unset_pet()
			if map_id:
				self.map_send_map_without_self("1211", self) #PC消去
		self.map_id = map_id
		if self.map_obj:
			with self.map_obj.lock:
				self.map_obj.pc_list.remove(self)
		self.map_obj = map_obj
		with self.map_obj.lock:
			if self not in self.map_obj.pc_list:
				with self.map_obj.lock:
					self.map_obj.pc_list.append(self)
		return True