Page MenuHomeWildfire Games

Lobby Bot Optimizations and Upgrade to SleekXMPP 1.3.1+ (Merge from github branch)
ClosedPublic

Authored by scythetwirler on Mar 11 2017, 2:11 AM.

Details

Summary

Adds caching of ratinglist and boardlist.
Don't send list updates to busy people.
Upgrade iq handling code to handle SleekXMPP 1.3.1
Fix race condition with "ghost games"
Allow hosts to repopulate game list upon bot reboot with another update.
Make queries case insensitive due to platform-dependent case of JIDs.

Test Plan

Deploy in SVN lobby, monitor performance, verify functionality.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 721
Build 1143: Vulcan BuildJenkins
Build 1142: arc lint + arc unit

Event Timeline

scythetwirler created this revision.Mar 11 2017, 2:11 AM
scythetwirler added a subscriber: Restricted Owners Package.
scythetwirler edited the summary of this revision. (Show Details)Mar 11 2017, 2:32 AM
Vulcan added a subscriber: Vulcan.Mar 11 2017, 2:55 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/493/ for more details.

scythetwirler retitled this revision from Lobby Bot Optimizations and Upgrade to SleekXMPP 1.3.1+ to Lobby Bot Optimizations and Upgrade to SleekXMPP 1.3.1+ (Merge from github branch).Mar 11 2017, 3:56 AM
scythetwirler edited the summary of this revision. (Show Details)
scythetwirler planned changes to this revision.Mar 11 2017, 11:03 PM

gonna change some things to how iqhandler works

Removes broken cleanup code.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/515/ for more details.

elexis edited edge metadata.

Perhaps user1 can find something about this as he setup the lobby bots locally.

user1 edited edge metadata.Apr 12 2017, 10:03 PM

Wish I had seen this sooner. I'll mess with it this evening and see if I can get it running.

user1 added a comment.EditedApr 14 2017, 3:07 AM

It works mostly...

Seems to be some problem with the certificate validation but I'm not sure if that is just my problem (like because it's localhost)...

Here's what I got at first:

2017-04-13 17:28:24        DEBUG    Loaded Plugin: RFC 6120: Stream Feature: STARTTLS
2017-04-13 17:28:24        DEBUG    Loaded Plugin: RFC 6120: Stream Feature: Resource Binding
2017-04-13 17:28:24        DEBUG    Loaded Plugin: RFC 3920: Stream Feature: Start Session
2017-04-13 17:28:24        DEBUG    Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning
2017-04-13 17:28:24        DEBUG    Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval
2017-04-13 17:28:24        DEBUG    Loaded Plugin: RFC 6120: Stream Feature: SASL
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0030: Service Discovery
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0004: Data Forms
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0045: Multi-User Chat
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0082: XMPP Date and Time Profiles
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0131: Stanza Headers and Internet Metadata
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0060: Publish-Subscribe
2017-04-13 17:28:24        DEBUG    Loaded Plugin: XEP-0199: XMPP Ping
2017-04-13 17:28:24        DEBUG    Waiting 2.3096302383511516 seconds before connecting.
2017-04-13 17:28:27        DEBUG    DNS: Querying SRV records for localhost
2017-04-13 17:28:27        DEBUG    DNS: No SRV records for localhost.
2017-04-13 17:28:27        DEBUG    DNS: Querying localhost for AAAA records.
2017-04-13 17:28:27        DEBUG    DNS: Querying localhost for A records.
2017-04-13 17:28:27        DEBUG    Connecting to [::1]:5222
2017-04-13 17:28:27        DEBUG    Event triggered: connected
2017-04-13 17:28:27        DEBUG     ==== TRANSITION disconnected -> connected
2017-04-13 17:28:27        DEBUG    Starting HANDLER THREAD
2017-04-13 17:28:27        DEBUG    Loading event runner
2017-04-13 17:28:27        DEBUG    SEND (IMMED): <stream:stream to='localhost' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
2017-04-13 17:28:27        DEBUG    RECV: <stream:stream id="3222856866" version="1.0" xml:lang="en" from="localhost">
2017-04-13 17:28:27        DEBUG    RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns="http://jabber.org/protocol/caps" node="http://www.process-one.net/en/ejabberd/" ver="aIT+/ulfcbHXDKPkCA+iw9x5mU8=" hash="sha-1" /><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
2017-04-13 17:28:27        DEBUG    SEND (IMMED): <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
2017-04-13 17:28:27        DEBUG    RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
2017-04-13 17:28:27        DEBUG    Starting TLS
2017-04-13 17:28:27        INFO     Negotiating TLS
2017-04-13 17:28:27        INFO     Using SSL version: TLS 1.0
2017-04-13 17:28:27        DEBUG    CERT: -----BEGIN CERTIFICATE-----
MIIDmzCCAoOgAwIBAgIJAJO4/oc+3gGbMA0GCSqGSIb3DQEBCwUAMGQxITAfBgNV
BAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UECwwGdWJ1bnR1MREw
DwYDVQQDDAhlamFiYmVyZDEbMBkGCSqGSIb3DQEJARYMcm9vdEB1YnVudHUuMB4X
DTE3MDQxMTE2MDIyNVoXDTE4MDQxMTE2MDIyNVowZDEhMB8GA1UECgwYSW50ZXJu
ZXQgV2lkZ2l0cyBQdHkgTHRkMQ8wDQYDVQQLDAZ1YnVudHUxETAPBgNVBAMMCGVq
YWJiZXJkMRswGQYJKoZIhvcNAQkBFgxyb290QHVidW50dS4wggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQDRT1qbSxUXoFZizaK1kTFKQX7W9O/6tWRa8wb1
VgFFeHETSJQjgNBNOYz0pMpqLS30IkuIcmDAi0av550fr0y+aS3L2zDNjU5RuHIO
ZeXNddSO7tZXIQ/uCxTHKV1RB837TruUUq14nF/JEVfFoHqIrKQzxqQyjrS5sIZ6
twO0J7CpY02PnI08BlR9xCIXNiWuf8SFJASvjQ8PsThuGIL0s+NcvIu+WljaJ8bL
rzmMBJ0nx8hM+Rll/x6LeuMb1w2Yxlr1nSXvXS5D+tYiILZgjGCeyWfOhhtttsYu
e+ko8aH+oqNLr+XgnhG6L6xXZ981keX86XwT38sr9wlToBvtAgMBAAGjUDBOMB0G
A1UdDgQWBBSJ0gWMMkhFTGFAI4eAW/b4v5PLxjAfBgNVHSMEGDAWgBSJ0gWMMkhF
TGFAI4eAW/b4v5PLxjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQC4
BFjXvWNm3rVt/o4UW8kysRq7PQDs3T59+vtz0ASNWe3WFbJ+px88i8eNsSkKCFog
K/7M5upjKcYjTFGBQ7xbakPiL5RxL+4NDyCldxp3wgWUBRa41GaAp1nRJgYTX5it
bJh4P1VTPwO+C8tPnuSjvTSzCtXb/MEdab+k75QEMpfczFof2kkdLhLp7wbuVDvo
73oa8hifwvawaUgeogjOc5M978t0C9GZ9cgu0OVQO8gqTiNhKT9cqaEwxmPgF07V
ukvVL/odlAAmMZSEGO7v6iV5J3iUaksONBQGsje5uiX0Ep2rItRoiFW+mMWxeJFx
TZlVLkaC07rpNyJS49bi
-----END CERTIFICATE-----

