藏宝湾网游单机站

 找回密码
 注册

QQ登录

只需一步,快速开始

★69 元包站 Gm 手游平台★

★69 元包站 Gm 手游平台★

★Gm 游戏平台【无限资源包站平台,真正体验gm和土豪感觉】★

★白嫖放置传奇 玩通关算你赢★

★白嫖放置传奇 玩通关算你赢★

★白嫖长久耐玩型 放置类挂机传奇游戏 充值可打 安全挂机 可交易 无PK★

★@梦幻长久耐玩全新大唐九黎★

★@!!——梦幻长久耐玩全新大唐九黎——!!★

★★新增全新门派九黎城, ★侵烛系统 ★静脉系统 ★赐福系统 ★战斗动作声效系统 ★全场景NPC、召唤兽迭代最新 ★17个副本,完全还原 ★独家PK系统,享受极致免费PK★★

承接推广
★承接推广★

★承接推广★

☆ 六一活动开放-放置传奇☆

★ 六一活动开放-放置传奇★

★可白嫖 上班摸鱼类 放置文字传奇游戏(放置休闲)qq群756025698★

★三职业复古★开局送神装★爆率100%★零氪首选★

★三职业复古★开局送神装★爆率100%★零氪首选★

★〖双线〗〖无忧传奇〗〖每日新区〗〖开局送神装 100%高爆率 装备元宝打怪爆〗★

承接推广

★承接推广★

★承接推广★

承接推广

★承接推广★

★承接推广★

★DNF★全职业平衡★公益服★
★DNF★全职业平衡★公益服★

【dnf86版本】【怀旧服】【全职业平衡】【非变态服】【非商业服】【774031300】

★承接推广★

★承接推广★

★承接推广★

★承接推广★

★承接推广★

★承接推广★

★承接推广★

★承接推广★

★承接推广★

查看: 1442|回复: 17

[手工架设] 远征ol源代码转换linux系统

[复制链接]
 楼主| 发表于 2026-2-23 12:58:54 | 显示全部楼层 |阅读模式
本帖最后由 bfdz49 于 2026-2-23 15:34 编辑
  1. <font color="#ff0000">这个版本被我全部替换linux系统来修复 不过问题很多我修复差不多 注意我只替换C++11 移植到 Linux 的难度太大,支持 Linux 的开源游戏服务器框架,我个人修复问题特别多在 Linux 上安装 VirtualBox 或 VMware,运行 Windows 虚拟机进行编译</font> 没有一定的技术别下载 这个源代码很多东西有问题
复制代码
  1. ================================================================================
  2.            Xgame 游戏源码 - VS2022 & C++11 改造完成
  3. ================================================================================

  4. 修改日期: 2026-02-21
  5. 修改版本: 1.0

  6. ================================================================================
  7. 一、服务端和客户端改造内容
  8. ================================================================================

  9. 1. 项目文件转换 (VS2008 -> VS2022)
  10.    &#10003; 将 .vcproj 转换为 .vcxproj 格式
  11.    &#10003; 更新工具集到 v143 (Visual Studio 2022)
  12.    &#10003; 更新解决方案文件到 VS2022 格式
  13.    &#10003; 添加 x86/x64 平台支持
  14.    &#10003; 设置 C++20 语言标准

  15. 2. C++11/C++20 支持
  16.    &#10003; 添加 C++11 标准头文件:
  17.      - <atomic>
  18.      - <chrono>
  19.      - <thread>
  20.      - <mutex>
  21.      - <condition_variable>
  22.      - <memory>
  23.      - <functional>
  24.    &#10003; 设置 LanguageStandard 为 stdcpp20

  25. 3. 编译配置
  26.    &#10003; Debug/Release 配置
  27.    &#10003; Win32/x64 平台支持
  28.    &#10003; Unicode 字符集
  29.    &#10003; Windows 10 SDK

  30. ================================================================================
  31. 二、服务器架构
  32. ================================================================================

  33. 服务端 (SrcServer):
  34. ├── Cluster/                    # 集悍衿&#65533;
  35. │   ├── GatewayServer           # 网关服务器
  36. │   ├── LoginServer             # 登录服务器
  37. │   ├── CenterServer            # 中心服务器
  38. │   ├── WorldServer             # 世界服务器
  39. │   ├── VoiceServer             # 语音服务器
  40. │   俯ぉ&#65533; ...
  41. ├── SceneServer/                # 场景服务器
  42. │   ├── EntityServer            # 实体服务器
  43. │   ├── SkillServer             # 技能服务器
  44. │   ├── TaskServer              # 任务服务器
  45. │   ├── ChatServer              # 聊天服务器
  46. │   └── ...
  47. ├── Social/                     # 社交服务器
  48. │   ├── ChatService             # 聊天服务
  49. │   ├── FriendService           # 好友服务
  50. │   ├── TeamService             # 队伍服务
  51. │   └── ...
  52. └── DBSvr/                      # 数据库服务器

  53. 客户端 (SrcClient):
  54. ├── Client/                     # 主客户端
  55. │   ├── Game                    # 游戏主程序
  56. │   ├── GameUI                  # 游戏UI
  57. │   └── ...
  58. ├── RenderEngine/               # 渲染引擎
  59. ├── UI/                         # UI系统
  60. └── ...

  61. ================================================================================
  62. 三、编译说明
  63. ================================================================================

  64. Windows (Visual Studio 2022):
  65.     1. 安装 Visual Studio 2022
  66.     2. 安装 "使用 C++ 的桌面开发" 工作负载
  67.     3. 打开解决方案文件 (.sln)
  68.     4. 选择配置 (Debug/Release) 和平台 (x86/x64)
  69.     5. 按 F7 编译

  70. ================================================================================
  71. 四、文件统计
  72. ================================================================================

