东方符斗祭官方论坛

找回密码
加入幻想乡

QQ登录

只需一步,快速开始

搜索
收起/展开

当前在线玩家

游戏大厅      在房间中       准备状态       游戏中       观战中      
收起/展开

『文々。新闻』

查看: 903|回复: 6

[PATCH]缺乏ipv6支持

[复制链接]

存在感: 1 天

[LV.1]呆毛

单身中……
帮我摆脱单身吧
发表于 2012-9-9 20:59:42 | 显示全部楼层 |阅读模式
@Proton
应从代码中去除ipv4假定。

diff --git a/src/client/core/executive.py b/src.new/client/core/executive.py
index 4abad2f..12f3e4e 100644
--- a/src/client/core/executive.py
+++ b/src.new/client/core/executive.py
@@ -145,8 +145,7 @@ class Executive(object):
                 cb('server_already_connected')
                 return
             try:
-                s = socket.socket()
-                s.connect(addr)
+                s = socket.create_connection(addr)
                 svr = Server.spawn(s, 'TheChosenOne')
                 self.server = svr
                 self.state = 'connected'
diff --git a/src/start_client.py b/src.new/start_client.py
index 842a702..5bee59f 100644
--- a/src/start_client.py
+++ b/src.new/start_client.py
@@ -41,7 +41,7 @@ class MainThread(threading.Thread):
         def getaddrinfo_wrapper(host, port, family=0, socktype=0, proto=0, flags=0):
             while True:
                 try:
-                    return orig_getaddrinfo(host, port, socket.AF_INET, socktype, proto, flags)
+                    return orig_getaddrinfo(host, port, family, socktype, proto, flags)
                 except dns.DNSError as e:
                     if not e.errno == 2: # dns server fail thing
                         raise





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入幻想乡

x

存在感: 8 天

[LV.3]毛玉II

吹风姬
幸福:147℃
发表于 2012-9-9 21:16:17 | 显示全部楼层
有必要么……

至少目前我还没有接触到货真价实的ipv6……
回复 支持 反对

使用道具 举报

存在感: 34 天

[LV.5]触手I

单身中……
帮我摆脱单身吧
发表于 2012-9-9 21:24:15 | 显示全部楼层
天朝要和世界接轨了吗
回复 支持 反对

使用道具 举报

存在感: 1 天

[LV.1]呆毛

单身中……
帮我摆脱单身吧
 楼主| 发表于 2012-9-9 22:10:57 | 显示全部楼层
本帖最后由 zhyk 于 2012-9-9 22:14 编辑
Proton 发表于 2012-9-9 21:16
有必要么……

至少目前我还没有接触到货真价实的ipv6……

寝室只能用ipv6……


不更新的话我只能用NO_UPDATE了


patch我已经测试过了,修改的地方也不多,所以还是更新一下吧
回复 支持 反对

使用道具 举报

存在感: 8 天

[LV.3]毛玉II

吹风姬
幸福:147℃
发表于 2012-9-9 22:27:34 | 显示全部楼层
好吧 我明天处理……
回复 支持 反对

使用道具 举报

存在感: 2 天

[LV.1]呆毛

单身中……
帮我摆脱单身吧
发表于 2012-9-9 23:36:21 | 显示全部楼层
中国有V6?
回复 支持 反对

使用道具 举报

存在感: 223 天

[LV.7]触手III

藤原·妹紅
幸福:20191℃
发表于 2012-9-9 23:38:32 煞笔球保护协会 | 显示全部楼层
好高端的谈话,IPV6很久以前就说要建来自: Android客户端
回复 支持 反对

使用道具 举报

高级模式
您需要登录后才可以回帖 登录 | 加入幻想乡

本版积分规则

幻想梦斗符

申请友链|小黑屋|手机版|Archiver|东方符斗祭官方论坛

GMT+8, 2024-5-14 13:13 , Processed in 0.054781 second(s), 40 queries , APC On.

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表