Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Run the java emu on cloud

Initiate Mage
Joined
Dec 1, 2021
Messages
1
Reaction score
0
Finally, I got how to make the java BDO emu a.k.a stupid RAM hog run on some free cloud-computing platform (e.g Google Colab cpu ver.).
I had successfully connected into the LoginServer-emu on cloud through ngrok.

The problem is, when the LoginServer returns WorldServer port (e.g the 8889 one), the client side must connect to the real public port which ngrok mapped to.
(e.g port-on-cloud 8888 -> ngrok public ip port 16345; port-on-cloud 8889 -> ngrok public ip port 24155. Those public ports are random for ngrok free users. )

I believe that's something related to "sendByteBuffer.writeH(gameChannelInfo.getPort())" in SMGetWorldInformations.java

Just looking for some advices before digging into those cancerous javas.



Also, scripts for Google Colab here:

Code:
#cell0
'''
service.ini will be sth like:

[SERVICE]
TYPE=GT
RES= _EN_

[GT]
AUTHENTIC_DOMAIN=0.tcp.ngrok.io
AUTHENTIC_PORT=16345
PATCH_URL= http://dn.global-lab.playblackdesert.com/UploadData/
viewTradeMarketUrl=https://trade.global-lab.playblackdesert.com/
gameTradeMarketUrl=https://game-trade.global-lab.playblackdesert.com/

'''

!mkdir /root/.ngrok2
import subprocess
import requests
import json

def printngrok():
  r = requests.get("http://localhost:4045/api/tunnels", headers={"content-type": "application/json"})
  jewson=r.json()['tunnels']
  print(jewson[0]['name'])
  print(jewson[0]['public_url'])
  print(jewson[1]['name'])
  print(jewson[1]['public_url'])

!apt update
!mkdir /content/data
!apt install mongodb
!curl -fsSL -O https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
!rm /opt/ngrok
!unzip -d /opt ngrok-stable-linux-amd64.zip

#cell1
%%writefile /root/.ngrok2/ngrok.yml
authtoken: (((your-ngrok-token)))
web_addr: 4045
tunnels:
  login:
    addr: 8888
    proto: tcp
  gserver:
    addr: 8889
    proto: tcp

#cell2
%%writefile /content/mongod.config
wiredTigerCacheSizeGB = 1

#cell3
%%bash
wget https://download.java.net/openjdk/jdk14/ri/openjdk-14+36_linux-x64_bin.tar.gz
tar xvfz openjdk-14+36_linux-x64_bin.tar.gz
mv ./jdk-14/ /usr/lib/jvm/
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-14/bin/javac" 1081
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-14/bin/java" 1081
update-alternatives --set "javac" "/usr/lib/jvm/jdk-14/bin/javac"
update-alternatives --set "java" "/usr/lib/jvm/jdk-14/bin/java"
update-alternatives --config java

#cell4
!nohup /opt/ngrok start --all > ngrok.log 2>&1 &
!nohup mongod --config /content/mongod.config --dbpath /content/data --port 27017 > database.log 2>&1 &
printngrok()

#cell5
!7z x -o/content /content/drive/MyDrive/(((your-emu))).rar

'''
modify both
/content/s795/gameserver/bin/configs/network.properties
/content/s795/loginserver/bin/configs/network.properties

network.rmi.port = 9000 => network.rmi.port = 9123
'''

#cell6
jewva = ['java', 
         '-classpath',
         '/content/s795/loginserver/lib/*',
         'com.bdoemu.login.LoginServer']

jewva2 =['java', '-Xms256m', '-Xmx10g', '-XX:NewRatio=3', '-XX:+UseG1GC', '-server', 
         '-classpath',
         '/content/s795/gameserver/lib/*',
         'com.bdoemu.MainServer']
         
subprocess.Popen(jewva,cwd='/content/s795/loginserver/bin',stdout=open('/content/loginsvr.log','wt'))

#cell7
subprocess.Popen(jewva2,cwd='/content/s795/gameserver/bin',stdout=open('/content/mainsvr.log','wt'))
 
Back
Top