Jump to content

Configure my own multiplayer lobby


potoelite
 Share

Recommended Posts

Hi, hope you are doing well.

I've been trying to configure multiplayer lobby on my server, but I have some problems.

According to the guide of installation of lobby bots here, I've configured ejabberd 22.05(latest) and executed xpartamupp.py and echelon.py scripts.

And I've replaced original lobby options such as room name, lobby url, etc  according to new lobby server.

At this point, I have following problems.

- I can register new account to multiplayer lobby, so I can confirm this in ejabberd admin page also. But I can't login with created account in the game.

Login dialog keeps saying "connecting..." after the connection is established. Why I think like this is because the account which I used is displayed as online status in ejabberd web admin, but not in the game. In ejabberd log, it also says new connection is opened.

- Server returns nothing response.

In existing 0 A.D game's multiplayer lobby, it sends response after the player connected to lobby.

{"time": 166032701, "historic": false "level": "connected", "type": "system"}

{"time": 166032702, "historic": false "level": "subject", "type": "chat", "nick": "user1", "subject": "This is the svn multiplayer lobby,\n\n If you want to play..."}

{"time": 166032702, "historic": false "level": "gamelist", "type": "game"}

But my server doesn't. It only sens response when the username and password are incorrect or unregister account is used.

 

I guess there is one more component to be installed for proper work of multiplayer lobby on my side.

There isn't any postgresql db handler on my model and both source code of game and multiplayer lobby-bots don't contain any one of above strings.

Also, the weird thing is that github repo name is just "lobby-bots", not "lobby", which means entire name of system

Please let me know how to fix this issue.

Thanks in advance for your help!

 

  • Like 1
Link to comment
Share on other sites

Hi, thanks for your reply.

But I don't think this is because of UI. Its due to multiplayer lobby configuration I think.

If you have completed guide to configure multiplayer lobby, please let me take a look at it.

As I wrote above, something is missing so far, I can't go forward anymore. :(

Edited by potoelite
Link to comment
Share on other sites

1 hour ago, potoelite said:

Hi, thanks for your reply.

But I don't think this is because of UI. Its due to multiplayer lobby configuration I think.

If you have completed guide to configure multiplayer lobby, please let me take a look at it.

As I wrote above, something is missing so far, I can't go forward anymore. :(

hi @potoelite, are you running it locally?

Link to comment
Share on other sites

2 hours ago, potoelite said:

At this point, I have following problems.

- I can register new account to multiplayer lobby, so I can confirm this in ejabberd admin page also. But I can't login with created account in the game.

Login dialog keeps saying "connecting..." after the connection is established. Why I think like this is because the account which I used is displayed as online status in ejabberd web admin, but not in the game. In ejabberd log, it also says new connection is opened.

- Server returns nothing response.

At that point the bots play no role yet, so you can ignore everything related to the bots. Your problem must be related to the ejabberd setup or 0ad configuration. Even without the bots you should be able to enter the multiplayer lobby. What won't work without the bots is hosting games and rating of games, but connecting to the lobby and chatting there doesn't need the bots.

To help you further we'd need some more information, like the 0ad configuration options you used, screenshots of the problem and a debug log from ejabberd.

2 hours ago, potoelite said:

I guess there is one more component to be installed for proper work of multiplayer lobby on my side.

No, everything you need should be in the README (albeit some details might be outdated).

2 hours ago, potoelite said:

There isn't any postgresql db handler on my model and both source code of game and multiplayer lobby-bots don't contain any one of above strings.

You don't need PostgreSQL. ejabberd should be configured to use its included mnesia database and EcheLOn can use any SQL-database supported by SQLalchemy. It defaults to sqlite if you don't explicitly configure something else.

2 hours ago, potoelite said:

Also, the weird thing is that github repo name is just "lobby-bots", not "lobby", which means entire name of system

There is no separate repository for the "lobby" itself, as the lobby is just ejabberd with the configuration mentioned in the README.

Link to comment
Share on other sites

27 minutes ago, Dunedan said:

At that point the bots play no role yet, so you can ignore everything related to the bots

So this means that hosting/joining game is impossible even after all is configured well?

28 minutes ago, Dunedan said:

To help you further we'd need some more information, like the 0ad configuration options you used, screenshots of the problem and a debug log from ejabberd.

