Client connection error [KBEngine for Unity Demo]

51 views
Skip to first unread message

Tom Acunzo

unread,
Nov 26, 2016, 5:15:34 PM11/26/16
to kbengine...@googlegroups.com
Hi All

I’m totally new to KBEngine. I just installed KBE v0.9.6 on ubuntu. Everything was installed default settings with kbe root being in /home/kbe/

I’m trying to run the KBEngine_unity3d_demo from Mac OSX on the Unity Editor 4.6 Client side with demo-assets installed on the server.

From my Ubuntu Server:
kbe@ubuntu:/home/kbe/kbengine/kbengine_demos_assets$ ./start_server.sh
KBE_ROOT = "/home/kbe/kbengine"
KBE_RES_PATH = "/home/kbe/kbengine/kbe/res/:/home/kbe/kbengine/kbengine_demos_assets:/home/kbe/kbengine/kbengine_demos_assets/res/:/home/kbe/kbengine/kbengine_demos_assets/scripts/"
KBE_BIN_PATH = "/home/kbe/kbengine/kbe/bin/server"
kbe@ubuntu:/home/kbe/kbengine/kbengine_demos_assets$ ps -ef|grep kbengine
kbe      11934     1  0 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/machine --cid=2129652375332859700 --gus=1
kbe      11935     1  0 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/logger --cid=1129653375331859700 --gus=2
kbe      11936     1  1 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/interfaces --cid=1129652375332859700 --gus=3
kbe      11937     1  1 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/dbmgr --cid=3129652375332859700 --gus=4
kbe      11938     1  0 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/baseappmgr --cid=4129652375332859700 --gus=5
kbe      11939     1  0 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/cellappmgr --cid=5129652375332859700 --gus=6
kbe      11940     1  1 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/baseapp --cid=6129652375332859700 --gus=7
kbe      11941     1  1 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/cellapp --cid=7129652375332859700 --gus=8
kbe      11942     1  1 00:27 pts/0    00:00:00 /home/kbe/kbengine/kbe/bin/server/loginapp --cid=8129652375332859700 --gus=9

Now on the Client side in Mac OSX I opened up the Start scene inside Unity.

I then changed the local 127.0.0.1 ip address on the kbe_clientapp GameObject to point to my remote ubuntu server address on port 20013 running KBEngine server.
 
I run play on the Unity Editor and create a test user named “Tom” successfully in the Game Window. 
2016-11-26 16:45:55 496] NetworkInterface::_onConnectStatus(), connect to 192.XXX.XXX.36:20013 is success!
[2016-11-26 16:45:55 498] Event::fireIn: event(onConnectStatus) not found!
[2016-11-26 16:45:55 667] KBEngine::onImportClientMessagesCompleted: successfully! currserver=loginapp, currstate=login
[2016-11-26 16:45:55 667] KBEngine::onImportClientMessagesCompleted(): send importServerErrorsDescr!
[2016-11-26 16:45:55 667] KBEngine::login_loginapp(): send login! username=Tom
...


But when I try to login with that new account, I noticed that the server address changed back to a local address on port 20015 in the unity log:
[2016-11-26 16:05:02 815] KBEngine::Client_onLoginSuccessfully: accountName(Tom), addr(127.0.0.2:20015), datas(0)!

my ubuntu remote address gets a close socked message and a new connection is trying on 127.0.0.2:20015

[2016-11-26 16:05:02 816] NetWorkInterface::_asyncConnect(), will connect to '127.0.0.2:20015' …
[2016-11-26 16:06:17 893] NetWorkInterface::_asyncConnect(), connect to '127.0.0.2:20015' fault! error = 'System.Net.Sockets.SocketException: Connection timed out
  at System.Net.Sockets.Socket.Connect (System.Net.IPAddress[] addresses, Int32 port) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.String host, Int32 port) [0x00000] in <filename unknown>:0 
  at KBEngine.NetworkInterface._asyncConnect (KBEngine.ConnectState state) [0x00020] in /Users/Tom/Unity Projects/kbengine_unity3d_demo/Assets/Plugins/kbengine/kbengine_unity3d_plugins/NetworkInterface.cs:145 ‘
[2016-11-26 16:47:10 956] KBEngine::login_baseapp(): connect 127.0.0.2:20015 is error!

Obviously this will fail as no login service is running on my Mac.

Are there files that needs to be changed so that the client can connect to all of KBE services remotely?

I don’t know if my configuration issue is server side or client side. Note when I built the KBEngine with mysql server on ubuntu I made sure to connect to the database from localhost. No server config files were changed yet. I just installed the demo assets as is with the exception of Clientapp.cs in Unity.

NOTE Does anyone have the KBEngine Overview document in english?

Thanks
Tom

Tom Acunzo

unread,
Nov 26, 2016, 6:01:49 PM11/26/16
to kbengine...@googlegroups.com
I just noticed there is a way to add external / internal interfaces inside kbengine_defs.xml

I’ll try to see if changing this helps. Looking for more info but the kbengine.org website seems to be down.

-Tom

kbengine

unread,
Nov 27, 2016, 11:24:38 PM11/27/16
to KBEngine, sir...@gmail.com
  <!-- 
   (Forced to specify an external IP-address or Domain-name, In some server environment, May use the port mapping to access KBE,
   So KBE on current machines on the external IP address may be a LAN IP address, Then some functions will not normal.
   For example: account activation email address given callback.
   Note: the availability of server does not check the address, because cannot check)
  -->
  <externalAddress>  </externalAddress>       <!-- Type: String -->


在 2016年11月27日星期日 UTC+8上午7:01:49,Tom Acunzo写道:
I just noticed there is a way to add external / internal interfaces inside kbengine_defs.xml

I’ll try to see if changing this helps. Looking for more info but the kbengine.org website seems to be down.

-Tom
Message has been deleted

kbengine

unread,
Nov 27, 2016, 11:29:23 PM11/27/16
to KBEngine, sir...@gmail.com
You can look at this(externalAddress, externalInterface,internalInterface).
See you, the baseapp ip is the return of the 127.0.0.2


在 2016年11月27日星期日 UTC+8上午7:01:49,Tom Acunzo写道:
I just noticed there is a way to add external / internal interfaces inside kbengine_defs.xml

I’ll try to see if changing this helps. Looking for more info but the kbengine.org website seems to be down.

-Tom
Reply all
Reply to author
Forward
0 new messages