Now, i know that you are probably wondering why i am asking about C on a java game forum, but C is the base of Java.
So does anyone know where i can get info, or the header file for making Sockets in C?
Now, i know that you are probably wondering why i am asking about C on a java game forum, but C is the base of Java.
So does anyone know where i can get info, or the header file for making Sockets in C?
If you’re using GCC, type ‘man Socket’ and it will tell you all about it. If you’re using Visual C++ (how lame) there should be online help for WinSock. (It’s almost the same). A quick google on “WinSock API” will get you tons of links like this:
http://burks.brighton.ac.uk/burks/pcinfo/progdocs/winsock/winsock.htm
Dont worry im not using Visual C++. Im not crazy enough to revert to microsoft products.
oh, and thanks for the link.
and where do i type “man Socket”? in google? il try that btw… so u dont need to answer if thats the answer
At the Bash prompt of course! Time to dust off those Unix skillz and use manual pages! (thus “man”) Under Windows you have the choice of compiling Win32 apps (generally using VC++ and Winsock) or you can get a real development environment and use all your favorite Unix tools!
Under just about every other OS, you already have a bash or sh prompt, so you can type it in there.
Just out of curiousity, what’s wrong with Java networking anyway?
[quote]Just out of curiousity, what’s wrong with Java networking anyway?
[/quote]
Nothing of course, but actually I thought about doing some networking code in C myself.
Not because it’s better, but because it’s a little more difficult to decompile and hack than a java class. Which I thought might help a little making for example a high score server ‘cheater-unfriendly’.
But, I also found that this is just complicating development and it hardly helps anything as there are ways to complicate hacking in java too that work just as well. Probably better even.
But maybe this was not at all what javatypo had in mind :
[quote] Not because it’s better, but because it’s a little more difficult to decompile and hack than a java class.
[/quote]
NEVER rely on Security through obscurity - It just won’t work ™
just to barging in ;D
I don’t.
But it might help a bit in demotivating cheaters
had any problems with cheaters then?
No. That’s why I didn’t really prevent myself against them yet.
But it doesn’t hurt to think about it in advance, just in case.
[quote]I don’t.
But it might help a bit in demotivating cheaters
[/quote]
hmm… i’m not sure if that would help at all. most ppl wont decompile it. the more usual (generic) approach is sniffing, reverse the data structure and sending an own build packet to the server.
as long as u dont use encryption it’s way too easy :>
and demotivating doesnt really work this way - if its harder it’s just a bit more fun
www.try2hack.nl <- try it. it’s fun =)
theres nothing wrong with java networking…
i just cant find out how to tell whether or not the user is connected to the internet.
If anyone could tell me that, it would be super awesome… aswell as the resources to C stuff.
Do you know how to ping?
You must know the users IP address and then “ping” that address. If test packets are not returned, user is behind firewall/ or unavailable.
I’ve seen this at least in couple of books.
perhaps he wants the client himself to find out if he’s connected or not?
off top of my head, try to create a socket and catch the exception that is thrown when the connection fails?
yeah i want the application on the users computer to beable to detect if the user is online, and then when he goes online to perform the work that must be done online.
did you try what i suggested? that is, try to create a socket and try to do so until it succeds. the best thing would be to catch something like InternetConnectionEvent when a connection is established but i think you are stuck to polling.
ill give it a shot