![]() |
05-21-2015
|
4 | |
Enguard & Alumni
Join Date: Sep 2011
Posts: 5,773
|
I'm not sure how you'd really determine which should take precedence if you have someone on your friends list who also has you blocked. I imagine it'd be something like:
Seems messy, would be better if the indicators for people who have you blocked or have chat turned off were an overlay of other indicators, like a scaled down version of: https://cdn0.iconfinder.com/data/icons/pixelo/32/block.png (Unsupported image host) So if they were in your guild but have you blocked, it'd be the green icon with that over it... I dunno. |
|
05-22-2015
|
8 | |
Registered User
Join Date: Jul 2014
Posts: 783
|
You manipulate numbers at the binary level to achieve a bit field. You can see how they're sometimes used in practice here: http://php.net/manual/en/errorfunc.constants.php Basically you take a number of on/off, true/false attributes and merge them into a single integer using bitwise operators. For the attribute value though, you can condense it even further into a string with 7 or 8-bit characters, and each character represents it's own 7 or 8 on/off, true/false values. The client at the other end can then use that to determine how to display an indicator. I must caution, Thor told me that bitwise operators have become broken in some sense. I have no clue about any specifics, so if you were to do this, you might want to do some testing to see how reliable each bitwise operator is (and if any are unreliable, complain up the ladder). Meanwhile, displaying an indicator to show the other player has blocked you? That would be a bit less trivial because it's specific to each player and not a global on/off value. I believe I actually used this method with the custom movement system for post-NPC server Classic. E.g. a flag would be set if a player was within a space that was something like 3 tiles across horizontal or vertical to signify that the player was not blocking and be accessible using a player attribute field.
Last edited by deadowl; 05-22-2015 at 01:27 AM.
|
|