Skip to content

Commit

Permalink
fix: Replace obsolete EA backend with Project Rome for BFBC2
Browse files Browse the repository at this point in the history
  • Loading branch information
cetteup committed Apr 23, 2024
1 parent 13cd6fa commit 1d10df3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions GameserverLister/listers/bfbc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def update_server_list(self):
servers = None
while not request_ok and attempt < max_attempts:
try:
logging.info('Fetching server list from FESL/Theater API')
resp = self.session.get('https://fesl.cetteup.com/servers/pc', timeout=self.request_timeout)
logging.info('Fetching server list from Project Rome API')
resp = self.session.get('http://api.emulatornexus.com/v1/rome/servers', timeout=self.request_timeout)

if resp.ok:
servers = resp.json()
Expand All @@ -47,12 +47,12 @@ def update_server_list(self):
found_servers = []
for server in servers:
found_server = BadCompany2Server(
guid_from_ip_port(server['I'], server['P']),
server['N'],
int(server['LID']),
int(server['GID']),
server['I'],
int(server['P'])
guid_from_ip_port(server['remote_ip'], server['remote_port']),
server['hostname'],
257, # Project Rome only uses 257, but will return all servers regardless of the given LID
server['id'],
server['remote_ip'],
server['remote_port']
)

if self.add_links:
Expand All @@ -70,7 +70,7 @@ def check_if_server_still_exists(self, server: BadCompany2Server, checks_since_l
check_ok = True
found = False
try:
response = self.session.get(f'https://fesl.cetteup.com/servers/pc/{server.lid}/{server.gid}',
response = self.session.get(f'http://api.emulatornexus.com/v1/rome/server/{server.gid}',
timeout=self.request_timeout)

if response.ok:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The scripts support retrieval for following games from the listed sources. If yo
| Battlefield Vietnam | GameSpy | openspy.net, qtracker.com |
| Battlefield 2 | GamsSpy | bf2hub.com, playbf2.ru |
| Battlefield 2142 | GameSpy | novgames.ru, openspy.net, play2142.ru |
| Battlefield: Bad Company 2 | fesl/theater | Electronic Arts |
| Battlefield: Bad Company 2 | fesl/theater | Project Rome (emulatornexus.com) |
| Battlefield 3 | Battlelog | battlelog.com |
| Battlefield 4 | Battlelog | battlelog.com |
| Battlefield Hardline | Battlelog | battlelog.com |
Expand Down

0 comments on commit 1d10df3

Please sign in to comment.