受到元气骑士双人远程联机指南的启发,在这篇文章的基础上完成了最多支持4人同时联机的relayer. 具体要求同以上文章。

所有资源一同放在github: SoulKnight-Remote

下面的内容同github repo的README, 方便各位朋友(不用点击)。

Soul Knight Remote Multiplayer Host UDP broadcast relayer

A C proram running in Linux layer of Android that relay the multiplayer discovery broadcast package from soul knight to the specified IP address and port in the same IP POOL.

Compile (For Windows)

We have provided a pre-build verison of arm named udp_relay_arm

Need Android NDK toolchain to do a cross-platform compile.

  1. Assume that you have unziped what it contains in android-ndk-r16b-windows-x86_64.zip to D:\ndk

  2. Place agcc.batand agcc86.batto D:\ndk.

  3. Add D:\ndk and D:\ndk\android-ndk-r16b-windows-x86_64\android-ndk-r16b to the PATHof Environment Variables.

  4. Execute agcc.bat -o udp_relay udp_relay.c -std=c99 -O2in command prompt. If you want to compile a version for x86 platform, replace agcc.batto agcc86.bat

Usage

Requirement

For user:

  1. A server with public IP, and open TCP/UDP:1723,1701 ports, and had configured a PPTP VPN service that all the clients connected can talk to each other and the server.
  2. A computer with adb tools and adb-connect drivers of the host device.

For Host device (Host a multiplayer game):

  1. A rooted device.
  2. Full control to /sdcard/ and /data/local.
  3. Open USB debuggingswitch in Developer Options.
  4. Connect to a local network with WIFI wich has a DHCP server.
  5. Connect to the PPTP VPN server mentioned above.

For Client device (Join in multiplayer game):

  1. Connect to the PPTP VPN server mentioned above.

Step (For Windows)

  1. Assume that the host had been connected to a computer in the same local network through cable, and you can see your device through execute adb devicesin command prompt. Assume that all of the devices not connect to the VPN server and not running the game. If needed, I will tell you when to do what.

  2. Push udp_relaybinary program to /data/local

  3. Change protected bits of udp_relayto 777.

  4. NOW LET ALL OF THE DEVICE CONNECT TO THE VPN SERVER.

  5. Execute commands above in adb shell with superuser permission.

     ./udp_relay [-d] [num-of-player-exclude-host] 23333 [nth-player-ip-in-vpn-server]-d is for open debug mode. It will show you the details of relaying package.
    

    For example. I have 4 devices(host included) need to play together. Their IPs are from 192.168.10.10-192.168.10.13, 192.168.10.10 is the host. So I execute

    ./udp_relay -d 3 23333 192.168.10.11 192.168.10.12 192.168.10.13
    
  6. If all is well, you can see the output like:

    Welcome to Soul Knight remote multiplayer host UDP relay helper by Nemesiss.Lin.
    Debug Mode.
    Will allow 3 players, and you will be the host.
    Port Number : 23333
    Add player : 192.168.10.11
    Add player : 192.168.10.12
    Add player : 192.168.10.13
    Setting host info...
    
  7. NOW LET ALL OF THE DEVICES ENTER THE GAME AND HOLD ON “Tap to start” SCREEN

  8. NOW THE HOST DEVICE CREATE A MULTIPLAYER GAME AND ENTER THE SCREEN OF SELECTING CHARACTERS

  9. Check the adb output, you should see

    Player 0 -- Relaying a packet of length 125 from <ip-to-the-host-in-local-network>.
    Player 1 -- Relaying a packet of length 125 from <ip-to-the-host-in-local-network>.
    Player 2 -- Relaying a packet of length 125 from <ip-to-the-host-in-local-network>.
    ...
    
  10. Check the host device, you can see your host ip is 192.168.10.10 in the screen of the lower left corner instead of the local network ip assigned by DHCP server.

  11. NOW LET OTHER PLAYER ENTER THE “Join Game”.

  12. If all goes well, all of the devices can enter the multiplayer room and the host can start the game.

Note:

  1. Ensure that all of the devices had connected to the VPN server before running udp_relayprogram.
  2. Ensure that run udn_relayprogram before running the game. Or the game cannot bind the 23333 port.
  3. If anyone exit the room, it won’t be removed from playerlist in the room. Maybe the host should re-create a room. At that time it doesn’t need to restart the udp_relay. This bug is caused by the way to discover other players by the soul knight.
  4. If Unable to bind to socket, use pscommand to find out that whether there is an old udp_relayprocess running, if so, kill it.
  5. You can also use some “Terminal Emulator” apps on the host device, then the computer with adb env isn’t necessary.

