Jump to content
  • Advertisement

FMDGames

Member
  • Content Count

    109
  • Joined

  • Last visited

Community Reputation

134 Neutral

About FMDGames

  • Rank
    Member
  1. FMDGames

    SetWindowsHookEx

    The story goes i'm actually trying to prevent a speedhack from working at all. I am still learning how Windows Hooks work. The game i'm trying to protect bases its gamespeed on the timeGetTime command. The speedhack program i'm trying to protect against is SpeederXP, but there is other programs which work in a similar way.
  2. FMDGames

    SetWindowsHookEx

    Basically, i need to do 1 of 2 things. [1] Detect if there is additions to the Chain for the timeGetTime function. [2] Force my function to become the default once after calling SetWindowsHookEx. I really appreciate any help on this.
  3. I'm using SetWindowsHookEx to replace the timerGetTimer function, however, I have found that if there is a hook already in place, my hook doesn't get priority over the other one. I want to ensure that my hook always gets top priority. Suggestions? (The other hook is not injected by me). Thanks
  4. FMDGames

    Linux Server Keeps Freezing

    It appears the server is still suffering from the problem. I'm now using a fd_set for writing, checking if its set for a particular socket, and sending any waiting data if the socket is ready. What Now? (The problem appears to be linked to a 56k Modem user)
  5. FMDGames

    Linux Server Keeps Freezing

    I've updated the server code and pushed it into released status and now its running. No problems soo far, looking good. Thanks for your help. Will post back if theirs any problems! =)
  6. I have a custom built Linux Server which utilizes lua for scripting. I have seen issues where the server will freeze for up to 5 minutes, then all the pending messages are processed. I have no idea what the problem is. For the connections, im using the SELECT function so i can multiplex between the users which is based on the beej guide. The server still accepts connections (as in you can connect, but you get no data and the server sends no data to you). Using top, the server shows no evidence of CPU hogging, and other programs appear to operate fine. I can't see the lua functions that I've written to cause the problem as they work all the time there isn't pauses. Is it a requirement i need to empty the lua stack myself? The server dist is Fedora Core. Any ideas what could be causing this? Regards. ----------------------------------------------- /* ** selectserver.c -- a cheezy multiperson chat server */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #define PORT 9034 // port we're listening on int main(void) { fd_set master; // master file descriptor list fd_set read_fds; // temp file descriptor list for select() struct sockaddr_in myaddr; // server address struct sockaddr_in remoteaddr; // client address int fdmax; // maximum file descriptor number int listener; // listening socket descriptor int newfd; // newly accept()ed socket descriptor char buf[256]; // buffer for client data int nbytes; int yes=1; // for setsockopt() SO_REUSEADDR, below socklen_t addrlen; int i, j; FD_ZERO(&master); // clear the master and temp sets FD_ZERO(&read_fds); // get the listener if ((listener = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1); } // lose the pesky "address already in use" error message if (setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) { perror("setsockopt"); exit(1); } // bind myaddr.sin_family = AF_INET; myaddr.sin_addr.s_addr = INADDR_ANY; myaddr.sin_port = htons(PORT); memset(&(myaddr.sin_zero), '\0', 8); if (bind(listener, (struct sockaddr *)&myaddr, sizeof(myaddr)) == -1) { perror("bind"); exit(1); } // listen if (listen(listener, 10) == -1) { perror("listen"); exit(1); } // add the listener to the master set FD_SET(listener, &master); // keep track of the biggest file descriptor fdmax = listener; // so far, it's this one // main loop for(;;) { read_fds = master; // copy it if (select(fdmax+1, &read_fds, NULL, NULL, NULL) == -1) { perror("select"); exit(1); } // run through the existing connections looking for data to read for(i = 0; i <= fdmax; i++) { if (FD_ISSET(i, &read_fds)) { // we got one!! if (i == listener) { // handle new connections addrlen = sizeof(remoteaddr); if ((newfd = accept(listener, (struct sockaddr *)&remoteaddr, &addrlen)) == -1) { perror("accept"); } else { FD_SET(newfd, &master); // add to master set if (newfd > fdmax) { // keep track of the maximum fdmax = newfd; } printf("selectserver: new connection from %s on " "socket %d\n", inet_ntoa(remoteaddr.sin_addr), newfd); } } else { // handle data from a client if ((nbytes = recv(i, buf, sizeof(buf), 0)) <= 0) { // got error or connection closed by client if (nbytes == 0) { // connection closed printf("selectserver: socket %d hung up\n", i); } else { perror("recv"); } close(i); // bye! FD_CLR(i, &master); // remove from master set } else { // we got some data from a client for(j = 0; j <= fdmax; j++) { // send to everyone! if (FD_ISSET(j, &master)) { // except the listener and ourselves if (j != listener && j != i) { if (send(j, buf, nbytes, 0) == -1) { perror("send"); } } } } } } // it's SO UGLY! } } } return 0; }
  7. Anybody got a tutorial on how to implement a table? I need a multicolumned list with a scroll bar. Data is not comming from a database. Any suggestions?
  8. Hey Circlesoft - The problem I'm having is that Microsoft have removed the DX7 SDK from their website, so i need to find a mirror that has it. If anyone else has a copy they can send me, i'd be very greatful - I do have a FTP server if someone wants to upload to that, but its only a 1mbit connection i've got. Oh - and btw yes I do want the documentation, because I've been asked to make a replacement Direct Play application that uses the DX7 sdk as the old one has been put out of use due to instability. Thanks!
  9. I require a mirror for the DirectX 7.0A SDK. If you know of one, or you have a copy and are willing to upload/transfer it to me, i would be greatful. BTW: Please do not ask "Why not use DirectX 9.0" please! I have my reasons! Thank you very much!
  10. FMDGames

    DPlay_IPC_GUID

    As you may (or may not) have heard microsoft gaming zone is to be shutdown for all CD-ROM based games. I intend to program a private lobby system for a team but I need advice about how games like motocross madness work over the internet. I understand that the game is launched and a GUID is provided as a parameter. This parameter is then parsed and the game communicates with the app that started it. Any related information would be of great help!
  11. The problem is that I don't create the pointer, the pointer is created by lua internally when lua_register() is called. Once lua_register() is called, then you can call the function from lua using the name you designated: lua_register(luaVM, "mytestfunction", lfn_MyTestFunction); so in C the function is called lfn_MyTestFunction where in lua, you use mytestfunction() to call the C function. So basically, Will I need to deallocate that pointer by inserting a function in lua's C source code?
  12. Situation: I am trying to develop code that is modular in the form of a DLL. The host program calling the DLL file executes a function called Register() which contains lua_registers() for all functions within the DLL that are to be accessable by lua. This all works fine. Problem: During cleanup, when lua_close(luaVM); is called, the following is displayed in a dialog box: ------------------------------------------------------------------------------- Windows has triggered a breakpoint in project.exe. This may be due to a corruption of the heap, and indicates a bug in project.exe or any of the DLLs it has loaded. The output window may have more diagnostic information |BREAK| |CONTINUE| |IGNORE| ------------------------------------------------------------------------------- Pressing BREAK takes me into dbgheap.c to _CrtIsValidHeapPointer. If you look at the description, it says the following: *int _CrtIsValidHeapPointer() - verify pointer is from 'local' heap * *Purpose: * Verify pointer is not only a valid pointer but also that it is from * the 'local' heap. Pointers from another copy of the C runtime (even in the * same process) will be caught. * *Entry: * const void * pUserData - pointer of interest * *Return: * TRUE - if valid and from local heap * FALSE otherwise But as the pointers that are used for lua come from the DLL, that means its NOT on the local heap, but instead the heap used for the DLL. Sorry for the long post, i've been hammering away at this for too long now. Thanks for any suggestions :)
  13. that didnt work for me, the translation always overrided the rotation.
  14. that didnt work for me. After further research, i found out i had to multiply the translation matrix and the rotation matrices. So, I got translation matrix. Then i got the X, Y & Z rotation matrices and multiplied the translation matrix by the X, Y & Z matrices. //Simplified Code from my gfx engine D3DMATRIX mWorld, mXRot, mYRot, mZRot; D3DXMatrixTranslation(&mWorld, X, Y, Z); D3DXMatrixRotationX( &mRotX, D3DXToRadian(X_angle) ); D3DXMatrixRotationY( &mRotY, D3DXToRadian(Y_angle) ); D3DXMatrixRotationZ( &mRotZ, D3DXToRadian(Z_angle) ); mWorld *= mRotX * mRotY * mRotZ; Note, you must have translation matrix = rot x etc otherwise it doesn't work! Thanks for your suggestion NexusOne :)
  15. How do i rotate a mesh in local space? I've got objects positioning themselves in world space, but they're all facing the same way. How can i change the way they are facing?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!