Welcome, Guest
Username: Password: Remember me


Welcome to the BTPro OpenTTD Community

This community was build around the game: OpenTTD
OpenTTD is an (Free) open source simulation game based upon Transport Tycoon Deluxe


 

!!! SERVER HAVE BEEN UPGRADED TO 14.1 (Finally :-) ) !!!
!!! Please find the new client (supplied by Citymania and N-Ice) download links in the forum !!!
!!! Link to the forum is below !!!

Frank



Please take a look at BTPro's VIP Membership

BTPro VIP Membership Logo

Please click here for more information or to sign-up.


 

Screenshot created 2 Minutes ago on server:
-BTPro.nl- #33 - BusyBee Goals | Random Map & Random Climate | START-GOAL:

OpentTTD Screenshot



Make sure to download the newest version of the Modified OpenTTD Client from the "BTPro OpenTTD Client Talk" Forum!

!!! BTPro Client Latest Update: the 18th of Juli 2024 !!!
!!! Current OpenTTD Version: 14.1 !!!

Goto the "BTPro OpenTTD Client Talk" forum to download the client and leave a message if it's working for you



Currently we have 4 Server Operators:

Frank, ST2, Wacko1976, Inscius!

We are badly looking for moderators!

Want to be part of the team?! Want to help?! Read below...


 
NOTE:
Admins will act on the basis that ALL players know the game and it's mechanics.
We think that no one goes to an online game without first some practice and know how to play it.
Companies without registered nicknames (as shown in Client List) on it, can be reset without warning!
To learn OpenTTD mechanics, there is a forum/wiki and... a Single Player mode!!
Practice before playing on BTPro, and if you decide to start, READ THE RULES first.


 
If you wish to become part of the BTPro Server Operator family, ensuring that the rules are upheld with fairly and justly,
the willingness to teach new players on how to play the game and to make sure BTPro is one of the most relaxed,
entertaining servers out there for OpenTTD then apply in the Moderator Applications section below!

Also do not hesitate to ask us a question in the forums or when you see us online on one of the servers!

Happy Gaming!

TOPIC:

Re: BTPro Client Suggestions 11 years 3 months ago #1834

I give you the first patch I wrote that was functional on 3.0rc1/-. You will find the code required to get rid of wininet. I include only standard C/C++ stuff and network/core/tcp_http.h which contains the declaration of the HTTPCallback class, the OpenTTD's internal HTTP client facility.

diff -ru openttd-1.3.0-RC1/src/network/network_chat_gui.cpp openttd-1.3.0-RC1-btpro/src/network/network_chat_gui.cpp
--- openttd-1.3.0-RC1/src/network/network_chat_gui.cpp 2013-02-19 15:08:33.000000000 -0500
+++ openttd-1.3.0-RC1-btpro/src/network/network_chat_gui.cpp 2013-03-02 02:05:31.506887601 -0500
@@ -267,6 +267,101 @@
_chatmessage_dirty = false;
}

