Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About drekkar

  • Rank
  1. drekkar

    inverting an int

    for integers _asm neg iNumber for real numbers __asm{ fld fNumber fchs fstp fNumber } edit: added number suffixes instead of just i and f
  2. drekkar

    Winsock SOCKET buffer dumping

    If your program does it (encryption, checksums, etc), it can be emulated by someone else. Basically you cannot trust ANY data sent by the client, the only solution is to test 100% of the data contained within the packets (100% means lengths, null termination, validate values, etc). With a smaller game that isn't a big deal, you can add simple encryption like xor and bitshifts, randomized sequential keys, etc, but in the long run it can be cracked. If your games success is dependant on the integrity of the data, then you have to work to make sure everything they give you is not BS. A common thing for servers to fail at securing is timing, and null pointers to objects represented by id's, which results to malicious users being able to exploit or crash the servers. Another solution is to closely moderate the game, i've seen vournable games thrive on good moderation because any progress from cheaters was reset when found. Any cheating nobody knew about, didn't effect the playerbase :P. Still I'm very favorable of the first paragraph. :)
  3. drekkar

    Question about winsock versions

    ah man.. and here I was thinking windows.h was my friend rofl :P thanks hplus :D
  4. drekkar

    how do people cheat / hack ??

    I dont think maple story is a good example of a secure online game, I've read that the hit detection is done client side, which might be good for pushing down the processing necessary on the server, but now people have the ability to walk around without taking a hit. Also aparently life regen is also client sided, not good :( (aparently also you get kicked off for regaining life too often). Maple story's debugger detection isnt more than a call to IsDebuggerPresent() which can be got around easily, and I think they do CRC checks on their code or something periodically, i just read it but i'm not sure :P. I never did anything with this game personally but just read some stuff from people who have :). Obviously encrypting your protocol will help to a point - however still dont asume this will protect anything. This will stop simpler crackers, but still people will reverse your encryption. Also encrypting your packets wont be all protecting because when people edit something like their position for example - your encryption will still process whatever coordinates they set. Generally as said the client should just request actions being done, and the server should check if it's possible, within range, within reasonable values to not crash your clients, correct length packet, etc. Basically asume the player can and will use any possible values for everything in the packets. Generally they can get really creative, and if you give them any openings it could result in total disaster. Also a major thing alot of game developers tend to forget about is speed, be sure to not let them take advantage of this on you :) A good thing to do to track duping is to ID your high end items, so you could go through your database periodically and make sure no one has more than 1 of the same ID best item in the game :D Maybe since it's a small scale game you could even detect when high end items like this are sold to NPC's, traded, whatever :) I guarantee if you put a great item in the hands of someone who knows how to dupe - they will do it. You could use this to your advantage by letting them 'find' an amazing item, and log all traffic between you and the person who has that special item (of course they will transfer it to some newbie to dupe with to avoid deletion, yada yada) althrough you should be extremely secure when dealing with item transferring/dropping/picking up/whatever so there shouldnt be any duping, but sometimes stuff just happens ;)
  5. drekkar

    Direct3d textures

    alternatively you could create a texture, lock it, and write it how you please if(FAILED(pD3DDevice->CreateTexture(32, 32, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pTexture))) return 0; D3DLOCKED_RECT LockedRect; pTexture->LockRect(0, &LockedRect, 0, 0); DWORD* bits = (DWORD*) LockedRect.pBits; // from here just load your color info however you want :P int x, y; for(y=0; y<32; y++){ for(x=0; x<32; x++){ bits[x+(y*(LockedRect.Pitch >> 2))] = D3DCOLOR_ARGB(128, x, y, 255); } } // finally dont forget to unlock pTexture->UnlockRect(0);
  6. if you decide to go for the non resizing window you can just AND NOT WS_SIZEBOX and WS_MAXIMIZEBOX from whatever styles you are using ex. WS_OVERLAPPEDWINDOW & ~ (WS_SIZEBOX | WS_MAXIMIZEBOX)
  7. There's a program called VMWare that will allow you to test multiple OS's in different windows, takes alot of space to install I think. I havent personally tried it but I think it's useful for situations like this. :)
  8. drekkar

    C++ first so bad???

    well c++ was my first language too because I heard it's a widely used and optimum language for games (and very widely used in the industry, which is where i've wanted to be since elementary school :)). I mean the only other language i've touched now is assembly for debugging purposes and further understanding of computers and how they work :) I mean now a days it seems to be a trend to know like all kinds of languages, so I might have to extend my knowledge to a few more things.. which I probably could've gotten out of the way a while ago.
  9. make member function pointer funcPtr void (CEngine::*funcPtr)() = &CEngine::CustomFunction; call member function pointer funcPtr (g_pEngine.*funcPtr)(); also if you just want to call the function -> is not working because it's not being called from a pointer, alternatly you could use CEngine.CustomFunction() or fix your definition class CEngine { public: CEngine(); void CustomFunction(); } *g_pEngine; // <- note the * with the above you can use CEngine->CustomFunction()
  10. drekkar

    "HOW TO"-turn off, reboot

    I was also interested in drive enumeration the other day, I'll post the function I wrote for it, even though msdn shows the specifics on it. There's more to what I did involving GetDiskFreeSpaceEx() and GetVolumeInformation() to get alot of information from the drives, but i'll leave msdn to explain those for you :) #include <windows.h> #include <stdio.h> int main(){ DWORD dwDrives = 0; dwDrives = GetLogicalDrives(); char path[4]; unsigned char driveType; int i; for(i=0; i<32; i++){ if((dwDrives >> i) & 0x01){ sprintf(path, "%c:\\", 'A'+i); driveType = GetDriveType(path); printf("%c:\\ - ", 'A'+i); switch(driveType){ case DRIVE_UNKNOWN: printf("Undetermined\n"); break; case DRIVE_NO_ROOT_DIR: // invalid printf("Invalid Path\n"); break; case DRIVE_REMOVABLE: // removable storage printf("Removable Storage\n"); break; case DRIVE_FIXED: // hard disk drives printf("Hard Disk Drive\n"); break; case DRIVE_REMOTE: // network drive printf("Netowrk Drive\n"); break; case DRIVE_CDROM: // cd drives printf("CD-ROM Drive\n"); break; case DRIVE_RAMDISK: // ram disk printf("Ram Disk\n"); break; default: printf("INVALID DRIVE TYPE (%02X)\n", driveType); break; } } } return 0; }
  11. drekkar

    color keying

    thanks for the replies guys :) If I was to use method B would I just lock the greyscaled texture and modulate it before each render of each object on the screen of a different color, or is there another way?
  12. drekkar

    color keying

    well i dont know if the topic is the word for it, but I'm just not sure what's a more reasonable way to do this. For example take starcraft, how the units and building each had the team color on them depending on who owned them. I want to do something like this in my game (not RTS, but that doesnt matter :P), so I was thinking if a texture has something like a perfect grey (r==g==b) it will use my specified color as the shade (so I can have stuff shaded and color keyed). But I got to thinking how should I do this. Is there anything in DirectX that does this? The only solution I could think of is to copy the texture and change the colors, or lock the texture & make the changes, then do it each time I want a different color. But I got to thinking would it be sensible to have to change maybe 200 pixels each frame locking and unlocking the texture that much? That's why I thought it might be better to just make seperate textures for each color I need, but I am going to have so many things that I don't think it's worth it on the RAM (if it would even fit) :( Any suggestions?
  13. Well hmmm... if I decide to start changing all of my out going packets, wouldn't I be DoSing 2 players? (edit: guess I didnt read the previous posts :P) Because my data would never match up with the other clients who I am calculating for. What about if all the people controlling my character log off? Personally I dont like the idea of any other computer than the master server controlling authentication, because for games, that leads to doom :(. If this game is really worth cheating in, people will find a way to do it. Since the only authentication is though p2p, big groups of wannabe cheaters would assemble under a decent coder/cracker and swap IP's/progs/modded clients to cheat. It is a very interesting idea though, p2p game server heh. Just a few complications I'd be worried about
  14. drekkar

    d3dx9 performance

    Wow the update is great, thanks a bunch, it has no frame rate loss now :D But i've come upon another problem... D3DXSprite->Draw seems to have removed scaling/rotation, so do I have to do this manually now? It's not a big deal but if there's an alternative in D3DXSprite I'd like to use it :D I looked at the methods though and didnt see anything :(
  15. Well I just made a text rendering thing that worked off a bitmap just to figure out about this ID3DXFont(). I've been pretty satisfied with performance but it's just been well... slow lately, is this thing and others in D3DX like D3DXSprite slow? Would I be better off just using the vertex buffer way for 2d games for performance, because whenever I add a scoreboard to my game which is about 16 Font->Draw()'s my FPS drops substantially. I'm not doing anything extraordinay in the call, and theres only 16 ships. Is this slow or am I doing something wrong? Or maybe I have the settings wrong for DX9? I'm new to this stuff :P for(i=0; i<MAX_SHIPS; i++){ rText.top = 20 + i * 20; sprintf(buffer, "%s - %i : %i", ship.m_szName, ship.m_iKillCount, ship.m_iDeathCount); rText.left = 650; m_pD3DFont->DrawTextA(buffer, strlen(buffer), &rText, DT_TOP | DT_SINGLELINE, D3DCOLOR_XRGB(255, 255, 255)); } Edit: to clarify more the drop is from 120 to about 50, it goes from smooth to kind of sketchy :( Edited by Coder: Code was too wide [Edited by - Coder on August 17, 2004 4:55:26 AM]
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!