RO_Server IP:192.168.6.18
WebServer IP:192.168.6.18
修改Develop_Android下的IP和端口
\Develop_Android\Assets\Resources\Script\FrameWork\GUI\view\StartGamePanel.txt [327行,改为子服务器IP]
----Source----
local checkurl = "103.85.85.216:9797/login/index.php"
----Fix----
local checkurl = "192.168.6.18/login/index.php"
\Develop_Android\Assets\Resources\Script\Net\NetConfig.txt [批量替换]
16行18889改为8889
----Source----
NetConfig = {}
-- 新的外网 用这个端口号吧 12001
NetConfig.PUBLIC_SPECIAL_SERVER_IP = "103.85.85.216"
NetConfig.PUBLIC_SPECIAL_SERVER_PORT = 10000
NetConfig.PRIVATE_GAME_SERVER_IP = "103.85.85.216"
NetConfig.PRIVATE_GAME_SERVER_PORT = 9000
NetConfig.PUBLIC_GAME_SERVER_IP = "103.85.85.216"
NetConfig.PUBLIC_GAME_SERVER_PORT = 5000
NetConfig.PrivateAuthServerUrl = "103.85.85.216"
NetConfig.PrivateAuthServerUrlPort = 5556
NetConfig.PrivateGameServerUrl = "103.85.85.216"
NetConfig.PrivateGameServerUrlPort = 18889
NetConfig.PriorityMessages = {
{id1=5, id2=23}
}
NetConfig.AnnounceAddress = "103.85.85.216/ro"
--sdk login
NetConfig.AccessTokenAuthHost = {CN = {"103.85.85.216","103.85.85.216"},EN = {"103.85.85.216"}}
NetConfig.NewAccessTokenAuthHost = {"1192.168.1.166","103.85.85.216","103.85.85.216"}
------------!!!!!!!!!!!!!!!!-------------------
NetConfig.GateHost = {CN = {"103.85.85.216","103.85.85.216"},EN = {"103.85.85.216"}}
NetConfig.NewGateHost = {"103.85.85.216","103.85.85.216","103.85.85.216"}
NetConfig.NewGateHost_NOTEST = {"103.85.85.216","103.85.85.216","103.85.85.216"}
--高防域名
NetConfig.NewGateHostGf = NetConfig.NewGateHost[1]
--海外域名
NetConfig.NewGateHostFg = NetConfig.NewGateHost[3]
----Fix----
NetConfig = {}
-- 新的外网 用这个端口号吧 12001
NetConfig.PUBLIC_SPECIAL_SERVER_IP = "192.168.6.18"
NetConfig.PUBLIC_SPECIAL_SERVER_PORT = 10000
NetConfig.PRIVATE_GAME_SERVER_IP = "192.168.6.18"
NetConfig.PRIVATE_GAME_SERVER_PORT = 9000
NetConfig.PUBLIC_GAME_SERVER_IP = "192.168.6.18"
NetConfig.PUBLIC_GAME_SERVER_PORT = 5000
NetConfig.PrivateAuthServerUrl = "192.168.6.18"
NetConfig.PrivateAuthServerUrlPort = 5556
NetConfig.PrivateGameServerUrl = "192.168.6.18"
NetConfig.PrivateGameServerUrlPort = 8889
NetConfig.PriorityMessages = {
{id1=5, id2=23}
}
NetConfig.AnnounceAddress = "192.168.6.18/ro"
--sdk login
NetConfig.AccessTokenAuthHost = {CN = {"192.168.6.18","192.168.6.18"},EN = {"192.168.6.18"}}
NetConfig.NewAccessTokenAuthHost = {"1192.168.1.166","192.168.6.18","192.168.6.18"}
------------!!!!!!!!!!!!!!!!-------------------
NetConfig.GateHost = {CN = {"192.168.6.18","192.168.6.18"},EN = {"192.168.6.18"}}
NetConfig.NewGateHost = {"192.168.6.18","192.168.6.18","192.168.6.18"}
NetConfig.NewGateHost_NOTEST = {"192.168.6.18","192.168.6.18","192.168.6.18"}
--高防域名
NetConfig.NewGateHostGf = NetConfig.NewGateHost[1]
--海外域名
NetConfig.NewGateHostFg = NetConfig.NewGateHost[3]
----Source----
--game server
NetConfig.AliyunSecurityIPSdkAppkey = ""
NetConfig.AliyunSecurityIPSdkServerGroup = {CN = {{"103.85.85.216","103.85.85.216"},{"103.85.85.216","103.85.85.216"},{"103.85.85.216","103.85.85.216"},{"103.85.85.216","103.85.85.216"}},EN = {}}
-- NetConfig.AliyunSecurityIPSdkServerGroup = {CN = {{"103.85.85.216","103.85.85.216"},{"103.85.85.216","103.85.85.216"}},EN = {{}}}
NetConfig.AliyunNetDelayDelta = 80 -- 游戏盾允许的最大延迟差
----Fix----
--game server
NetConfig.AliyunSecurityIPSdkAppkey = ""
NetConfig.AliyunSecurityIPSdkServerGroup = {CN = {{"192.168.6.18","192.168.6.18"},{"192.168.6.18","192.168.6.18"},{"192.168.6.18","192.168.6.18"},{"192.168.6.18","192.168.6.18"}},EN = {}}
-- NetConfig.AliyunSecurityIPSdkServerGroup = {CN = {{"192.168.6.18","192.168.6.18"},{"192.168.6.18","192.168.6.18"}},EN = {{}}}
NetConfig.AliyunNetDelayDelta = 80 -- 游戏盾允许的最大延迟差
编译:
Develop_Android:
AssetBundle->AssetBundleName设置->lua脚本 [大约耗时2分钟]
AssetBundle->纯打包(不扫描资源) [修改两个文件大约耗时12分钟左右,全部打包的话大约耗时7小时]
----------------------------------------------------------------------------------------------
这时Develop_Android编译后可以运行了
BuildAndroid:
\BuildAndroid\Assets\Code\Game\Version\ServerVersionCheckOpt.cs [改为子服务器IP]
----Source----
_cdnAddress = "
To view the content, you need to sign in or register
" + ApplicationHelper.platformFolder + "/";
----Fix----
_cdnAddress = "
To view the content, you need to sign in or register
" + ApplicationHelper.platformFolder + "/";
----Source----
Application.OpenURL ("
To view the content, you need to sign in or register
" + chinese);
----Fix----
Application.OpenURL ("
To view the content, you need to sign in or register
" + chinese);
\BuildAndroid\Assets\Resources\HttpOperationJson.txt [改为子服务器IP]
----Source----
{"urls":["
To view the content, you need to sign in or register
"],"elements":{"plat":"1"}}
----Fix----
{"urls":["
To view the content, you need to sign in or register
"],"elements":{"plat":"1"}}
----------------------------------------------------------------------------------------------
将
\Develop_Android\Assets\AssetBundles\Android\resources\script2\framework.unity3d
\Develop_Android\Assets\AssetBundles\Android\resources\script2\net.unity3d
替换到
\BuildAndroid\Assets\AssetBundles\Android\resources\script2\
----------------------------------------------------------------------------------------------
编译(打包Assets):
删除H:\DFS\RO\BuildAndroid\Assets\StreamingAssets下所有文件
AssetBundle->Archive->Zip AssetBundle To StreamingAssets [大约耗时5分钟]
一共会生成55个zip项目(0-54),可以在StreamingAssets目录下查看
打包完成后Unity也会有日志
File->BuildSetting->Build打包成品 [需要配置好JDK和SDK]
说明:
SDK使用27版本
Unity使用2017.4.40f1
Web Server Port :80 IP:192.168.6.18
Web files:archive.7zip
Fix php file ip set and mysql user & password
Fix mysql
DataBase ro_global -> Table proxy -> Filed id =0 port=8889 ext_port=8889
Now, it's Work!!
If you need Vedio tell to me, i 录制 Vedio to everybody。
Compile RO_Server
1)Need ContOS7, root login into system
2)Install some necessary compilation tools
yum install glibc.i686 -y
yum -y install gcc+ gcc-c++
yum install boost-devel.x86_64 -y
yum install libxml2-devel.x86_64 -y
yum install log4cxx-devel.x86_64 -y
yum install jansson-devel.x86_64 -y
yum install git -y
yum install gzip -y
yum install bzip2 -y
yum -y install automake
yum -y install libtool
3)Install cmake mysql
cd /root/ro_lib
wget
To view the content, you need to sign in or register
tar -zxvf cmake-3.12.4.tar.gz
cd cmake-3.12.4
./bootstrap
gmake
gmake install
cmake --version
cd /root/ro_lib
wget
To view the content, you need to sign in or register
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install -y mysql-server
yum install -y mysql-community-common.x86_64
yum install -y mysql-community-devel.x86_64
systemctl mysqld status
systemctl mysql status
service mysql status
systemctl start mysqld.service
systemctl status mysqld.service
yum install -y mysql-server
systemctl mysqld status
systemctl mysql status
service mysql status
systemctl start mysqld.service
systemctl status mysqld.service
Run the following command in terminal mode:
mysql -u root
Enter MySQL command mode:choose one
> UPDATE mysql.user SET password=PASSWORD("123456") WHERE user="root" AND Host="localhost";
> UPDATE mysql.user SET password="123456" WHERE user="root" AND Host="localhost";
> SET password for 'root'@'localhost'=password('123456');
> FLUSH PRIVILEGES;
> CREATE USER 'root'@'%' IDENTIFIED BY '123456';
> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
> FLUSH PRIVILEGES;
> quit;
Now Mysql user is root, password is 123456;
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --zone=public --add-port=8889/tcp --permanent
firewall-cmd --query-port=3306/tcp
firewall-cmd --query-port=8889/tcp
firewall-cmd --reload
After installing MySQL, import the database into MySQL
Tools: navicat premium or phpMyAdmin
Import Database. SQL File
4) Insatll googletest
cd /root/ro_lib
unzip googletest-release-1.8.0.zip
chmod -R 777 googletest-release-1.8.0
cd googletest-release-1.8.0/
cmake CMakeLists.txt
make
make install
g++ -o test test.cpp -lgtest -lpthread
5)Install jemalloc
cd /root/ro_lib
unzip jemalloc-3.4.0.zip
chmod -R 777 jemalloc-3.4.0
cd /jemalloc-3.4.0
./configure
make
make install
6)Install protobuf
protobuf-2.6.1-master.zip
cd /root/ro_lib
unzip protobuf-2.6.1-master.zip
chmod -R 777 protobuf-2.6.1-master
cd protobuf-2.6.1-master/
./configure --prefix=/usr/local
make
make install
protoc --version
vi /etc/ld.so.conf.d/protobuf.conf
/usr/local/lib
ldconfig
7) Fix premake4.lua
configuration "linux or macosx"
includedirs {
".",
"/usr/local/include",
"/usr/local/include/mysql",
"/usr/local/mysql/include",
"/usr/include",
"/usr/include/log4cxx",
"/usr/include/libxml2",
"/usr/include/mysql",
"/usr/local/include/google/protobuf",
}
libdirs {
"/usr/local/lib",
"/usr/local/mysql/lib",
"/usr/lib",
"/usr/lib/mysql",
"/lib64",
"/usr/lib64",
"/usr/lib64/mysql",
"/usr/local/protobuf/lib"
}
links {
"xml2",
"pthread",
"mysqlclient",
"log4cxx",
"protobuf",
"hiredis",
"jansson",
"jemalloc",
}
8) Install redis
cd /root/ro_lib
wget
To view the content, you need to sign in or register
tar -zxvf redis-4.0.14.tar.gz
cd redis-4.0.14
make MALLOC=libc
make install
cd /etc
mkdir redis
cp /root/ro_lib/redis-4.0.14/redis.conf /etc/redis/6379.conf
cp /root/ro_lib/redis-4.0.14/utils/redis_init_script /etc/init.d/redisd
修改
vi /etc/redis/6379.conf
将 daemonize no 修改为 daemonize yes
修改
vi /etc/init.d/redisd
添加两行注释
# chkconfig: 2345 90 10
# description: Redis is a persistent key-value database
chkconfig redisd on
service redisd start
cd /root/ro_lib
tar -zxvf hiredis-0.13.3.tar.gz
cd hiredis-0.13.3/
make && make install
9)Make RO Server
cd /root/ro_server
make clean
make -j4 tf
10)Run Server
cd bin/Debug
./restart