When i first time played lfs and clicked on show server list it showed me something about packets (i think big packets dialog) but it is not doing now so it is not problem.
Problem is that i can't connect to my favourite server (TC cruise server). Server always simply refuses my connection. So i installed B7 but i still can't connect and server doesn't want my connection. Other servers are ok.
Thank you. I think It works. Another problem is that there is delay. I don't know why (Is it because i stop console output when i press slider?). Do you know about some really simple form framework where I can output these variables ?
#define MYPORT 55321 // the port users will be connecting to
using namespace std;
typedef struct { unsigned int Time; // time in milliseconds (to check order)
char Car[4]; // Car name unsigned short Flags; // OG_FLAGS (see below) unsigned char Gear; // Reverse:0, Neutral:1, First:2... unsigned char PLID; // Unique ID of viewed player (0 = none) float Speed; // M/S float RPM; // RPM float Turbo; // BAR float EngTemp; // C float Fuel; // 0 to 1 float OilPressure; // BAR float OilTemp; // C unsigned DashLights; // Dash lights available (see DL_x below) unsigned ShowLights; // Dash lights currently switched on float Throttle; // 0 to 1 float Brake; // 0 to 1 float Clutch; // 0 to 1 char Display1[16]; // Usually Fuel char Display2[16]; // Usually Settings int ID; } __attribute__ ((packed)) OutGaugePacket;
int main(void) { int sockfd; // let's make a file descriptor OutGaugePacket og_packet; // let's create an packet struct sockaddr_in my_addr; // my address information struct sockaddr_in their_addr; // connector's address information int addr_len; int numbytes; WORD wVersionRequested = MAKEWORD(1,1); WSADATA data; memset(&(og_packet),'\0',96); // zero out the struct
cout << "a" << endl;
if (WSAStartup(wVersionRequested, &data) != 0) { perror("first"); exit(1); }
cout << "a" << endl;
//let's create the socket if ((sockfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) { perror("socket"); exit(1); }
cout << "a" << endl;
// setting up our contact information here my_addr.sin_family = AF_INET; my_addr.sin_port = htons(MYPORT); // short, network byte order my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP memset(&(my_addr.sin_zero), '\0', 8); // zero the rest of the struct
cout << "a" << endl;
//binding our socket to a port and address if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)) == -1) { perror("bind"); exit(1); } addr_len = sizeof(struct sockaddr);
for (;;){ // receiving the goodies if ((numbytes=recvfrom(sockfd, (char *)&og_packet, sizeof(OutGaugePacket) , 0, (struct sockaddr *)&their_addr, &addr_len)) == -1) { perror("recvfrom"); exit(1); }
Hello. I have problem with reading indicators bits. Other values are OK. I am total noob in C++ so i edited some codes from forum. Everything is ok but i still cant read informations from Spare3. std::cout << bits[X] << std::endl; is always 0
int main(void) { int sockfd; // let's make a file descriptor OutGaugePacket og_packet; // let's create an packet struct sockaddr_in my_addr; // my address information struct sockaddr_in their_addr; // connector's address information int addr_len; int numbytes; WORD wVersionRequested = MAKEWORD(1,1); WSADATA data; memset(&(og_packet),'\0',96); // zero out the struct
cout << "a" << endl;
if (WSAStartup(wVersionRequested, &data) != 0) { perror("first"); exit(1); }
cout << "a" << endl;
//let's create the socket if ((sockfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) { perror("socket"); exit(1); }
cout << "a" << endl;
// setting up our contact information here my_addr.sin_family = AF_INET; my_addr.sin_port = htons(MYPORT); // short, network byte order my_addr.sin_addr.s_addr = INADDR_ANY; // automatically fill with my IP memset(&(my_addr.sin_zero), '\0', 8); // zero the rest of the struct
cout << "a" << endl;
//binding our socket to a port and address if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)) == -1) { perror("bind"); exit(1); } addr_len = sizeof(struct sockaddr);
for (;;){ // receiving the goodies if ((numbytes=recvfrom(sockfd, (char *)&og_packet, sizeof(OutGaugePacket) , 0, (struct sockaddr *)&their_addr, &addr_len)) == -1) { perror("recvfrom"); exit(1); }
Hello. I am learning something about OutGauge but networking/chip programming is very difficult for me. Youtube is now full of homemade gauges and indicators. It can be very nice if someone create tutorial for beginners how to make working all gauges and all indicators. I don't mean only dll. I mean something like:
- Buy this: ATMega XY, Servo XY 3x, Resistor XY, LED XY...
- Scheme for it
- Working EXE for these components.
So player needs only define insim port in lfs and run program and calibrate servos for his instruments.
I will be really thankfull and other players too if someone write it. It's my LFS dream