Tag Info

Hot answers tagged

12

Answers SRP - Secure Remote Password - This is based on Diffie-Hellman. The idea is that you can do a mutual password check without actually ever transferring the password or any information that can be used to derive it. Even though it's secure over the wire you should still hash and salt your passwords as your server must never store them in plain text. ...


7

Two observations: Your condition system seems to have two orthogonal axes: temperature and poison. Represent them as such. When thinking about this you should separate transitions from states. COLD and HOT are transitions in the way you mention them, not states. Combining those observations would result in something like this: // These is the ...


6

When I need to use flags I usually do something along these lines. enum obj_state { NORMAL = 0x00000; DRY = 0x00002; HOT = 0x00004; BURNING = 0x00008; WET = 0x00010; COLD = 0x00020; FROZEN = 0x00040; POISONED = 0x00080; }; int objFlags; void DryOn() { objFlags |= DRY; } void ...


5

Without having read through all your code (or, indeed, being very familiar with .NET) and thus not knowing how appropriate this suggestion is: Make a wrapper around a class like MemoryStream, and add methods to objects that need to be serialized/deserialized. Don't just make a class that's an arbitrary bag of data. If you have a Widget class, it might read ...


5

Endianness matters when it comes to game consoles. The Wii, the PS3, and the XBox 360 all run big-endian, while all major desktop computers (as of the date I'm writing this answer) run little-endian. If there's a chance you'll want to compile your code for one of those game consoles someday, or if someone releases another popular big-endian desktop machine ...


4

What you ultimately end up using at runtime is going to be processed version of your exchange formats whether you do it offline or at runtime. The main differences are: If you do it at runtime then you're going to end up paying the processing cost repeatedly and You probably want to spend as little time processing and optimizing as possible so your load ...


3

Representing your states as bitmask like you write, you can just translate your descriptions of the constraints into code: if ( (state & HOT) && (state & COLD) ) { state &= ~HOT; state &= ~COLD; // reset both HOT and COLD flags if both are set } if ( (state & COLD) && (state & WET) ) { state &= ...


2

I think my last comment to Jonathan's otherwise excellent answer is worth expanding into an answer of its own: If you don't have a lot of crypto experience, you shouldn't try to design your own encryption layer if you can avoid it. If you do have a lot of crypto experience, you should know better than to design your own encryption layer if you can avoid ...


2

If you're concerned about performance, there's no reason to add additional operations to your setup. Especially operations containing hard disk read/writes as those are some of the slowest operations you can perform. Additionally, since it's running fine now, there's nothing to fix yet. You should start worrying about performance, when there's a performance ...


1

I've implemented such offline format near month ago for my engine. The basic algorithm is: Write formal specification for output binary file in word processor. Header + data blocks. Data types, offsets, descriptions of each element of each block table. Write offline exporter from your 3D editor into C++ code text headers using embedded scripting language. ...



Only top voted, non community-wiki answers of a minimum length are eligible