Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7491: Send company update admin message when bankruptcy counter changes. #7492

Merged
merged 1 commit into from Apr 11, 2019

Conversation

@PeterN
Copy link
Member

@PeterN PeterN commented Apr 9, 2019

Fixes #7491. This is currently untested.

@PeterN PeterN marked this pull request as ready for review Apr 9, 2019
michicc
michicc approved these changes Apr 9, 2019
@Xaroth
Copy link
Contributor

@Xaroth Xaroth commented Apr 11, 2019

Tested this using my libottdadmin2 rework-wip branch:

DEBUG:__main__.Client:Packet received: ServerDate(date=datetime.datetime(1978, 10, 1, 0, 0))
DEBUG:__main__.Client:Packet received: ServerCompanyUpdate(company_id=1, name='Chedston Transport', manager='P. Bloggs', colour=8, passworded=False, bankruptcy_counter=1, shareholders=[255, 255, 255, 255])
DEBUG:__main__.Client:Packet received: ServerCompanyEconomy(company_id=1, money=-1895, current_loan=300000, income=-301895, delivered=0, history=[ServerCompanyEconomyHistory(value=78507, performance=0, delivered=0), ServerCompanyEconomyHistory(value=106864, performance=0, delivered=0)])

Company received its first counter update at 10/1978

DEBUG:__main__.Client:Packet received: ServerDate(date=datetime.datetime(1979, 1, 1, 0, 0))
DEBUG:__main__.Client:Packet received: ServerCompanyUpdate(company_id=1, name='Chedston Transport', manager='P. Bloggs', colour=8, passworded=False, bankruptcy_counter=2, shareholders=[255, 255, 255, 255])
DEBUG:__main__.Client:Packet received: ServerCompanyEconomy(company_id=1, money=-12167, current_loan=300000, income=-312167, delivered=0, history=[ServerCompanyEconomyHistory(value=52347, performance=0, delivered=0), ServerCompanyEconomyHistory(value=78507, performance=0, delivered=0)])

strike 2 at 01/1979 (3 months later, which is correct)

DEBUG:__main__.Client:Packet received: ServerDate(date=datetime.datetime(1979, 4, 1, 0, 0))
DEBUG:__main__.Client:Packet received: ServerCompanyUpdate(company_id=1, name='Chedston Transport', manager='P. Bloggs', colour=8, passworded=False, bankruptcy_counter=3, shareholders=[255, 255, 255, 255])
DEBUG:__main__.Client:Packet received: ServerCompanyEconomy(company_id=1, money=-22347, current_loan=300000, income=-10180, delivered=0, history=[ServerCompanyEconomyHistory(value=25586, performance=0, delivered=0), ServerCompanyEconomyHistory(value=52347, performance=0, delivered=0)])

and strike 3 at 04/1979, also expected

Finally:

DEBUG:__main__.Client:Packet received: ServerDate(date=datetime.datetime(1979, 7, 1, 0, 0))
DEBUG:__main__.Client:Packet received: ServerCompanyEconomy(company_id=1, money=-32713, current_loan=300000, income=-20546, delivered=0, history=[ServerCompanyEconomyHistory(value=683, performance=0, delivered=0), ServerCompanyEconomyHistory(value=25586, performance=0, delivered=0)])
DEBUG:__main__.Client:Packet received: ServerCompanyRemove(company_id=1, reason=<CompanyRemoveReason.BANKRUPT: 2>)

As expected, no 'update', but a removal instead.

LGTM.

@PeterN PeterN merged commit 0130f3b into OpenTTD:master Apr 11, 2019
8 checks passed
@PeterN PeterN deleted the fix-7491 branch Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants