The online racing simulator
Insim: Once And For All!
(52 posts, started )
Insim: Once And For All!
Right, I know a LOT of threads have been made regarding Insim requests, but I want to start Insim programming. I have all of the commands needed for insim, but I have no idea how to code it. Can I use notepad, or do I need a special compiler?

Also, if somebody has a small piece of insim code, could they please post it here, so that I can see how to word the syntax. Also, how is it compiled (If notepad is to be used)?

Much Thanks

*** Perhaps a special sub-forum could be made for those LEARNING Insim, to share knowledge and ideas? (Not insim requests) ***
Well, what coding knowledge do you have? And what language are you intending to use?

You can use notepad (or other, fancier text editors) with a sepearet compiler, or use an IDE (rather more convenient and recommended unless you like being hardcore).
Ok, lets start with the basics.

InSim itself is a protocol. A fixed method of talking to LFS. Think of it as a language. Like french.

Take a programming language of your choice - any will do, as long as it can do some networking and there is some way for you to "pack" strings. Think of this language as a person.

You need to teach this person how to talk french. How you do this would depend on the person. If this person natively spoke another language, like english, you'd teach them in the way they expect to be taught in an english school. Similiarly if they were spanish you'd use a spanish style of teaching.

What I'm trying to get at is that there's no correct way, in all cases, to create an InSim program. It depends on what you're using.

If you're using an interpreted language you can write the code, using whatever you want, and then run that code using the interpreter. For instance, you could write a PHP script, that understands how to talk to InSim, and then call it through the PHP command line interpreter.

If you were using a compiled language you'd write the code, using whatever you want, and then you'd need to compile that code so that you can run it.

InSim itself is not magic. All that InSim does, and can do, is inform a programmer how to get data out of LFS and how to put data back in.

Just to get slightly more complicated you can talk to InSim in 2 different ways - over TCP and UDP. TCP is "slower" but data from LFS is "guaranteed" to arrive whilst the connection is up, and will arrive at your program in a specific order. UDP is faster, but you will get no notification if LFS goes away, and the packets may arrive in any order.

Now, you must realise that giving an example is highly dependant on what language you are using to talk 'InSim'. However, in pseudocode it *might* go something like this:
Get data from user - address and port of client or server running InSim - usually localhost 29999
Make a connection to the given address and port
Send the ISI (InSim Initialisation) packet
Ask for the version to get sent (so that we can check that the thing we are connecting to is talking the same version of InSim)
Create a global buffer and a way of recording the buffer size (only necessary in some languages)
Start a receive loop - wait until we get data or until we are told to quit
Create a local temporary buffer
Copy any data in the global buffer into the local temporary buffer
We receive and append any data into the local temporary buffer
Clear global buffer
Create a local counter and set it to 0
Start a loop (we'll call this packet parsing loop), using the following logic: whilst local counter + next packet size <= local buffer size
Read the first byte of the rest of the buffer
Add this number to the local counter
Read and parse that number of bytes from the local buffer - this is a packet
Do whatever you want with the packet here - usually you'd want to send it to some bit of code to deal with it
Send any data you want back to LFS
Discard this packet from the buffer
When the packet parsing loop finishes, if any bytes remain copy them into the global buffer and size the global buffer size
When the receive loop ends clear the global buffer
Close the connection to LFS

If you want a firm example in a specific language, let us know and we'll do what we can. You may also be interested in knowing that some kind people have made whats known as a library to talk over InSim, to LFS, so that all you need to do is worry about making your program. These libraries take care of all that above, and you just need to worry about which packets you want and how to "subscribe" to them (make the library send them to a function/object/bit of code of your choice).

With regards to a specific subforum for learning InSim, in my opinion, there's not much point as there's rarely anything else that gets discussed here at present.

Edit: Damn you Bob - you win this time ^_^
Excellent post TAA, thats certainly helped me understand what i have to do whilst meddling with INSIM
Quote from the_angry_angel :Edit: Damn you Bob - you win this time ^_^

As my girlfriend will attest, it's better to be thorough than fast.
Meh. I've just realised I've not really covered transmitting and receiving packets (translating to and from french, if you want to continue the analogy). The problem is that how you do that is *highly* dependant on what language you use.

I chose french, incidentally, because it has an outrageous accent! You will often feel like blowing your nose at InSim.

Quote from Bob Smith :As my girlfriend will attest, it's better to be thorough than fast.

Hehe, oh the possibilities!
Dont introduce her to the angel then
Quote from the_angry_angel :I chose french, incidentally, because it has an outrageous accent! You will often feel like blowing your nose at InSim.

Continuing the off-topic for a moment, it seems weird that you have applied to work as a techy in France for a games company, while our techy is from France (with suitably outrageous accent). Funny old world, ain't it?
Wow that was an excellent post, exactly what I was looking for! I was always under the presumption that Insim was a language on its own...

I currently program in yabasic and c++ (better at yabaisc though), but I've been told that yabasic can't handle networking. So, in c++, would I send a packet to LFS which contains the Insim command I want (can't think of any offhand), and then use c++ to make a desicion based upon what LFS sends back?

I never used c++ for networking before, so I may seem slow at it...
Assuming you're just writing for Windows, there are a few options you can go down for writing an InSim application based around C++. You can go down the route of using the WSA* functions, which provide a higher level abstraction to using sockets, you can use whats known as the 'berkeley socket functions' which are designed to be compatible with the berkeley socket api (which was introduced in non-Windows OS' a long time ago and then later brought into Windows when networking first appeared to help port programs across), or you could use someone else's socket abstraction.

Unfortunately there aren't any publically available InSim libraries out there for C++, that I'm aware of. lib_insim, which I created for use in luaLFS and a few other projects I've not released is probably closer than anything else, however it is written in C and might be a tad tricky to understand. It's also not 100% complete. (Un)Fortunately I, currently, steer well clear of C++ so anything I produce might not compile for whatever small reason.

A very simple, inline insim client, for Windows using the berkeley functions, might look something like the following.

Warning: This is completely untested, uncompiled (at least in this form). I cannot be held accountable for any and all damage that may or may not occur through any cock up of mine or your own in relation to this code.

#include <windows.h>
#include <time.h>
#include <stdio.h>

// insim.h is the actual InSim.txt file renamed - it's actually a C++ header file
#include "insim.hpp"

#define IS_ADDR "localhost"
#define IS_PORT 29999
#define IS_ADMIN "AdminPwd"
#define IS_TIMEOUT 5
#define PRODUCT_FULL "This app"
#define PACKET_BUFFER_SIZE 512

struct buffer_t
{
// Packet buffer - 512 should be more than enough
char buffer[PACKET_BUFFER_SIZE];
// Number of bytes currently in buffer
unsigned int bytes;
};


int main (int argc, char *argv[])
{
// Our global buffer
struct buffer_t gbuf;
// We need to zero it out
memset(gbuf.buffer, 0, PACKET_BUFFER_SIZE);
gbuf.bytes = 0;

// Our socket fd
SOCKET s;
struct sockaddr_in saddr;

// Initialise WinSock
WSADATA wsadata;

if (WSAStartup(0x202, &wsadata) == SOCKET_ERROR)
{
WSACleanup();
return WSAGetLastError();
}

// Create the socket - this defines the type of socket - in this instance a TCP one
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
// Could we get the socket handle? If not the OS might be too busy or have run out of available socket descriptors
if (s == INVALID_SOCKET)
return -1;

// Clear the socket address structure for later
memset(&saddr, 0, sizeof(saddr));
// Set the type of socket we're using
saddr.sin_family = AF_INET;

// We find the address to connect to the InSim client
struct hostent *hp;
// We first try to use DNS (i.e. localhost would resolve to 127.0.0.1)
hp = gethostbyname(IS_ADDR);

// We managed to resolve it, lets put the binary representation into the socket address structure
// If not, we assume that someone put in an IP - lets convert that
if (hp != NULL)
saddr.sin_addr.s_addr = *((unsigned long*)hp->h_addr);
else
saddr.sin_addr.s_addr = inet_addr(IS_ADDR);

// Set the port number in the socket structure - we convert it from host byte order, to network
// We do this for compatibility reasons
// Ideally, we should do this for all numbers that get transmitted over the network
// However, in the instance of LFS, this isn't really applicable as LFS only runs natively on
// little endian processors
// Sorry if this is a little technical, but it's worth pointing out
saddr.sin_port = htons(IS_PORT);

// Now the socket address structure is full, lets try to connect
if (connect(s, (struct sockaddr *) &saddr, sizeof(saddr)) < 0)
{
fprintf(stderr, "Connection to '%s' failed\n", IS_ADDR);
return -1;
}

// Ok, so we're connected. First we need to let LFS know we're here by sending the
// ISI packet
struct IS_ISI isi_p;
memset(&isi_p, 0, sizeof(struct IS_ISI));
isi_p.size = sizeof(struct IS_ISI);
isi_p.type = 1;
isi_p.udpport = 0;
isi_p.flags = 0;
isi_p.interval = 0;
memcpy(isi_p.iname, PRODUCT_FULL, strlen(PRODUCT_FULL));
memcpy(isi_p.admin, IS_ADMIN, 16);

if (send(s, (const char *)&isi_p, sizeof(struct IS_ISI), 0) < 0)
return -1;

// And now the version packet
struct IS_TINY is_v;
memset(&is_v, 0, sizeof(struct IS_TINY));
is_v.size = sizeof(struct IS_TINY);
is_v.type = ISP_TINY;
is_v.subT = TINY_VER;
is_v.reqI = 1;
if (send(s, (const char *)&is_v, sizeof(struct IS_TINY), 0) < 0)
return -1;

// Now this is where it gets complex - We need to do a lot of shifting twiddling that might be
// a little complicated to follow
int ok = 1;
while (ok > 0)
{
int rc;
// Set the timeout period
struct timeval select_timeout = IS_TIMEOUT;

// Setup the file descriptor watches
fd_set readfd, exceptfd;

// Clear them
FD_ZERO(&readfd);
FD_ZERO(&exceptfd);

// Set them to watch our socket for data to read and exceptions that maybe thrown
FD_SET(s, &readfd);
FD_SET(s, &exceptfd);

// Select will watch the sockets specificed in each FD_SET, and trigger after a timeout
rc = select(s + 1, &readfd, NULL, &exceptfd, &select_timeout);

// Fire any prerecv stuff here that you want wish to do

// Select output handling
if (rc < 0)
{
// An error occured
ok = -1;
}
else if (rc > 0)
{
// We got data or an exception

if (FD_ISSET(s, &readfd))
{
// We got data!

// make local temp buffer
char tbuf[PACKET_BUFFER_SIZE];
memset(&tbuf, 0, PACKET_BUFFER_SIZE);
// bytes read
unsigned int bread = 0;

// copy any half packet into the local buffer
if (gbuf.bytes > 0)
{
bread = gbuf.bytes;
memcpy(tbuf, gbuf.buffer, gbuf.bytes);
//gbuf.bytes = 0;
// clear left overs
memset(gbuf.buffer, 0, PACKET_BUFFER_SIZE);
}

// recv waiting bytes
int retval = recv(s + 1, tbuf + bread, PACKET_BUFFER_SIZE - (unsigned int)bread, 0);
// deal with recv
if (retval == 0)
{
// Connection has been closed at the other end
return -1;
}
else if (retval > 0)
{
// This is where it will get very tricky to follow, if you don't understand pointers

// The packetisation process is:
// read size of packet
// check to see if buffer doesnt exceed the limits, and has a packet size. loop until not satisfied
// read packet into lua
// increase number of bytes read
// check remaining sizes and
// copy remaining into global buffer and set number of bytes

char *p = tbuf;
bread = 0;
// packet size
unsigned char psize;

unsigned int tbytes = gbuf.bytes + retval;
gbuf.bytes = 0;

while ((PACKET_BUFFER_SIZE >= (tbytes - bread - (unsigned char)*p)) && ((tbytes - bread - (unsigned char)*p) >= 0) && ((unsigned char)*p > 0))
{
psize = (unsigned char)*p;

// Shouldn't be possible
if (psize == 0)
return -1;

// Deal with your packets here
unsigned int packet_id = *((char *)p+1);

if (packet_id == ISP_TINY)
{
// It's an ISP_TINY!
struct IS_TINY *t = data;
if ((t->reqI == 0) && (t->subT == TINY_NONE))
{
// It's a keepalive packet! We need to respond
printf("Ping? ");
struct IS_TINY keepalive_response;
memset(&keepalive_response, 0, sizeof(struct IS_TINY));
keepalive_response.size = sizeof(struct IS_TINY);
keepalive_response.type = ISP_TINY;

// Send it back
if (send(s, (const char *)&keepalive_response, sizeof(struct IS_TINY), 0) < 0)
ok = -1;

printf("Pong!\n");
}
}

// Increment the pointer and the number of bytes we've read
p += psize;
bread += psize;
}

// How many bytes have we left?
int tout = (unsigned char)(tbytes - bread);
// Oh dear, there's been a cock up - This SHOULD NOT be possible unless the TCP stream got
// screwed about
if (tout < 0)
ok = -1;

// This should not be possible either
if (tout > PACKET_BUFFER_SIZE)
ok = -1;

// Set the number of bytes in the global buffer
gbuf.bytes = (unsigned char)(tout);
// Copy the bytes from the local buffer into the global one
// Note: We do not zero it first for a slight speed increase on very busy
// servers and because we know how many true bytes we should have because we set it previously
memcpy(gbuf.buffer, tbuf+bread, gbuf.bytes);
}
}
else if (FD_ISSET(s, &exceptfd))
{
// An exception occured - we want to quit
ok = -1;
}
}
}


// We've been disconnected - in this example we don't know if this was because of a network
// error, or because we quit, but lets send the InSim close anyway
struct IS_TINY is_close;
memset(&p, 0, sizeof(struct IS_TINY));
is_close.size = sizeof(struct IS_TINY);
is_close.type = ISP_TINY;
is_close.reqI = 0;
is_close.subT = 2;
if (send(s, (const char *)&is_close, sizeof(struct IS_TINY), 0) < 0)
return -1;

// Clean up
closesocket(s);
WSACleanup();

return 0;
}

Now be aware that:
1. I have not tested this specific source - it is mostly a rip out of lib_insim and into inline code - it should work, but there may be things that I've missed. I apologise if I did, but I've been up for a very long time today

2. I've not angled it towards C++ specifically. You'd really want to turn this lot into objects and so on

3. Theres nothing in there about checking the version of InSim

4. Theres nothing in there about checking to see if we get any response from LFS at all

5. You need to include InSim.txt (by renaming it to insim.hpp) - other fiddling might be required

6. Things like the address, port number, etc. are hard coded - really they should be user input-able

7. There is no GUI

In simple terms it is about as basic as you can get - in C-ish (ignoring the fact that the stock insim header will not compile under a strict C compiler, but thats another, long, story) - that will "work" (see the above notes).

If you want to see something more sensible around this code you might want to look at the "recent" release to luaLFS (source is included, but not as well commented).

Now you might find this overwhelming, especially if you're more familiar with the MFC or something similar, in which case I apologise as it is a little heavy. However, if you choose to use something low level like C, C++, etc. you will have to deal with things like pointers. On the other hand you have to do practically no work to actually construct the packets, as you're talking the same native language as LFS (french! No.. Wait... Why did I pick french. Bugger. Maybe I've taken this analogy too far. Time to ditch it I'm afraid.).

Edit: I will point out that I was working on something called "modInSim" at one point a few months ago. This is basically like luaLFS; a dumb client that just sits there doing nothing but connecting and responding to keepalive packets. The client would beable to load multiple modules, dll/so files, which would beable to talk to LFS by sending packets, subscribing to the data received from LFS. If anyone is interested I may restart this project as you may find it interesting to use - if you're using C, or some other lower level language. It would also be possible to quite easily inject third party languages, much like I did with luaLFS, into modInSim using the current model. The only problem was configuration syntax and allowing modules to read the config data.
Very interesting and useful posts
#12 - SamH
I'd love an insim learning centre subforum. It's a massive leap from beginning programming to talking to an LFS server via InSim. It's a bit like developing your own film.. the first thing you have to do is handle the film in absolute darkness to get it on the developing reel, all completely by feel alone, with no visual clues. You're a long way down the road, at the enlarger, when you find out you screwed it up at the beginning of the process. It's quite out-facing in the same way when you begin application programming.
I know its not directly related to insim, but can different languages communicate with each other? I really prefer yabasic (much shorter code and easier to complete without errors), but it doesnt have network capabilities (so I'm told anyway). Could yabaisc communicate with c++?

That is: C++ sends the initial packet to LFS.
C++ receives the packet back.
C++ sends this information to a yabasic program
Yabasic makes a decision on this information
Yabasic sends its decision to C++
C++ sends this information to LFS (through insim)

Basically, (using your analogy ), LFS speaks french only. Yabasic speaks english only. C++ speaks both fluently. So, LFS speaks french to C++, which then translates for yabasic. and visa versa.

Can these two languages speak together?
Quote from dougie-lampkin :Can these two languages speak together?

Had a quick look at what Yabasic is and... no, I don't see a way to let it communicate with a C++ program/code in any way that isn't retarded, slow and more complicated than doing the whole thing in C++ right away.

If you're not a Microsoft hater and find C++ too cumbersome, you might want to have a look at the .NET Framework and its most popular languages C# and VB.NET. Not only are there already InSim libraries, but they're also languages that you seem to be somewhat familiar with AND they're both much easier to use than C++ as well as much more powerful than Yabasic.
Oh, well I guess I'll have to start at VB then...is it like yabasic? I really like yabasic because the code is almost like speech, whereas C++ requires lots of punctuation and minor details...I downloaded insim VB code, but I haven't a clue how to utilise it! It's called insim_base_vb8 if thats any clue to anyone...maybe someone knows exactly what it does? Thanks for all help, much appreciated!
Hello,

I made that base. But that version is obsolete and wont work with current version of insim. So you can't use that version anymore. there is a link to the updated C# version in my sig.
Quote from T-RonX :Hello,

I made that base. But that version is obsolete and wont work with current version of insim. So you can't use that version anymore. there is a link to the updated C# version in my sig.

OK, I got it, but I think I'm missing files...
I can't find the readme file mentioned, and I don't have any file that VB can open...(The .sln has an error)
Errr... this is VB.NET, not the old visual basic. The syntax is very similar, but you 1) need to have the .NET Framework installed, and 2) should preferably use Visual Studio to do the coding.
Quote from dougie-lampkin :OK, I got it, but I think I'm missing files...
I can't find the readme file mentioned, and I don't have any file that VB can open...(The .sln has an error)

It holds all files required.

You need Visual C# Express Edition to open it up.
Its free, get it here
Quote from T-RonX :It holds all files required.

You need Visual C# Express Edition to open it up.
Its free, get it here

Ya thanks, I was using Visual Basic lol. But I got C# now, so I'll have to wait for that to install first
Would anyone have very simple insim code for C++? I'd like to use that before moving on to C#.

Any sort of code would be nice, just to see how exactly to open/close sockets and how packets are sent and received. Preferably, could it have comments in the code explaining the different functions?

Much thanks,
Rob
Err.. what about the_angry_angel's excellent post above? Combine his code with some classes and you'll be good to go. (I will be eventually) Here is a basic tutorial on classes (and a bunch more) to get started.. http://cplusplus.com/doc/tutorial/classes.html
ya, I forgot to post about that lol. I get lots of errors when I try and compile that code (Bloodshed Dev-C++ 4.9.8.0).

Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\isnsim2.cpp" -o "C:\Dev-Cpp\isnsim2.exe" -fexceptions -g3 -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
In file included from C:/Dev-Cpp/isnsim2.cpp:6:
C:/Dev-Cpp/include/insim.hpp:75: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:76: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:80: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:262: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:327: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:390: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:676: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:677: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:678: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:679: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:680: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:681: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:738: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:797: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:798: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:829: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:830: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:934: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:935: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:953: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:954: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:977: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:978: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:982: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1207: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1243: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1244: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1263: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1264: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1272: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1273: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1274: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1384: 'Vec' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1386: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1387: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1388: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1395: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1396: 'word' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1678: 'Vector' is used as a type, but is not
defined as a type.
C:/Dev-Cpp/include/insim.hpp:1682: 'Vector' is used as a type, but is not
defined as a type.
C:/Dev-Cpp/include/insim.hpp:1683: 'Vector' is used as a type, but is not
defined as a type.
C:/Dev-Cpp/include/insim.hpp:1684: 'Vec' is used as a type, but is not defined
as a type.
C:/Dev-Cpp/include/insim.hpp:1718: 'word' is used as a type, but is not defined
as a type.
In file included from C:/Dev-Cpp/isnsim2.cpp:6:
C:/Dev-Cpp/include/insim.hpp:1757:7: warning: no newline at end of file
C:/Dev-Cpp/isnsim2.cpp: In function `int main(int, char**)':
C:/Dev-Cpp/isnsim2.cpp:87: `struct IS_ISI' has no member named `size'
C:/Dev-Cpp/isnsim2.cpp:88: `struct IS_ISI' has no member named `type'
C:/Dev-Cpp/isnsim2.cpp:89: `struct IS_ISI' has no member named `udpport'
C:/Dev-Cpp/isnsim2.cpp:90: `struct IS_ISI' has no member named `flags'
C:/Dev-Cpp/isnsim2.cpp:91: `struct IS_ISI' has no member named `interval'
C:/Dev-Cpp/isnsim2.cpp:92: `struct IS_ISI' has no member named `iname'
C:/Dev-Cpp/isnsim2.cpp:93: `struct IS_ISI' has no member named `admin'
C:/Dev-Cpp/isnsim2.cpp:101: `struct IS_TINY' has no member named `size'
C:/Dev-Cpp/isnsim2.cpp:102: `struct IS_TINY' has no member named `type'
C:/Dev-Cpp/isnsim2.cpp:103: `struct IS_TINY' has no member named `subT'
C:/Dev-Cpp/isnsim2.cpp:104: `struct IS_TINY' has no member named `reqI'
C:/Dev-Cpp/isnsim2.cpp:115: conversion from `int' to non-scalar type `timeval'
requested
C:/Dev-Cpp/isnsim2.cpp:205: `data' undeclared (first use this function)
C:/Dev-Cpp/isnsim2.cpp:205: (Each undeclared identifier is reported only once
for each function it appears in.)
C:/Dev-Cpp/isnsim2.cpp:206: `struct IS_TINY' has no member named `reqI'
C:/Dev-Cpp/isnsim2.cpp:206: `struct IS_TINY' has no member named `subT'
C:/Dev-Cpp/isnsim2.cpp:212: `struct IS_TINY' has no member named `size'
C:/Dev-Cpp/isnsim2.cpp:213: `struct IS_TINY' has no member named `type'
C:/Dev-Cpp/isnsim2.cpp:259: `p' undeclared (first use this function)
C:/Dev-Cpp/isnsim2.cpp:260: `struct IS_TINY' has no member named `size'
C:/Dev-Cpp/isnsim2.cpp:261: `struct IS_TINY' has no member named `type'
C:/Dev-Cpp/isnsim2.cpp:262: `struct IS_TINY' has no member named `reqI'
C:/Dev-Cpp/isnsim2.cpp:263: `struct IS_TINY' has no member named `subT'
Execution terminated

