本文整理汇总了Python中java.net.URL.disconnect方法的典型用法代码示例。如果您正苦于以下问题:Python URL.disconnect方法的具体用法?Python URL.disconnect怎么用?Python URL.disconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.net.URL
的用法示例。
在下文中一共展示了URL.disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onAdvEvent
# 需要导入模块: from java.net import URL [as 别名]
# 或者: from java.net.URL import disconnect [as 别名]
def onAdvEvent(self, event, npc, player):
if event == 'ad':
try:
c = URL('http://duck5duck.mooo.com/l2jtw_ad/l2jtw_ad.php').openConnection()
if c:
c.setDoOutput(True)
o = DataOutputStream(c.getOutputStream())
s = self.param % (
C.RATE_XP
, C.RATE_SP
, C.RATE_PARTY_XP
, C.RATE_PARTY_SP
, C.PARTY_XP_CUTOFF_LEVEL
, C.PET_XP_RATE
, C.RATE_DROP_ITEMS
, C.RATE_DROP_ITEMS_BY_RAID
, C.RATE_DROP_MANOR
, C.RATE_QUEST_DROP
, C.RATE_DROP_ITEMS_ID.get(57) or 1.0
, C.BUFFS_MAX_AMOUNT
, C.TRIGGERED_BUFFS_MAX_AMOUNT
, C.DANCES_MAX_AMOUNT
, C.RUN_SPD_BOOST
, C.MAX_RUN_SPEED
, C.MAX_PCRIT_RATE
, C.MAX_MCRIT_RATE
, C.MAX_PATK_SPEED
, C.MAX_MATK_SPEED
, C.MAX_EVASION
, C.MAX_SUBCLASS
, C.BASE_SUBCLASS_LEVEL
, C.MAX_SUBCLASS_LEVEL
, C.INVENTORY_MAXIMUM_NO_DWARF
, C.INVENTORY_MAXIMUM_DWARF
, C.INVENTORY_MAXIMUM_QUEST_ITEMS
, C.WAREHOUSE_SLOTS_NO_DWARF
, C.WAREHOUSE_SLOTS_DWARF
, C.WAREHOUSE_SLOTS_CLAN
, C.MAX_ADENA/100000000
, C.MAXIMUM_ONLINE_USERS
, C.ENCHANT_CHANCE_ELEMENT_STONE
, C.ENCHANT_CHANCE_ELEMENT_CRYSTAL
, C.ENCHANT_CHANCE_ELEMENT_JEWEL
, C.ENCHANT_CHANCE_ELEMENT_ENERGY
, C.ENCHANT_SAFE_MAX
, C.ENCHANT_SAFE_MAX_FULL
, C.CLAN_LEVEL_6_COST
, C.CLAN_LEVEL_7_COST
, C.CLAN_LEVEL_8_COST
, C.CLAN_LEVEL_9_COST
, C.CLAN_LEVEL_10_COST
, C.CLAN_LEVEL_11_COST
, C.CLAN_LEVEL_6_REQUIREMENT
, C.CLAN_LEVEL_7_REQUIREMENT
, C.CLAN_LEVEL_8_REQUIREMENT
, C.CLAN_LEVEL_9_REQUIREMENT
, C.CLAN_LEVEL_10_REQUIREMENT
, C.CLAN_LEVEL_11_REQUIREMENT
, L2World.getInstance().getAllPlayersCount()
, self.getRealOnline()
, URLEncoder.encode(self.link, 'utf-8')
, URLEncoder.encode(self.intro, 'utf-8')
)
o.write(s)
o.flush()
o.close()
i = c.getInputStream()
r = ""
while True:
ch = i.read()
if ch == -1:
break
r += chr(ch)
if len(r):
print r
i.close()
c.disconnect()
except:
return