+#include <stdio.h>
+#include <ctype.h>
+#include "core/tcp_http.h"
+#include <iostream>
+
+static void SendChat(const char *buf, DestType type, int dest);
+
+class BTProAccountManager: public HTTPCallback {
+public:
+ BTProAccountManager(const char *u, const char *p): username(u), password(p), is_btpro_server(0) {}
+
+ int onServerConnectHandler() {
+ if (strcmp(_settings_client.network.last_host, "83.137.149.29") && // main server
+ strcmp(_settings_client.network.last_host, "95.97.242.6")) { // 1.3rc1 test server
+ this->is_btpro_server = false;
+ IConsolePrint( CC_INFO, "*** NOT A BTPRO SERVER ***");
+ } else {
+ char b[256];
+ this->is_btpro_server = _settings_client.network.last_port - 3980;
+ snprintf(b, 256, "*** BTPRO SERVER #%d ***", this->is_btpro_server);
+ }
+ return this->is_btpro_server;
+ }
+
+ int isBTProServer() {
+ return this->is_btpro_server;
+ }
+
+ void initiateLoginSequence() {
+ char uri[512];
+ IConsolePrint(CC_INFO, "INITIATING LOGIN SEQUENCE");
+ snprintf(uri, 512, "openttd.btpro.nl/gettoken.php?user=%s&password=%s", this->username, this->password);
+ std::cout << "sending to http server: " << uri << std::endl;
+ this->cursor = this->buf;
+ NetworkHTTPSocketHandler::Connect(uri, this, 0, 0);
+ }
+
+ void sendLoginString() {
+ char b[16];
+ snprintf(b, 16, "!login %s", this->buf);
+ SendChat(b, DESTTYPE_CLIENT, 1);
+ IConsolePrint( CC_INFO, "LOGIN STRING SENT");
+ }
+
+ void inspectLoginData() {
+ IConsolePrint(CC_INFO, "INSPECTING DATA");
+ if (this->cursor - this->buf == 4) {
+ this->sendLoginString();
+ IConsolePrint( CC_INFO, "*** BTPRO Authentification successful ***");
+ }
+ else {
+ char b[512];
+ snprintf(b, 512, "*** BTPRO Authentification failed: %s", this->buf);
+ IConsolePrint(CC_ERROR, b);
+ }
+
+ }
+
+ virtual void OnFailure() {
+ std::cout << "*** UNABLE TO RETRIEVE BTPRO LOGIN TOKEN FROM HTTP SERVER ***" << std::endl;
+ }
+
+ virtual void OnReceiveData( const char *data, size_t length) {
+ size_t i = length;
+
+ if (data == 0) {
+ std::cout << "*** RECEIVED ALL HTTP DATA ***" << std::endl;
+ this->inspectLoginData();
+ this->cursor = 0;
+ } else {
+ std::cout << "*** RECEIVING HTTP DATA ***" << std::endl;
+ while ( this->cursor - this->buf < 512 && i) {
+ *this->cursor = *data;
+ data++;
+ this->cursor++;
+ i--;
+ }
+ if (this->cursor - this->buf >= 512)
+ this->buf[511] = 0;
+ else
+ *this->cursor = 0;
+ }
+ }
+private:
+ const char *username;
+ const char *password;
+ int is_btpro_server;
+
+ NetworkHTTPContentConnecter *conn;
+ char buf[512];
+ char *cursor;
+};
+
+static BTProAccountManager accmgr ("Username", "Password");
+
/**
* Send an actual chat message.
* @param buf The message to send.
@@ -277,7 +372,29 @@
{
if (StrEmpty(buf)) return;
if (!_network_server) {
- MyClient::SendChat((NetworkAction)(NETWORK_ACTION_CHAT + type), type, dest, buf, 0);
+ const char *p = buf;
+
+ // just making sure it has been called :)
+ accmgr.onServerConnectHandler();
+
+ if ( !accmgr.isBTProServer() )
+ MyClient::SendChat((NetworkAction)(NETWORK_ACTION_CHAT + type), type, dest, buf, 0);
+ else {
+ while (isspace(*p))
+ p++;
+ if (!p || !*p );
+ else if (*p != '!')
+ MyClient::SendChat((NetworkAction)(NETWORK_ACTION_CHAT + type), type, dest, buf, 0);
+ else {
+ p++;
+ if ( strcasecmp(p, "login") )
+ MyClient::SendChat((NetworkAction)(NETWORK_ACTION_CHAT + type), type, dest, buf, 0);
+ else {
+ // hijack the !login command
+ accmgr.initiateLoginSequence();
+ }
+ }
+ }
} else {
NetworkServerSendChat((NetworkAction)(NETWORK_ACTION_CHAT + type), type, dest, buf, CLIENT_ID_SERVER);
}

////////////////////////////

Nevertheless if you want to make the client portable, you have more than wininet to fix. ShellAPI is used to open browser on forum URL, while OpenTTD already offers the portable:

void OSOpenBrowser(const char *url);

The function is not declared in any header file but you can locally declare it using an "extern" prior calling it...

extern void OSOpenBrowser(const char *url);

have fun && good luck

Blup

EDIT:

btw, if anybody compile it as is and it doesn't work, don't complain to me. I don't have any free time available for openttd atm... maybe in fall.

Please Log in or Create an account to join the conversation.

Last edit: by Blup. Reason: bletch

Re: BTPro Client Suggestions 11 years 3 months ago #1835

hello :)

Thanks Blup. Actually the version I had prepared it's quite similar and was tested on linux and mac OS's. Somehow (maybe lazyness) I've worked on the wininet based one :D
Anyway, good or bad, it worked and probably today I'll have the time to make it for 1.3.1.

take care :)
  • ST2
  • ST2's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1222
  • Thank you received: 628

Please Log in or Create an account to join the conversation.

Re: BTPro Client Suggestions 11 years 3 months ago #1844

new public version released, now compatible with all OS's (I think ^^)

available here , already compiled for Windows versions, diff file included to who what's to build it in other OS's.

It's a modified OpenTTD version so, any bugs please report them here.

good games all :)
  • ST2
  • ST2's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1222
  • Thank you received: 628

Please Log in or Create an account to join the conversation.

BTPro Client Suggestions 11 years 2 months ago #1957

In the new version brought out yesterday, I miss the exact town rating, which used to be next to the name of the town, so you could see how good or bad your company was doing in the town, which was more exact than those 7 or 8 different levels. I liked it, especially for the CB servers. Is there a reason why it is gone?
  • vGelder
  • vGelder's Avatar
  • Offline
  • BTPro RETIRED Moderator
  • BTPro RETIRED Moderator
  • Posts: 221
  • Thank you received: 55

Please Log in or Create an account to join the conversation.

BTPro Client Suggestions 11 years 2 months ago #1962

hi :)

yes, there was a particular reason why was removed... I'll explain:
- while trying to fix the tooltips bug I've disabled it... when fixed... forgot to put it there again :D

It's done and thanks for noticing :)
  • ST2
  • ST2's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1222
  • Thank you received: 628

Please Log in or Create an account to join the conversation.

BTPro Client Suggestions 11 years 1 month ago #2017

well, I was thinking on add the Show vehicles in tunnels patch on cliente but no idea how can be usefull...

what do you all think?

meanwhile... enjoy the games and have fun :)
  • ST2
  • ST2's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1222
  • Thank you received: 628

Please Log in or Create an account to join the conversation.

Time to create page: 0.087 seconds
Best hosting deal on hostgator coupon or play poker on party poker
Copyright 2020 BTPro Client Suggestions - Page 4 - BTPro - OpenTTD Community.