2017-04-13 17:28:27        DEBUG    Event triggered: ssl_cert
2017-04-13 17:28:27        ERROR    Could not match certificate against hostname: localhost
2017-04-13 17:28:27        DEBUG    Event triggered: session_end
2017-04-13 17:28:27        DEBUG    Event triggered: disconnected
2017-04-13 17:28:27        DEBUG     ==== TRANSITION connected -> disconnected
2017-04-13 17:28:27        DEBUG    SEND (IMMED): <stream:stream to='localhost' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
2017-04-13 17:28:27        DEBUG    Event triggered: socket_error
2017-04-13 17:28:27        WARNING  Failed to send b"<stream:stream to='localhost' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>"
2017-04-13 17:28:27        DEBUG    Event triggered: session_end
2017-04-13 17:28:27        DEBUG    Event triggered: socket_error
2017-04-13 17:28:27        DEBUG    Event triggered: disconnected
2017-04-13 17:28:27        DEBUG     ==== TRANSITION connected -> disconnected
2017-04-13 17:28:27        DEBUG    Event triggered: socket_error
2017-04-13 17:28:27        ERROR    Socket Error #9: Bad file descriptor
2017-04-13 17:28:27        DEBUG    reconnecting...

But I added the following workaround and was able to skip the certificate:

  self.add_event_handler("ssl_invalid_cert", self.discard)

def discard(self, raw_cert):

discard() is just an empty function.

ejabberd 15.03
SleekXMPP 1.3.1

user1 requested changes to this revision.Apr 29 2017, 1:53 AM
user1 added inline comments.
source/tools/XpartaMuPP/XpartaMuPP.py
281

'busy' needs be 'dnd' here

This revision now requires changes to proceed.Apr 29 2017, 1:53 AM

Just to confirm, that error was when you tried to connect your local ejabberd instance, correct?

user1 added a comment.May 4 2017, 11:29 PM

Yes the certificate thing appears to be caused when I upgrade sleekxmpp to 1.3.1.

The issue on line 281 caused a bug which led to the game list not being updated for a user just returning to the lobby after finishing a game.

elexis resigned from this revision.Dec 12 2017, 8:18 PM
Dunedan added a subscriber: Dunedan.Jan 7 2018, 7:15 PM
Dunedan added inline comments.
source/tools/XpartaMuPP/EcheLOn.py
537–538

The solution from D1182 is was cleaner in this regard.

This revision was not accepted when it landed; it landed in state Needs Revision.Apr 14 2018, 2:44 PM
This revision was automatically updated to reflect the committed changes.