I'm not sure how to go about fixing them...
Quote from dougie-lampkin :C:/Dev-Cpp/include/insim.hpp:75: 'word' is used as a type, but is not defined

The word data type isn;t defined by default. it's usually defined as an unsigned long.

Quote from dougie-lampkin :C:/Dev-Cpp/isnsim2.cpp:87: `struct IS_ISI' has no member named `size'

C++ is case sensitive. In luaLFS I renamed the contents of insim.h file to use lower case.

I'm sorry to be rude, which is probably a result to the copious amounts of alchoolic drinks I've consumed at the pub, but for a guy who claimed to know "C++ pretty well", or words to that effect in another thread, you don't seem to actually know C++ that well at all.

I have no problem helping out in the least, until the person in question starts spouting utter bullshit. Quite frankly I think that's just ****ing rude.

As I stated in my post - I did not test that code, and it is not complete. It should be enough to guide anyone familiar with the given language in the least, however.

Edit: Rather than attract more attention to this, I'm responding to dougie-lampkin's post below (18th November 2007 10:08) here
Quote from dougie-lampkin :Like I said, I have no experience whatsoever in C++ networking. Therefore, I didn't know what exactly had caused the error. I also didn't realise that insim.txt had a different case.

These errors have nothing to do with networking programming in the least. These are general compile time errors which anyone who has touched C++ for more than 10 minutes, and can make "functional programs" (assuming we're talking more complicated than helloworld), should be aware of it.

I apologise if I'm coming across as a dick, but I'm getting fed up with a certain demographic claiming things and then wanting to be spoon fed. This is not a character attack against yourself dougie, please do not take it as such. It's just rather unfortunate you've taken the brunt of my strop.
Quote from the_angry_angel :The word data type isn;t defined by default. it's usually defined as an unsigned long.

C++ is case sensitive. In luaLFS I renamed the contents of insim.h file to use lower case.

I'm sorry to be rude, which is probably a result to the copious amounts of alchoolic drinks I've consumed at the pub, but for a guy who claimed to know "C++ pretty well", or words to that effect in another thread, you don't seem to actually know C++ that well at all.

I have no problem helping out in the least, until the person in question starts spouting utter bullshit. Quite frankly I think that's just ****ing rude.

As I stated in my post - I did not test that code, and it is not complete. It should be enough to guide anyone familiar with the given language in the least, however.

Like I said, I have no experience whatsoever in C++ networking. Therefore, I didn't know what exactly had caused the error. I also didn't realise that insim.txt had a different case.

When I said I'm pretty good, I was taking into account the fact that I'm 15. I can make useful, functional programs, but I've never tried anything this big, so excuse me if I wasn't sure on what the problem was.

Insim: Once And For All!
(52 posts, started )
FGED GREDG RDFGDR GSFDG