Forums » Union Coders »
Setting the attribute of other client by current client
Added by Darko Blazevic 640 days ago
Hello
In Client class description it says:
In the preceding code, someRoomID is the attribute's scope and someAttributeName is the attribute's name. To set a client's attributes use setAttribute(). Note, however, that by default, a client can set its own attributes only, and cannot set the attributes of other connected clients.
Does this means that this is completely unfeasible or there is a way?
BTW: We decided to use Union as platform for development of card game called Belote. So keep a good work, and hope to have first final version soon.
Darko
Replies
RE: Setting the attribute of other client by current client - Added by colin moock 639 days ago
hi darko,
in fact, in Union 1.0 Alpha 7, clients can set attributes on each other, but that behaviour will be removed in Alpha 8 when we introduce our security and permissions feature. starting with Alpha 8, by default only administrators and possibly moderators will be able to set an attribute on another client. other clients will have two options:
1) clientA could send a private message to clientB and ask clientB to set a specific attribute to some value. clientB could then allow or deny request on an individual basis.
2) perform the attribute assignment server-side in a module. clients would sent the module a module message asking it to perform the assignment, and the module would decide whether to allow it.
hope that helps!
colin
RE: Setting the attribute of other client by current client - Added by Darko Blazevic 639 days ago
thx colin
i went with the 2nd option and it worked
one additional question: is is possible to use in room module (java class) the logger from union - the one that writes to log.txt? and if yes, how to access it?
br
darko
RE: Setting the attribute of other client by current client - Added by derek clayton 635 days ago
Yes it is.
Import:
import org.apache.log4j.Logger;
Get a reference to the logger:
Logger logger = Logger.getLogger(YourRoomModule.class);
Log:
logger.debug("This is a debug message.");
logger.info("This is an info message.");
logger.warn("This is a warn message.");
logger.error("This is a error message.");
logger.fatal("This is a fatal message.");
Regards,
Derek