GNOM/presence: informations for distant network objects
Override-6 opened this issue · 0 comments
Override-6 commented
Current informations only let the user know if a network object is stored on an engine id with the requested reference.
NetworkPresencesHandlers should be able to provide this kind of infroamtion to the user :
- the object's type
- the object itself (if allowed)
- the object hashcode
- the object class's checksum
- is the distant object the same (class, hashcode, type, etc or equals) as this object for all engines (or one engine, or a list...)
Example
val linker = network.getGeneralNetworkObjectLinker
val presence = linker.getPresence(PacketTraffic / 0 / 7 / 5)
val friend = "Engine01Identifier" //the engine's identifier we want to extract informations
val isPresent = presence.isPresentOnEngine(friend) //true if the engine has opened any packet channel at 0/7/5
if (isPresent && presence.sameClass[MessagePacketChannel])) {
//we are now sure that the engine have opened a MessagePacketChannel that we can use directly and use to send a message
val channel = traffic.getInjectable(MessagePacketChannel, ChannelScopes.retains(friend))
channel.sendMessage("Hello, Friend !")
}