Merge pull request #425 from pschord/remote-admin

Create PsAdmin framework
This commit is contained in:
Mazo 2020-05-11 14:45:57 +01:00 committed by GitHub
commit fbca774a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 419 additions and 7 deletions

View file

@ -190,6 +190,10 @@ trait ConfigParser {
config_map = map
}
def GetRawConfig : Map[String, Any] = {
config_map
}
def FormatErrors(invalidResult : Invalid) : Seq[String] = {
var count = 0;
@ -209,7 +213,7 @@ trait ConfigParser {
}
protected def parseSection(sectionIni : org.ini4j.Profile.Section, entry : ConfigEntry, map : Map[String, Any]) : ValidationResult = {
var rawValue = sectionIni.get(entry.key)
var rawValue = sectionIni.get(entry.key, 0)
val full_key : String = sectionIni.getName + "." + entry.key
val value = if (rawValue == null) {

View file

@ -64,6 +64,16 @@ class InterstellarCluster(zones : List[Zone]) extends Actor {
case None => //zone_number does not exist
sender ! Zone.Lattice.NoValidSpawnPoint(zone_number, None)
}
case InterstellarCluster.ListPlayers() =>
var players : List[String] = List()
for(zone <- zones) {
val zonePlayers = zone.Players
for (player <- zonePlayers) {
players ::= player.name
}
}
sender ! InterstellarCluster.PlayerList(players)
case msg @ Zone.Lattice.RequestSpecificSpawnPoint(zone_number, _, _, _) =>
recursiveFindWorldInCluster(zones.iterator, _.Number == zone_number) match {
@ -188,6 +198,9 @@ object InterstellarCluster {
*/
final case class GiveWorld(zoneId : String, zone : Zone)
final case class ListPlayers()
final case class PlayerList(players : List[String])
/**
* Signal to the cluster that a new client needs to be initialized for all listed `Zone` destinations.
* @see `Zone`