• What do you need help with? Version 1
    5,001 replies, posted
[QUOTE=r4nk_;26286280]What is a 0x0[/QUOTE] square it and see
[QUOTE=LinuX;26286335]The program '[6792] DirectX.exe: Native' has exited with code 0 (0x0).[/QUOTE] Exit code 0 means no error..?
I got it, never mind.
#define TEXT( str ) str; exit(0)
#define TEXT( str ) (exit(0), str) Is more reliable, since it will also work as a function-argument then.
[del]turb[/del] Siemens is talking about it not being accessible from non-kernel software. Software running on top of a kernel resides in 'userland', see [url=http://en.wikipedia.org/wiki/User_space]the undisputed, trustworthy Wikipedia[/url]. No, GetPixel returns a copy of the color and SetPixel .. well, you don't read with setter-methods. [editline]25th November 2010[/editline] If you just want the whole screen as bitmap data, then I think you can use [url=http://msdn.microsoft.com/en-us/library/dd144879(VS.85).aspx]GetDIBits[/url], though again, this is just a copy of the data.
Could anyone help me out with some Half-Life 2 coding? I'm trying to make a custom model entity disappear (for example) when the player 'uses' it, but I can't for the life of me find any source coding resource sites that aren't dead, and I can't find anything on the dev wiki...
I'm working on a Minecraft server and I need to be able to disconnect clients. I am able to do this with: [cpp]Socket.Disconnect( true ); Socket.Close();[/cpp] I verified that the connection is closed by trying to send something. However, the Minecraft client on the website does not seem to respond to this at all. It only shows the dark-red disconnect screen when I completely terminate the application. What am I missing?
I have an animation with 2 frames in a sprite sheet. And the character moves by multiplying the amount to move by App.getFrameTime() apparently this ensures that no matter what frame rate the computer is rendering at, it moves at the same speed on all computers. On XNA i would do something like get the time opened and every 200ms change the frame or something but i dont know how i could calculate that using App.getFrameTime()? Is it possible or would i have to use a clock? C++ and SFML.
[QUOTE=Overv;26292231]I'm working on a Minecraft server and I need to be able to disconnect clients. I am able to do this with: [cpp]Socket.Disconnect( true ); Socket.Close();[/cpp] I verified that the connection is closed by trying to send something. However, the Minecraft client on the website does not seem to respond to this at all. It only shows the dark-red disconnect screen when I completely terminate the application. What am I missing?[/QUOTE] Send them "\xFF\x00\x07See ya!".
[QUOTE=q3k;26292489]Send them "\xFF\x00\x07See ya!".[/QUOTE] That doesn't help when I'm disconnecting a client for using the wrong protocol.
[QUOTE=Overv;26292648]That doesn't help when I'm disconnecting a client for using the wrong protocol.[/QUOTE] The client can't tell if the socket was closed or if the connection just lags. Usually clients are implemented so that after a certain time (e.g. 10 seconds) they'll just presume that the server closed the socket for some reason or crashed or something. For the client to know that the server is closing the socket, the server needs to tell the client so. Of course, a protocol must be established in which is written how the server does that. If the client uses a different protocol, then the server cannot do anything, except maybe sending a bunch of bytes, which could be the right notice. If however you mean just an older protocol, then you could store the appropriate bytes for the older protocol versions to be send. For a newer one you could just try sending the bytes that would be appropriate for the same version and hope, and for a completely different protocol there's nothing you can do.
Alright, but how come it can detect that the application terminated?
[QUOTE=Overv;26293234]Alright, but how come it can detect that the application terminated?[/QUOTE] Maybe it looks whether the port for the protocol is still open or summin'.
[QUOTE=ZeekyHBomb;26292947]The client can't tell if the socket was closed or if the connection just lags.[/QUOTE] Actually, recv returns 0 (or was it -1) if the socket is closed. IIRC.
[QUOTE=esalaka;26295176]Actually, recv returns 0 (or was it -1) if the socket is closed. IIRC.[/QUOTE] Is this TCP or UDP?
[QUOTE=arienh4;26295200]Is this TCP or UDP?[/QUOTE] TCP. [del]And probably connected UDP sockets, too.[/del] Not UDP.
I have been told by a lot of people that structs are better than declaring global variables, I know they are neater but is there any performance increase or any other advantage to using them rather than code neatness?
No. Except maybe that the fields in a struct are guaranteed to be continuous, so if you're accessing them in such a way the code might be able to cache them better. Just speculating though. I don't quite understand why you'd compare them though. They're totally different concepts. A global variable can even be of a struct-type. A struct cannot replace the functionality of globals. Though I guess globals could be used to replace the functionality of structs with some ugly, unnecessary hackery.
[QUOTE=esalaka;26295397]TCP. And probably connected UDP sockets, too.[/QUOTE] UDP is a connectionless protocol so there's no sockets involved. TCP is like a telephone call, whereas UDP is an SMS
[QUOTE=Siemens;26303415]UDP is a connectionless protocol so there's no sockets involved. TCP is like a telephone call, whereas UDP is an SMS[/QUOTE] You can still connect UDP sockets and send stuff over them with recv and send, [url=http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#sendrecv]at least in C[/url]. :eng101: [quote][send() and recv()] are for communicating over stream sockets or [B]connected datagram sockets[/B]. If you want to use regular unconnected datagram sockets, you'll need to see the section on sendto() and recvfrom(), below.[/quote] Emphasis added.
[QUOTE=esalaka;26304831]You can still connect UDP sockets and send stuff over them with recv and send, [url=http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#sendrecv]at least in C[/url]. :eng101: Emphasis added.[/QUOTE] The difference is that with TCP, you know when the socket is closed, like you said.
[QUOTE=esalaka;26304831]You can still connect UDP sockets and send stuff over them with recv and send, [url=http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#sendrecv]at least in C[/url]. :eng101:[/QUOTE] You can't make a UDP connection unless you're emulating a connection by handshaking and what not. In which case, you'd be better off using TCP anyway
[QUOTE=esalaka;26304831]You can still connect UDP sockets and send stuff over them with recv and send, [url=http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#sendrecv]at least in C[/url]. :eng101: Emphasis added.[/QUOTE] Connected UDP sockets are part of the BSD socket model. They're not actually connected beyond the socket storing the remote address so you don't have to specify it every time you send and receive.
Thanks for the corrections, I fixed my post.
[QUOTE=Siemens;26303415]UDP is a connectionless protocol so there's no sockets involved. TCP is like a telephone call, whereas UDP is an SMS[/QUOTE] I'd rather say: TCP is like a signed delivery, UDP is like the postman
[QUOTE=Richy19;26310737]I'd rather say: TCP is like a signed delivery, UDP is like the postman[/QUOTE] That's a strange analogy... The signed delivery isn't, but that would make UDP some kind of ongoing mail service, without any checking...
[QUOTE=arienh4;26314192]That's a strange analogy... The signed delivery isn't, but that would make UDP some kind of ongoing mail service, without any checking...[/QUOTE] Thats what UDP is, the server sends it and if the client gets it then good if not then it doesnt matter, thats why its only mainly used for streaming and gaming and stuff
[QUOTE=Richy19;26316421]Thats what UDP is, the server sends it and if the client gets it then good if not then it doesnt matter, thats why its only mainly used for streaming and gaming and stuff[/QUOTE] That's now how a postman works though. It doesn't deliver broken packages in general, not without checking/fixing/wrapping it.
[QUOTE=arienh4;26317783]That's now how a postman works though. It doesn't deliver broken packages in general, not without checking/fixing/wrapping it.[/QUOTE] Hmm true, ok then its like throwing loads of leaflets into the wind, some will reach the people, some will go in the trash
Sorry, you need to Log In to post a reply to this thread.