元气骑士多终端跨网远程联机解决方案相关推荐

  1. vnc远程控制 如何跨网远程其他电脑

    提起远程控制,不得不提到vnc,那大家对VNC远程控制了解多少呢?又是如何实现vnc远程控制跨网远程其他电脑的呢?今天看到我这篇文章的小伙伴有福了,我将就自己如何实现跨网远程其他电脑的情况,为大家做个 ...

  2. 电力配网远程无线传输解决方案,电力安全再加固

    一.行业背景 众所周知,经济全球化正在快速推进,社会发展对电力质量的需求越来越明确,无论是电压波动,还是短时的停电都会造成巨大的损失.所以,通过电网改造在配电网中实现配电网自动化,为广大电力用户提供优 ...

  3. Linux搭建我的世界MC服务器 - MCSM面板 【外网远程联机教程】

    文章目录 1. 安装JAVA 2. MCSManager安装 3.局域网访问MCSM 4.创建我的世界服务器 5.局域网联机测试 6.安装cpolar内网穿透 7. 配置公网访问地址 8.远程联机测试 ...

  4. minecraft(我的世界) 外网远程联机【免费内网穿透】

    相信很多玩我的世界的小伙伴,都想要在家里和外地的小伙伴一起联机玩我的世界.而如何不在同个局域网下,一起联机愉快的玩耍我的世界,其实可以通过做内网穿透来实现,如cpolar内网穿透,支持免费使用,不限制 ...

  5. 最牛的远程开发来了!不用配置向日葵,直接上车vscode Remote Tunnels,轻松实现跨网远程,局域网穿透

    Vscode Remote Tunnels 使用场景: 服务器连接公网,安装vscode,并登录github账号,开启Tunnels 客户端连接公网,安装vscode,并登录github账号 客户端在 ...

  6. 如何实现外网跨网远程控制内网计算机?快解析来解决

    远程控制,是指管理人员在异地通过计算机网络异地拨号或双方都接入Internet等手段,连通需被控制的计算机,将被控计算机的桌面环境显示到自己的计算机上,通过本地计算机对远方计算机进行配置.软件安装程序 ...

  7. 元气骑士双人异地公网联机工具(仅支持双人、JAVA实现)

    环境准备 腾讯云/阿里云服务器一台,如果能搞到学生机的话是很便宜的 两台电脑,台式笔记本都行 电脑和服务器需要配置JAVA环境 下载client.jar与server.jar 服务器上的操作 将ser ...

  8. 计算机网络实践之元气骑士公网异地联机(三) 完善转发机的转发规则

    计算机网络实践之元气骑士公网异地联机(三) 完善转发机的转发规则 前言 在上一篇中,我通过表格对转发机的监听端口和转发逻辑进行了简短的描述. 转发机 监听端口 主机A 23333.8888.8888端 ...

  9. 跨局域网远程连接神器——frp内网穿透

    跨局域网远程连接神器--frp内网穿透 ​ 放寒假回家想用服务器跑代码.想用校园网下文章.甚至还想用服务器打两把游戏.这该怎么办?有的大佬会想,可以在家买一个服务器嘛!如果是这样就打扰了...对于我这 ...

最新文章

  1. Unity3D GUI学习之GUILayout控件及使用
  2. Linux调度系统全景指南(下篇)
  3. Java-Socket实现文件的断点续传
  4. Qt文档阅读笔记-Object Model
  5. 一篇文章搞懂filebeat(ELK)
  6. 如何获取NuGet以安装/更新packages.config中的所有软件包?
  7. CCS历代版本下载地址以及6.0以上版本添加软件仿真
  8. 音乐NFT平台的新浪潮,看mozik如何引领数字音乐时代革命
  9. 【三维建模】基于MATLAB的立体图形三维建模仿真
  10. 单片机实验四 矩阵键盘实验
  11. JS定时器原理及案例
  12. 如何形象的理解泰勒展开
  13. 千锋培训学python怎么样
  14. 医院客户关系管理系统
  15. 【一些有关GraN-DAG的知识点总结】
  16. 2356 - 成绩排序
  17. Re 从零开始的C++之路(四)容器和迭代器
  18. 烦人的警告 libpng warning: iCCP: known incorrect sRGB profile
  19. 问题 C: 网格涂色
  20. 请简述什么是spring的ioc和di_请简述什么是 Spring 的 IoC 和 DI?_学小易找答案

热门文章

  1. python通用权限管理框架图_开源干货!.NET Core + Vue.js通用动态权限(RBAC)管理系统框架[DncZeus]开源...
  2. iTunes备份文件路径
  3. JZOJ 5495 MiniumCut (最小割树)
  4. java语法基础练习题
  5. 用python绘制股票图_一步一步教你用Python画出专业的K线图
  6. Sophos 固件升级
  7. java spring 业务异常 ExceptionController (使用@RestControllerAdvice)
  8. 青城山 天下幽、都江堰 天下敬
  9. 科研绘图神器!不要错过!提升效率!
  10. 浅谈关于CPU的架构和工艺(1)