In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I also inadvertently came from a friend, according to him, also came from the Internet, the server-side code was originally linux version, but was modified by the great god to run on Windows. If you accidentally infringe your copyright, please contact me to delete it. Fortunately, most of the methods and interfaces used in this code can be used across Windows and linux platforms, so friends under linux development please do not feel uncomfortable, we learn this code is not more about the details but to learn ideas and source code.
The main solution file of the game is opened with Visual Studio, as shown below:
There are a total of 10 engineering projects with many modules. Where should we start? Let's first take a look at the source code directory:
We go to the Server directory and find the following file:
Let's open it and take a look at the content:
Cd Bin\ x64\ Releasestart.bat
This code goes into the Bin\ x64\ Release directory and executes another start.bat. Let's go to this directory to take a look at the contents of the file:
Taskkill / f / t / im redis-server.exe taskkill / f / t / im CSBattleMgr.exe taskkill / t / im SSBattleMgr.exe taskkill / t / im GSConsole.exe taskkill / f / t / im BalanceServer.exetaskkill / f / t / im LoginServer.exetaskkill / f / t / im GSKernel.exetaskkill / f / t / im RobotConsole.exetaskkill / f / t / im LogServer.exeping-n 1 127.0 > nulstart / min "redis-server"redis-server.exe" redis.confping-n 1 127.0 > nulstart / min "redis-Logicserver"redis-server.exe" redis-logic.confping-n 1 127.0 > nulecho "start CSBattleMgr.exe" start / min "CSBattleMgr"CSBattleMgr.exe" ping-n 1 127.0 > nulecho "start SSBattleMgr.exe" start / min "SSBattleMgr"SSBattleMgr.exe" ping-n 1 127.0 > nulecho "start GSKernel.exe" start / min "GSKernel" GSKernel.exe "ping-n 1 127.0 > nulecho" start BalanceServer.exe "start / min" BalanceServer "BalanceServer.exe" ping-n 1 127.0 > nulecho "start LoginServer.exe" start / min "LoginServer"LoginServer.exe" ping-n 1 127.0 > nulecho "start LogServer.exe" start / min "LogServer"LogServer.exe"
Through this script, we get some information about the server project, which consists of the following services:
Redis-server (start two) CSBattleMgrSSBattleMgrGSKernelBalanceServerLoginServerLogServer
I don't know exactly what these servers do, but we'll teach you how to read them later.
In addition, we send some sql files in the Bin/x64/Release/dbsql directory:
We open the createdb.sql that creates the table:
Drop database if exists fball_gamedb;drop database if exists fball_logdb;drop database if exists fball_accountdb;create database fball_accountdb character set utf8;drop database if exists fball_chargedb;create database fball_chargedb character set utf8;drop database if exists fball_robedb;create database fball_robedb character set utf8;drop database if exists fball_gamedb_1;create database fball_gamedb_1 character set utf8;drop database if exists fball_gamedb_2;create database fball_gamedb_2 character set utf8;drop database if exists fball_gamedb_3;create database fball_gamedb_3 character set utf8 Drop database if exists fball_logdb_1;create database fball_logdb_1 character set utf8;drop database if exists fball_logdb_2;create database fball_logdb_2 character set utf8;drop database if exists fball_logdb_3;create database fball_logdb_3 character set utf8
In other words, this service needs to use mysql. We install a mysql and execute the Rebuild.bat to create these libraries. The Rebuild.bat content is as follows:
Echo off: begin@echo-1, create all game database- mysql-uroot-p123321
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.