Thanks, let me share my configuration information.
First, following is my default.cfg lobby settings

[lobby]
history = 0                         ; Number of past messages to display on join
room = "arena"                    ; Default MUC room to join
server = "ec2-54-174-96-13.compute-1.amazonaws.com"  ; Address of lobby server
tls = false                          ; Whether to use TLS encryption when connecting to the server.
verify_certificate = false          ; Whether to reject connecting to the lobby if the TLS certificate is invalid (TODO: wait for Gloox GnuTLS trust implementation to be fixed)
terms_url = "https://dummpy.com"; Allows the user to save the text and print the terms
terms_of_service = "1"              ; Version (hash) of the Terms of Service that the user has accepted
terms_of_use = "1"                  ; Version (hash) of the Terms of Use that the user has accepted
privacy_policy = "1"                ; Version (hash) of the Privacy Policy that the user has accepted
xpartamupp = "xpartamupp"             ; Name of the server-side XMPP-account that manage games
echelon = "echelon"               ; Name of the server-side XMPP-account that manages ratings
buddies = ","                       ; Comma separated list of playernames that the current user has marked as buddies
rememberpassword = true             ; Whether to store the encrypted password in the user config
 
[lobby.columns]
gamerating = false                  ; Show the average rating of the participating players in a column of the gamelist
 
[lobby.stun]
enabled = true                       ; The STUN protocol allows hosting games without configuring the firewall and router.
                                     ; If STUN is disabled, the game relies on direct connection, UPnP and port forwarding.
server = "ec2-54-174-96-13.compute-1.amazonaws.com"   ; Address of the STUN server.
port = 3478                          ; Port of the STUN server.
delay = 200                          ; Duration in milliseconds that is waited between STUN messages.
                                     ; Smaller numbers speed up joins but also become less stable.

I have configured ejabberd on aws ec2 instance.

As I said, I can register new account in game and after I try to connect, the game keep says "connecting...", but ejabbered log and web admin says the account is connected and online. 

This is ejabberd log statements, I disabled TLS in authetication.
2022-08-13 16:30:06.144478+00:00 [info] <0.777.0>@ejabberd_listener:accept/7:273 (<0.4170.0>) Accepted connection 188.43.235.177:17278 -> 172.31.28.90:5222
2022-08-13 16:30:06.669178+00:00 [info] <0.4170.0>@ejabberd_c2s:process_auth_result/3:268 (tcp|<0.4170.0>) Accepted c2s SCRAM-SHA-1 authentication for qwe@ec2-54-174-96-13.compute-1.amazonaws.com by mnesia backend from 188.43.235.177
2022-08-13 16:30:07.161255+00:00 [info] <0.4170.0>@ejabberd_c2s:bind/2:446 (tcp|<0.4170.0>) Opened c2s session for qwe@ec2-54-174-96-13.compute-1.amazonaws.com/0ad-2CA544C06C093BEE

Screenshot_8.png.27c6b7cc13c37510f8621c3589c1590d.png

Above is what ejabberd admin page shows in users panel.

By using other XMPP client like Pidgin, I can create account and login, chat there.

But as the game uses encrypted password by itself, so I can't use the account create by game in other xmpp client as password is regarded incorrect.


 

Link to comment
Share on other sites

3 hours ago, potoelite said:

In existing 0 A.D game's multiplayer lobby, it sends response after the player connected to lobby.

{"time": 166032701, "historic": false "level": "connected", "type": "system"}

{"time": 166032702, "historic": false "level": "subject", "type": "chat", "nick": "user1", "subject": "This is the svn multiplayer lobby,\n\n If you want to play..."}

{"time": 166032702, "historic": false "level": "gamelist", "type": "game"}

I just tried to print response messages when new ones arrived from lobby server.

Above statements are arrived when the game uses current 0A.D's multiplayer lobby.

But after I have replaced it with my own server, nothing arrives.

Also I'm wondering about who sends this message to the game client.

Because I can't find any string resource like "This is the svn multiplayer lobby,\n\n If you want to play..." anywhere. There aren't any such string in source code of the game and multiplayer lobby.

Edited by potoelite
Link to comment
Share on other sites

12 minutes ago, potoelite said:

Because I can't find any string resource like "This is the svn multiplayer lobby,\n\n If you want to play..." anywhere. There aren't any such string in source code of the game and multiplayer lobby.

It's define in the Xmpp channel Which in your case seem to be named arena. In theory if your server is set up properly you should be able to use gajim or any xmpp client to connect.

Link to comment
Share on other sites

23 minutes ago, potoelite said:

So this means that hosting/joining game is impossible even after all is configured well?

Sorry for being not clear. That means you should be able to join the lobby and chat there without the bots. With the bots correctly configured hosting games and having ratings available will work.

 

26 minutes ago, potoelite said:

But as the game uses encrypted password by itself, so I can't use the account create by game in other xmpp client as password is regarded incorrect.

When registering an account with 0ad not the provided password will be used as actual password of the account, but a hash of it. You can find this hash in the 0ad config file and can use it as password to connect with other XMPP-clients.

21 minutes ago, potoelite said:

Also I'm wondering about who sends this message to the game client.

As @Stan` already mentioned: That message is the topic set for the #arena26 MUC room on the Wildfiregames lobby server, so technically ejabberd is sending it to you.

24 minutes ago, potoelite said:

I have configured ejabberd on aws ec2 instance.

Right now this ejabberd instance is publicly available and everybody can create accounts there and connect to it. I'm not sure if that's intended. I just created an account there and can confirm: registering via 0ad works, login via 0ad doesn't. However login with other XMPP-clients works, which is something I haven't seen before.

I did some debugging and figured out what the problem is: When you try to log in using 0ad, 0ad connects indeed successfully to the server, but when it then tries to join the "arena" MUC room it receives an unexpected response, as that room doesn't exist and the user is also not permitted to create it. So creating the "arena" MUC room should get 0ad to work.

In case you were also getting "authentication failed" messages in 0ad, that's because 0ad does only seem to the password, when the connection to the lobby was made successfully, which isn't the case right now. Typing in the password again before connecting solves this.

  • Like 1
  • Haha 1
Link to comment
Share on other sites

Hi @Dunedanthanks for your help! Now I can connect with my account into multiplayer lobby, but I have one more problem.

When Im going to host new game, it fails with the error dialog saying "Cannot host game.. Failed to host via STUN".

But when I disable the checkbox "Use STUN to work around firewalls", it works.

So i guess the reason is because of STUN configuration in ejabberd, but I'm not sure which one needs to be modified.

This is STUN related setting in ejabberd config file.

port: 3478

ip: "0.0.0.0

transport: udp

module: ejabberd_stun

use_turn: true

turn_ipv4_address: "x.x.x.x

Thanks for your advices.

 

Link to comment
Share on other sites

1 hour ago, potoelite said:

So i guess the reason is because of STUN configuration in ejabberd, but I'm not sure which one needs to be modified.

 

your stun port seems to be pointing wrongly or doesnt exists . I will recommend you maintain 

server = "lobby.wildfiregames.com" 
port = 3478 
 
// In this case it should work using the default 0ad stun. Tested both locally and on my own VPS and it worked. Should work for you
Edited by rossenburg
Link to comment
Share on other sites

Hi, thanks again for your help.

Now I can do hosting & joining games, and chat with other players.

But, there are still not working issue.

Leaderboard and profile lookup don't work for now.

I found that rating bot uses sql database, unlike you said before.

According to the installation guide, I have created new sql db file called lobby_rankings.sqlite3 by running command python3 lobby_ranking.py create.

But when I run the echelon.py, bunch of sql db errors appear.

For example, when I search player on proflie lookup, then following error is shown.

KeyError: 'rating'
2022-08-19 14:20:07 ERROR    Failed to send profile about  to
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py", line 625, in _iq_profile_handler
    self._send_profile(iq, iq['profile']['command'])
  File "/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py", line 733, in _send_profile
    stanza.add_item(player_nick, stats['rating'], stats['highestRating'],

Could you please explain how to fix this?

Link to comment
Share on other sites

37 minutes ago, potoelite said:

I found that rating bot uses sql database, unlike you said before.

Of course it does and I didn't say otherwise.

39 minutes ago, potoelite said:

Could you please explain how to fix this?

You likely didn't properly configure ejabberd, so EcheLOn doesn't get the JID of users joining the MUC room. To fix that you have to either ensure that the MUC room isn't anonymous or that the bots have MUC admin permissions. How to configure any of that is documented in the README.

If you can't get that to work, posting your ejabberd.yml here would be helpful for further debugging.

 

Link to comment
Share on other sites

This is my config file.

listen:
  -
    port: 5222
    ip: "0.0.0.0"
    module: ejabberd_c2s
    max_stanza_size: 1048576
    shaper: c2s_shaper
    access: c2s
    starttls_required: false
  -
    port: 5223
    ip: "::"
    tls: true
    module: ejabberd_c2s
    max_stanza_size: 262144
    shaper: c2s_shaper
    access: c2s
    starttls_required: true
##  -
##    port: 5269
##    ip: "::"
##    module: ejabberd_s2s_in
##    max_stanza_size: 524288
  -
    port: 5443
    ip: "::"
    module: ejabberd_http
    tls: true
    request_handlers:
      /admin: ejabberd_web_admin
      /api: mod_http_api
      /bosh: mod_bosh
      /captcha: ejabberd_captcha
      /upload: mod_http_upload
      /ws: ejabberd_http_ws
  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    request_handlers:
      /admin: ejabberd_web_admin
      /.well-known/acme-challenge: ejabberd_acme
  -
    port: 3478
    ip: "0.0.0.0"
    transport: udp
    module: ejabberd_stun
    # use_turn: true
    ## The server's public IPv4 address:
    # turn_ipv4_address: "54.174.96.13"
    ## The server's public IPv6 address:
    # turn_ipv6_address: "2001:db8::3"
  -
    port: 1883
    ip: "::"
    module: mod_mqtt
    backlog: 1000

s2s_use_starttls: optional

acl:
  local:
    user_regexp: ""
  loopback:
    ip:
      - 127.0.0.0/8
      - ::1/128
  admin:
    user: admin@ec2-54-174-96-13.compute-1.amazonaws.com
  validname:
    user_regexp: "^[0-9A-Za-z._-]{1,20}$"
  bots:
    user: xpartamupp@ec2-54-174-96-13.compute-1.amazonaws.com
    user: echelon@ec2-54-174-96-13.compute-1.amazonaws.com


access_rules:
  local:
    allow: local
  c2s:
    deny: blocked
    allow: all
  announce:
    allow: admin
  configure:
    allow: admin
  muc_create:
    allow: local
  muc_admin:
    allow: admin, bots
  ipbots:
    allow: bots
  pubsub_createnode:
    allow: bots
  trusted_network:
    allow: loopback
  register:
    allow: validname

api_permissions:
  "console commands":
    from:
      - ejabberd_ctl
    who: all
    what: "*"
  "admin access":
    who:
      access:
        allow:
          - acl: loopback
          - acl: admin
      oauth:
        scope: "ejabberd:admin"
        access:
          allow:
            - acl: loopback
            - acl: admin
    what:
      - "*"
      - "!stop"
      - "!start"
  "public commands":
    who:
      ip: 127.0.0.1/8
    what:
      - status
      - connected_users_number

registration_timeout: 3600

shaper:
  normal:
    rate: 3000
    burst_size: 20000
  fast: 100000

shaper_rules:
  max_user_sessions: 10
  max_user_offline_messages:
    5000: admin
    100: all
  c2s_shaper:
    none: admin, bots
    normal: all
  s2s_shaper: fast

modules:
  mod_ipstamp: {}
  mod_adhoc: {}
  mod_admin_extra: {}
  mod_announce:
    access: announce
  mod_avatar: {}
  mod_blocking: {}
  mod_bosh: {}
  mod_caps: {}
  mod_carboncopy: {}
  mod_client_state: {}
  mod_configure: {}
  mod_disco: {}
  mod_fail2ban: {}
  mod_http_api: {}
  mod_http_upload:
    put_url: https://@HOST@:5443/upload
    custom_headers:
      "Access-Control-Allow-Origin": "https://@HOST@"
      "Access-Control-Allow-Methods": "GET,HEAD,PUT,OPTIONS"
      "Access-Control-Allow-Headers": "Content-Type"
  mod_last: {}
  mod_mam:
    ## Mnesia is limited to 2GB, better to use an SQL backend
    ## For small servers SQLite is a good fit and is very easy
    ## to configure. Uncomment this when you have SQL configured:
    ## db_type: sql
    assume_mam_usage: true
    default: always
  mod_mqtt: {}
  mod_muc_log:
   outdir: "/lobby/logs"
   file_format: plaintext
   timezone: universal
  mod_muc:
    access:
      - allow
    access_admin: muc_admin
    access_create: muc_admin
    access_persistent: muc_admin
    access_mam:
      - allow
    max_users: 5000
    default_room_options:
      mam: true
      max_users: 1000
      logging: true
      persistent: true
      allow_change_subj: false
      anonymous: false
  mod_muc_admin: {}
  mod_offline:
    access_max_user_messages: max_user_offline_messages
  mod_ping:
    send_pings: true
  mod_privacy: {}
  mod_private: {}
  mod_proxy65:
    access: local
    max_connections: 5
  mod_pubsub:
    access_createnode: pubsub_createnode
    plugins:
      - flat
      - pep
    force_node_config:
      ## Avoid buggy clients to make their bookmarks public
      storage:bookmarks:
        access_model: whitelist
  mod_push: {}
  mod_push_keepalive: {}
  mod_register:
    ## Only accept registration requests from the "trusted"
    ## network (see access_rules section above).
    ## Think twice before enabling registration from any
    ## address. See the Jabber SPAM Manifesto for details:
    ## https://github.com/ge0rg/jabber-spam-fighting-manifesto
    ## ip_access: trusted_network
    access: register
  mod_roster:
    versioning: true
  mod_s2s_dialback: {}
#  mod_shared_roster: {}
  mod_stream_mgmt:
    resend_on_timeout: if_offline
  mod_stun_disco: {}
  mod_vcard: {}
  mod_vcard_xupdate: {}
  mod_version:
    show_os: false

### Local Variables:
### mode: yaml
### End:
### vim: set filetype=yaml tabstop=8
 

Link to comment
Share on other sites

I have revised the conf file, but when I start the echlon, there are still warning messages;

2022-08-19 16:09:31 INFO     JID set to: echelon@ec2-54-174-96-13.compute-1.amazonaws.com/CC
2022-08-19 16:09:31 INFO     EcheLOn started
/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py:72: SAWarning: relationship 'PlayerInfo.player' will copy column players.id to column players_info.player_id, which conflicts with relationship(s): 'Player.games' (copies players.id to players_info.player_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="games"' to the 'PlayerInfo.player' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  player = self.db.query(Player).filter(func.lower(Player.jid) == str(jid).lower()).first()
/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py:72: SAWarning: relationship 'Player.games_info' will copy column players.id to column players_info.player_id, which conflicts with relationship(s): 'Player.games' (copies players.id to players_info.player_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="games"' to the 'Player.games_info' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  player = self.db.query(Player).filter(func.lower(Player.jid) == str(jid).lower()).first()
/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py:72: SAWarning: relationship 'PlayerInfo.game' will copy column games.id to column players_info.game_id, which conflicts with relationship(s): 'Player.games' (copies games.id to players_info.game_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="games"' to the 'PlayerInfo.game' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  player = self.db.query(Player).filter(func.lower(Player.jid) == str(jid).lower()).first()
/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py:72: SAWarning: relationship 'Game.player_info' will copy column games.id to column players_info.game_id, which conflicts with relationship(s): 'Player.games' (copies games.id to players_info.game_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="games"' to the 'Game.player_info' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  player = self.db.query(Player).filter(func.lower(Player.jid) == str(jid).lower()).first()
/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py:72: SAWarning: relationship 'Game.players' will copy column games.id to column players_info.game_id, which conflicts with relationship(s): 'Game.player_info' (copies games.id to players_info.game_id), 'Player.games' (copies games.id to players_info.game_id), 'PlayerInfo.game' (copies games.id to players_info.game_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="game,games,player_info"' to the 'Game.players' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  player = self.db.query(Player).filter(func.lower(Player.jid) == str(jid).lower()).first()
/usr/local/lib/python3.7/site-packages/XpartaMuPP-0.24-py3.7.egg/xpartamupp/echelon.py:72: SAWarning: relationship 'Game.players' will copy column players.id to column players_info.player_id, which conflicts with relationship(s): 'Player.games' (copies players.id to players_info.player_id), 'Player.games_info' (copies players.id to players_info.player_id), 'PlayerInfo.player' (copies players.id to players_info.player_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="games,games_info,player"' to the 'Game.players' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  player = self.db.query(Player).filter(func.lower(Player.jid) == str(jid).lower()).first()
 

Edited by potoelite
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...