复制代码
  1. [root@192 gameserver]# # 重新编译
  2. [root@192 gameserver]# cd /opt/moleserver
  3. [root@192 moleserver]# make 2>&1 | tail -30
  4.                  from CServerServiceManager.h:4,
  5.                  from CServerServiceManager.cpp:1:
  6. ../../include/molnet/dataprovider.h:59:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  7.    throw (std::runtime_error) = 0;
  8.    ^~~~~
  9. ../../include/molnet/dataprovider.h:62:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  10.    throw (std::runtime_error) = 0;
  11.    ^~~~~
  12. ../../include/molnet/dataprovider.h:65:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  13.    throw (std::runtime_error) = 0;
  14.    ^~~~~
  15. In file included from ../../include/molnet/Network.h:18:0,
  16.                  from cdefines.h:4,
  17.                  from CServerServiceManager.h:4,
  18.                  from CServerServiceManager.cpp:1:
  19. ../../include/molnet/mysqldataprovider.h:58:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  20.    throw (std::runtime_error);
  21.    ^~~~~
  22. ../../include/molnet/mysqldataprovider.h:61:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  23.    throw (std::runtime_error);
  24.    ^~~~~
  25. ../../include/molnet/mysqldataprovider.h:64:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  26.    throw (std::runtime_error);
  27.    ^~~~~
  28. g++ -std=c++11 -o ../../bin/games/libgame_ddz.so objs/*.o -I ../../include/molnet -O2 -shared -fexceptions -fPIC -DLINUX -lpthread -L ../../libs -lmolnet -lmysqlclient -ljsoncpp
复制代码
  1. [root@192 moleserver]# make 2>&1 | tail -50

  2.                  from cdefines.h:4,
  3.                  from crobotlogicframe.h:4,
  4.                  from crobotlogicframe.cpp:1:
  5. ../../include/molnet/mysqldataprovider.h:58:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  6.    throw (std::runtime_error);
  7.    ^~~~~
  8. ../../include/molnet/mysqldataprovider.h:61:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  9.    throw (std::runtime_error);
  10.    ^~~~~
  11. ../../include/molnet/mysqldataprovider.h:64:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  12.    throw (std::runtime_error);
  13.    ^~~~~
  14. g++ -std=c++11 -c -I ../../include/molnet -O2 -shared -fexceptions -fPIC -DLINUX -lpthread -L ../../libs -lmolnet -lmysqlclient -ljsoncpp CServerServiceManager.cpp -o objs/CServerServiceManager.o
  15. In file included from /opt/rh/devtoolset-7/root/usr/include/c++/7/ext/hash_map:60:0,
  16.                  from ../../include/molnet/common.h:53,
  17.                  from ../../include/molnet/Network.h:7,
  18.                  from cdefines.h:4,
  19.                  from CServerServiceManager.h:4,
  20.                  from CServerServiceManager.cpp:1:
  21. /opt/rh/devtoolset-7/root/usr/include/c++/7/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
  22. #warning \
  23.   ^~~~~~~
  24. In file included from ../../include/molnet/Network.h:16:0,
  25.                  from cdefines.h:4,
  26.                  from CServerServiceManager.h:4,
  27.                  from CServerServiceManager.cpp:1:
  28. ../../include/molnet/dataprovider.h:59:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  29.    throw (std::runtime_error) = 0;
  30.    ^~~~~
  31. ../../include/molnet/dataprovider.h:62:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  32.    throw (std::runtime_error) = 0;
  33.    ^~~~~
  34. ../../include/molnet/dataprovider.h:65:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  35.    throw (std::runtime_error) = 0;
  36.    ^~~~~
  37. In file included from ../../include/molnet/Network.h:18:0,
  38.                  from cdefines.h:4,
  39.                  from CServerServiceManager.h:4,
  40.                  from CServerServiceManager.cpp:1:
  41. ../../include/molnet/mysqldataprovider.h:58:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  42.    throw (std::runtime_error);
  43.    ^~~~~
  44. ../../include/molnet/mysqldataprovider.h:61:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  45.    throw (std::runtime_error);
  46.    ^~~~~
  47. ../../include/molnet/mysqldataprovider.h:64:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
  48.    throw (std::runtime_error);
  49.    ^~~~~
  50. g++ -std=c++11 -o ../../bin/games/libgame_dzpk.so objs/*.o -I ../../include/molnet -O2 -shared -fexceptions -fPIC -DLINUX -lpthread -L ../../libs -lmolnet -lmysqlclient -ljsoncpp
  51. make[1]: 离开目录“/opt/moleserver/games/dzpk”
复制代码
  1. [root@192 bin]# find /opt/moleserver -name "*.sh" 2>/dev/null
  2. find /opt/moleserver -type f -executable 2>/dev/null | grep -E "(server|start|run)" | head -20
  3. /opt/moleserver/CMS/vendor/paragonie/random_compat/build-phar.sh
  4. [root@192 bin]# find /opt/moleserver -type f -executable 2>/dev/null | grep -E "(server|start|run)" | head -20
  5. /opt/moleserver/.git/hooks/applypatch-msg.sample
  6. /opt/moleserver/.git/hooks/commit-msg.sample
  7. /opt/moleserver/.git/hooks/post-update.sample
  8. /opt/moleserver/.git/hooks/pre-applypatch.sample
  9. /opt/moleserver/.git/hooks/pre-commit.sample
  10. /opt/moleserver/.git/hooks/pre-rebase.sample
  11. /opt/moleserver/.git/hooks/prepare-commit-msg.sample
  12. /opt/moleserver/.git/hooks/update.sample
  13. /opt/moleserver/bin/games/libgame_ddz.so
  14. /opt/moleserver/bin/games/libgame_lhd.so
  15. /opt/moleserver/bin/games/libgame_lunpan.so
  16. /opt/moleserver/bin/games/libgame_sszp.so
  17. /opt/moleserver/bin/games/libgame_bcbm.so
  18. /opt/moleserver/bin/games/libgame_brnn.so
  19. /opt/moleserver/bin/games/libgame_hlddz.so
  20. /opt/moleserver/bin/games/libgame_xzmj.so
  21. /opt/moleserver/bin/games/libgame_zjh.so
  22. /opt/moleserver/bin/games/libgame_dzpk.so
  23. /opt/moleserver/bin/account_server
  24. /opt/moleserver/bin/game_server
  25. [root@192 bin]# cd /opt/moleserver/bin
  26. [root@192 bin]#
  27. [root@192 bin]#
  28. [root@192 bin]# ls configs/
  29. database.ini
  30. [root@192 bin]#
  31. [root@192 bin]#
  32. [root@192 bin]# ./account_server &
  33. [1] 60462
  34. [root@192 bin]#
  35. [root@192 bin]# # 3. 启动游戏主服务器
  36. [root@192 bin]# ./game_server &
  37. [2] 60463
  38. [root@192 bin]# 使用方法:account_server 账号服务器配置ID
  39. 使用方法:game_server 游戏服务器配置ID
复制代码

更新Windows  Visual Studio 2022 源代码本身是Visual 2008 现在2008很多库没有 无法实现 我已经全部升级 有什么问题留言
通过网盘分享的文件:Xgame2001_source.rar

链接: https://pan.baidu.com/s/1DDwn4dDPi4NmXfhBKGhtcg 提取码: g26b
安装 MySQL

  1. sudo yum install mysql-server mysql -y


  2. sudo yum install mariadb-server mariadb -y
复制代码


创建数据库


# 登录 MySQL

mysql -u root -p


# 创建数据库
CREATE DATABASE moleweb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

# 导入数据(如果有 SQL 文件)

mysql -u root -p moleweb < /opt/moleserver/database/moleweb.sql


检查 database.ini

cat /opt/moleserver/bin/configs/database.ini



确保配置与 MySQL 设置匹配


| id | servername       | serverport | serverip  | createtime          | serverstate | curplayercount |
+----+------------------+------------+-----------+---------------------+-------------+----------------+
|  1 | 验证服务器2      |       3333 | 127.0.0.1 | 2019-12-24 14:06:35 |           0 |              0 |
+----+------------------+------------+-----------+---------------------+-------------+----------------+
[root@192 bin]#
[root@192 bin]# # 检查 mol_gameroom 表
[root@192 bin]# mysql -u root -p123456 -e "SELECT * FROM moleweb.mol_gameroom WHERE id=1;"
+----+--------+--------------------------+------------+------------+------------------+-----------+------------+-----------+-----------+-------------+--------------------+---------------------+---------------------+-------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| id | gameid | servername               | serverport | tablecount | tableplayercount | serverip  | gamingtype | lastmoney | pielement | roomrevenue | currealplayercount | currobotplayercount | createtime          | state | QueueGaming | serverparameter                                                                                                                                           | gstate |
+----+--------+--------------------------+------------+------------+------------------+-----------+------------+-----------+-----------+-------------+--------------------+---------------------+---------------------+-------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+--------+

}                          |      0 |
+----+--------+--------------------------+------------+------------+------------------+-----------+------------+-----------+-----------+-------------+--------------------+---------------------+---------------------+-------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+--------+
[root@192 bin]# cd /opt/moleserver/bin
[root@192 bin]# ./account_server 1
[14:57][2026-02-23 14:57:17] opening '/opt/moleserver/bin/logs/account1_server_normal.log'
[14:57][2026-02-23 14:57:17] opening '/opt/moleserver/bin/logs/account1_server_error.log'
./game_server 1
[14:57] [BSC] account_server.cpp:63 main 数据库:localhost root 123456 moleweb 连接成功。
[14:57] [BSC] account_server.cpp:83 main 登陆服务器:127.0.0.1,端口:3333 启动成功。
[14:57] [BSC] account_server.cpp:85 main 服务器启动成功,开始处理...

要做运行移植工具
需要 C++ Windows/Linux 双平台专家 我个人可以解决好他了
我全部移植支持Linux


[root@192 Xgame2001_source]#
[root@192 Xgame2001_source]# chmod +x port_to_linux.sh
[root@192 Xgame2001_source]# cd /home/Xgame2001_source
[root@192 Xgame2001_source]# bash port_to_linux.sh
========================================
Xgame2001 Windows to Linux 移植工具
========================================

> # 9. 统计信息
> echo "[9/10] 统计信息..."
> echo "源文件数量: $(find SrcServer -name "*.cpp" | wc -l)"
> echo "头文件数量: $(find SrcServer -name "*.h" | wc -l)"
>
> # 10. 完成
> echo "[10/10] 移植准备完成!"
> echo ""
> echo "使用方法:"
> echo "  1. cd /home/Xgame2001_source"
> echo "  2. bash build_linux_auto.sh"
> echo ""
> echo "如果编译失败,需要手动修复剩余的错误。"
> echo "========================================"
>
> ENDSCRIPT
[root@192 Xgame2001_source]#
[root@192 Xgame2001_source]# chmod +x port_to_linux.sh
[root@192 Xgame2001_source]# cd /home/Xgame2001_source
[root@192 Xgame2001_source]# bash port_to_linux.sh
========================================
Xgame2001 Windows to Linux 移植工具
========================================


> # 9. 统计信息
> echo "[9/10] 统计信息..."
> echo "源文件数量: $(find SrcServer -name "*.cpp" | wc -l)"
> echo "头文件数量: $(find SrcServer -name "*.h" | wc -l)"
>
> # 10. 完成
> echo "[10/10] 移植准备完成!"
> echo ""
> echo "使用方法:"
> echo "  1. cd /home/Xgame2001_source"
> echo "  2. bash build_linux_auto.sh"
> echo ""
> echo "如果编译失败,需要手动修复剩余的错误。"
> echo "========================================"
>
> ENDSCRIPT
[root@192 Xgame2001_source]#
[root@192 Xgame2001_source]# chmod +x port_to_linux.sh
[root@192 Xgame2001_source]# cd /home/Xgame2001_source
[root@192 Xgame2001_source]# bash port_to_linux.sh
========================================
Xgame2001 Windows to Linux 移植工具
========================================
[1/10] 创建 Linux 兼容层...
[2/10] 创建 Windows API 兼容层...
[3/10] 替换 Windows 头文件...
[4/10] 替换 Windows 关键字...

[9/10] 统计信息...
源文件数量: 1706
头文件数量: 2338
[10/10] 移植准备完成!


评分

参与人数 1金币 +2 收起 理由
佐手男孓 + 2 大佬能分享下原始源码吗

查看全部评分

回复

使用道具 举报

发表于 2026-2-23 13:32:05 | 显示全部楼层
沙发
回复 支持 反对

使用道具 举报

发表于 2026-2-23 13:33:32 | 显示全部楼层
谢谢分享
回复 支持 反对

使用道具 举报

发表于 2026-2-23 14:10:07 | 显示全部楼层
多谢分享,虽然不懂。。。
回复 支持 反对

使用道具 举报

发表于 2026-2-23 14:19:34 | 显示全部楼层
多谢分享,先收藏,有空编译看看
回复 支持 反对

使用道具 举报

发表于 2026-2-23 15:28:00 | 显示全部楼层
感谢这位愿意分享的小伙伴!!!哈拉少!!!(年初七快乐!!!)
回复 支持 反对

使用道具 举报

发表于 2026-2-23 16:05:34 | 显示全部楼层
感谢分享!!!
[发帖际遇]: 丨北在北方丨 在网吧通宵,花了 1 枚 金币. 幸运榜 / 衰神榜
回复 支持 反对

使用道具 举报

发表于 2026-2-23 18:33:54 | 显示全部楼层
不发源码,发这些有什么用?
回复 支持 反对

使用道具 举报

发表于 2026-2-23 20:36:09 | 显示全部楼层
多谢分享,先收藏,
[发帖际遇]: steedmj 发帖时在路边捡到 4 枚 金币,偷偷放进了口袋. 幸运榜 / 衰神榜
回复 支持 反对

使用道具 举报

发表于 2026-2-23 21:20:52 | 显示全部楼层
这工作量太大了,你好有毅力
回复 支持 反对

使用道具 举报

发表于 2026-2-24 05:07:16 | 显示全部楼层
等下你了
回复 支持 反对

使用道具 举报

发表于 2026-2-24 10:18:36 | 显示全部楼层
感谢楼主分享
回复 支持 反对

使用道具 举报

发表于 2026-2-25 01:17:38 | 显示全部楼层
感谢分享  大佬牛掰
回复 支持 反对

使用道具 举报

发表于 2026-2-25 15:32:44 | 显示全部楼层
这么好的帖子,倘若别人看不到,那么不是浪费楼主的心血吗?经过痛苦的思想斗争,我终于下定决心,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止。
回复 支持 反对

使用道具 举报

发表于 2026-2-26 15:53:32 | 显示全部楼层
远征ol源代码转换linux系统
回复 支持 反对

使用道具 举报

发表于 2026-2-28 22:13:16 | 显示全部楼层
感谢大神分享
[发帖际遇]: 一个袋子砸在了 klsdf9835647 头上,klsdf9835647 赚了 5 枚 金币. 幸运榜 / 衰神榜
回复 支持 反对

使用道具 举报

发表于 2026-2-28 22:57:57 | 显示全部楼层
66666666666
回复 支持 反对

使用道具 举报

发表于 2026-3-1 15:00:19 | 显示全部楼层
远征ol源代码转换linux系统                                                                                                                              
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

本站内容如若侵犯到您的权益,请来电来函告知,我们会尽快处理!
联系QQ:1953150286,2251387361,123784736,免责申明

排行榜|联系我们|小黑屋|手机版|Archiver|游戏藏宝湾 |

GMT+8, 2026-6-5 06:26 , Processed in 0.192397 second(s), 25 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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