原地址:http://bbs.gameres.com/thread_223717.html
屌丝一枚,没有MAC 更没有XCODE
潜心整了星期六与星期天两天才安装运行成功。。。
只能说安装太复杂了,,,新手入门不易。。。
总结如下:
一、win7 64位服务端的安装与运行
1. 安装python2.7 E:\software\other\python-2.7.5.amd64.msi
2、安装mySQL E:\software\DB\mysql-5.5.15-winx64.msi
3、安装easy_install D:\web\game\DiabloSrc\firefly-install\ez_setup.py
注意:win7 64位必须使用ez_setup.py进行安装。方法是下载ez_setup.py后,在cmd下执行 python ez_setup.py,即
可自动安装setuptools。目前没有直接的exe安装版本。
下载完成后双击执行安装文件,即可在D:\Program Files\python2.7\scripts下安装easy_install。包含一个
easy_install.exe,然后进行环境变量设置,在系统环境变量中做如下设置:
(也就是将D:\Program Files\python2.7\scripts添加到环境变量中)
此时可以在控制台看easy_install 是否安装上了。
Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\zhuyupeng>easy_install
error: No urls, filenames, or requirements specified (see --help)
4、twisted D:\web\game\DiabloSrc\firefly-install\Twisted-13.1.0.win-amd64-py2.7.exe
(windows下可以直接用Twisted-12.2.0.win32-py2.6.exe进行安装,如果是python2.7的可以使用Twisted-12.2.0.win32-py2.7.exe)
5、easy_install python-memcached
easy_install DBUtils
easy_install zope.interface
easy_install affinity
6、MySQL-python D:\web\game\DiabloSrc\firefly-install\MySQL-python-1.2.4.win-amd64-py2.7.exe
7、pywin32-214.win32-py2.6.exe D:\web\game\DiabloSrc\firefly-install\pywin32-214.win32-py2.6.exe
windows下必装
http://starship.python.net/crew/mhammond/downloads/
8、下载 memcached-win64.zip 运行 启动Memcached服务
A、在控制台输入命令安装:
c:/memcached/memcached.exe -d install
B、启动:
c:/memcached/memcached.exe -d start
C、验证
此时可以访问一下服务器:打开-运行-cmd-telnet 127.0.0.1 11211
输入命令stats 出现如下所示即成功
<ignore_js_op>
9、安装Firefly
跳转到firefly目录下,
python setup.py build
python setup.py install
10、启动mysql服务器,执行anheisj.sql 脚本 source D:\web\game\DiabloSrc\firefly-install\anheisj.sql
11、进入DiabloWorld-server-v1.x目录,修改config.json 里memcached服务器地质及mysql数据库host地址;
"db":{
"host":"localhost",
"user":"root",
"passwd":"wxh123",
"port":3306,
"db":"anheisg",
"charset":"utf8"
},
"memcached":{
"urls":["127.0.0.1:11211"],
"hostname":"anheisg"
}
12、 终端运行 python startmaster.py
13、修改客户端的SocketManager.cpp文件
_socket = new SocketClient("192.168.1.103",11009,1,1,NULL);
其中192.168.1.103为你的IP地址
11009 为config.json 中的 netport
{
"master":{"rootport":9999,"webport":9998},
"servers":{
"gate":{"rootport":10000,"name":"gate","db":true,"app":"app.gateserver","log":"app/logs/gate.log"},
"dbfront":{"name":"dbfront","db":true,"mem":true,"app":"app.dbfrontserver","log":"app/logs/dbfront.log"},
"net":{"netport":11009,"name":"net","remoteport":[{"rootport":10000,"rootname":"gate"}],"app":"app.netserver","log":"app/logs/net.log"},
"game1":{"remoteport":[{"rootport":10000,"rootname":"gate"}],
"name":"game1","db":true,"mem":true,"app":"app.gameserver","reload":"app.game.doreload","log":"app/logs/game1.log"},
"game2":{"remoteport":[{"rootport":10000,"rootname":"gate"}],
"name":"game2","db":true,"mem":true,"app":"app.gameserver","reload":"app.game.doreload","log":"app/logs/game2.log"}
}
二、win7 64位客户端运行
1、进入cygwin终端,运行
cd /cygdrive/e/software/game/cocos2d-x-2.1.4/project/DiabloWorld-V1.1/proj.android
sh bulid_native.sh
生成对应的libcocos2dcpp.so
2、导入eclipse中 导入eclipse里面。然后运行。
三、遇到的问题:
Q:Compile++ thumb : cocos2dcpp_shared <= MyXmlParser.cpp
make: *** 没有规则可以创建“obj/local/armeabi/objs/cocos_extension_static/AssetsM anager/AssetsManager.o”需要的目标“/Users/jie/Documents/cocos2d-x-2.1.4/projects/ tsDemo/proj.android/../../../extensions/AssetsManager/AssetsManager.cpp”。 停止 。
make: 离开目录“/cygdrive/e/software/game/cocos2d-x-2.1.4/project/DiabloWorld-Cli ent-V1.3/proj.android”
A: 若是看到有
no rule to make(没有规则可以创建)字样了,那就把libs和obj文件夹删除,再编译一次,就OK了!
Q:Activity cannot be resolved to a type
A:将cocos2d-x-2.1.4\samples\Cpp\HelloCpp\proj.android\src\org\cocos2dx\lib 下的文件拷入
再将Andorid 2.2 加入到libraries中
Q:无法联接服务器:一直返回null
A: 测试下本地服务端口有没有被占用
netstat -ano|findstr "11009" 如果有的话,说明服务开启正常
Q:sh bulid_native.sh 运行比较慢
由于 bulid_native.sh 中下面的shell命令每次 都会拷贝图片到assets目录,实际上没有必要注释掉,能省不时间
# make sure assets is exist
#if [ -d "$APP_ANDROID_ROOT"/assets ]; then
# rm -rf "$APP_ANDROID_ROOT"/assets
#fi
#
#mkdir "$APP_ANDROID_ROOT"/assets
#
# copy resources
#for file in "$APP_ROOT"/Resources/*
#do
#if [ -d "$file" ]; then
# cp -rf "$file" "$APP_ANDROID_ROOT"/assets
#fi
#
#if [ -f "$file" ]; then
# cp "$file" "$APP_ANDROID_ROOT"/assets
#fi
#done
Q:
2013-08-26 22:58:11+0800 [BilateralBroker,2,127.0.0.1] Peer will receive followi
ng PB traceback:
2013-08-26 22:58:11+0800 [BilateralBroker,2,127.0.0.1] Unhandled Error
Traceback from remote host -- Traceback unavailable
exceptions.ValueError: invalid literal for int() with base 10: ‘None‘
2013-08-26 22:58:11+0800 [Broker,client] "[Failure instance: Traceback from remo
te host -- Traceback unavailable\nexceptions.ValueError: invalid literal for int
() with base 10: ‘None‘\n]"
A: 一般要重启下memcache服务器。
我是将memeache拱建在建一个电脑上。OK