• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[MOD] Single server and protocol

Could someone please update this mod? I dont have an expansive knowledge of OTClient just yet. I did look at the error logs and it appears to me the current mod is using an outdated function

Code:
== application started at Dec 05 2017 18:02:43
OTClient 0.6.6 rev 0 (df422c0) built on Feb 17 2017 for arch x86
ERROR: protected lua call failed: LUA ERROR:
/client_entergame/entergame.otui:95: [@onSetup]:2: attempt to call field 'getSupportedProtocols' (a nil value)
stack traceback:
    [C]: in function 'getSupportedProtocols'
    /client_entergame/entergame.otui:95: [@onSetup]:2: in function </client_entergame/entergame.otui:95: [@onSetup]:1>
    [C]: in function 'displayUI'
    /client_entergame/entergame.lua:97: in function 'init'
    /client_entergame/entergame.otmod:10:[@onLoad]:3: in main chunk
    [C]: in function 'ensureModuleLoaded'
    /init.lua:42: in main chunk
ERROR: failed to create widget from style 'NodeImage': 'NodeImage' is not a defined style
Startup done :]
ERROR: lua function callback failed: LUA ERROR:
C++ call failed: Client version 1100 not supported
stack traceback:
    [C]: ?
    [C]: in function 'setClientVersion'
    /client_entergame/entergame.lua:250: in function 'doLogin'
    /client_entergame/entergame.lua:146: in function </client_entergame/entergame.lua:144>
Exiting application..

I did look otclient/protocolgamesend.cpp at master · edubart/otclient · GitHub

and (to what i can understand), getSupportedProtocols is now being called getProtocolVersion()

Now before people ask, i did replace all found 'getSupportedProtocols' with 'getProtocolVersion' and it still didnt fix the error. So it is above my ability at this moment.
 
<cough> Sorry been gone a long time....looking this over.

inside otclientrc.lua add:

Code:
EnterGame.setUniqueServer(host, port, protocol)


This is correct and the mod is not needed. This appears to be all containable in the line of code posted however note the following.

EnterGame.setUniqueServer(host, port, protocol)

Must be ""

EnterGame.setUniqueServer("10.0.0.10", "7171", "1098")


Tested working for me, thank you shawak.
 
This is not a good solution to replace whole module, as there are many new updated things inside, like authenticator added in recent updates.

So, my solution is to just create a new file: modules/client_entergame/server.otmod

Code:
Module
  name: addon_server
  description: Single server and protocol
  author: Fabricio Damazio
  

  autoload: true
  autoload-priority: 1000

  dependencies:
    -client_entergame

  @onLoad: |
    EnterGame.setUniqueServer("127.0.0.1", 7171, 1098)
 
This is not a good solution to replace whole module, as there are many new updated things inside, like authenticator added in recent updates.

So, my solution is to just create a new file: modules/client_entergame/server.otmod

Code:
Module
  name: addon_server
  description: Single server and protocol
  author: Fabricio Damazio
 

  autoload: true
  autoload-priority: 1000

  dependencies:
    -client_entergame

  @onLoad: |
    EnterGame.setUniqueServer("127.0.0.1", 7171, 1098)
Hi slaw! I've tried ur solution but i can't get it to work. Any1 have any ideas about this? Thanks in advance.
 

Attachments

Hi slaw! I've tried ur solution but i can't get it to work. Any1 have any ideas about this? Thanks in advance.
check your init.lua you can have something like this probably

Lua:
ALLOW_CUSTOM_SERVERS = true -- if true it shows option ANOTHER on server list
 
check your init.lua you can have something like this probably

Lua:
ALLOW_CUSTOM_SERVERS = true -- if true it shows option ANOTHER on server list
Yes exactly as that line, i've tried both false and true. Still same error... but thats not on line 78 and 92 which the error refers to...
 
Send me dm what exactly you did
Solved! Dumb mistake... I did as you said. I rewinded the changes I made, and put exactly that line to false and I added my own ip/server-adress and now it automatically connects to mine. Thanks alot!
 
Solved! Dumb mistake... I did as you said. I rewinded the changes I made, and put exactly that line to false and I added my own ip/server-adress and now it automatically connects to mine. Thanks alot!
Good :D
 
Back
Top