UMUX Reference_10 - HonestSquare/UMUX GitHub Wiki

개요

  • 본 문서는 API 레벨 10(4.0 Dodoma)를 기반으로 작성된 UMUX 레퍼런스입니다.
  • Ctrl + F 또는 F3을 통해 개별 열람이 가능합니다.

변수 및 함수 위치

  • 변수 및 함수 위치는 이름의 접두사를 우선하되 로마자(A-Z) 순대로 정렬하였습니다.
접두사 목록
  • on
  • init
  • is(has), get(find)
  • set
  • add
  • update, check
  • clear, delete, reset
  • show
  • 상기 목록에서 일치하는 접두사가 없는 경우, show 접두사보다도 아래에 위치해 두었습니다.
  • 다만 일부는 편의상을 이유로 예외 정렬한 곳도 있어, 소스 코드의 모든 객체가 위치를 이 규칙에 따라 정렬된 건 아닙니다.

목차

초기 설정

const ROOMNAME

ROOMNAME: String

  • 서버 이름을 저장합니다

const DESCRIPTION

DESCRIPTION: String

  • 서버 설명을 저장합니다

const MAXLIMIT

MAXLIMIT: Int

  • 최대 인원을 저장합니다

const HOSTNAME

HOSTNAME: String

  • 호스트 이름을 결정합니다

const PUBLIC

PUBLIC: Bool

  • 서버 공개 여부를 결정합니다

const TOKEN

TOKEN: String

  • 만료되지 않은 값을 지정하면 서버 초기화 직후 recaptcha 인증을 건너뜁니다
  • token여기서 발급 받을 수 있습니다

const NOPLAYER

NOPLAYER: Int

  • 호스트 공개 여부를 결정합니다

const REGION_CODE

REGION_CODE: String

  • 지역 코드를 결정합니다

const LAT

LAT: Float

  • 시스템의 위도를 결정합니다

const LON

LON: Float

  • 시스템의 경도를 결정합니다

let PASSWORD

PASSWORD: String

  • 시스템 비밀번호를 저장합니다

const MAXPLAYERS

MAXPLAYERS: Int

  • 최대 인원을 결정합니다

const INITSERVER

INITSERVER(str: String)

  • 서버를 초기화 합니다

const ROOM

ROOM: RoomObject

  • 서버를 초기화 한 뒤 RoomObject를 상수에 저장합니다
  • 서버 초기화를 위해 HBInit(INITSERVER(PASSWORD))를 호출합니다

경기장 초기화

let initStadiums

initStadiums(links: Array<String>)

  • 경기장 데이터베이스를 초기화 합니다
  • 외부 링크 접근이 필요하면 requestStadium()를 호출합니다

let requestStadium

requestStadium(ln: String)

  • 경기장을 데이터베이스에 추가합니다
  • initStadiums()에서 경기장 데이터베이스 초기화를 위해 이 메서드를 호출합니다

class GameManager

  • 게임을 전반적으로 제어합니다

constructor

constructor(afkLimitTime: Int, rptLimitTime: Int, timeLimit: Int)

  • _afkLimitTime: Int: 장기 무응답 플레이어 판정 최소 시간을 초 단위로 저장합니다
  • _repeatedLimitTim: Int: 반복 채팅 판정 최대 시간을 밀리초 단위로 저장합니다
  • _countMatch: Int: 누적 경기 횟수를 저장합니다
  • _gameLink: String: 서버 링크를 저장합니다
  • _gameEventStats: Int: 경기 진행 상태를 저장합니다
  • _isRecording: Bool: 녹화 여부를 저장합니다
  • _firstTimeNotifie: Float: 최초 도달 시간을 저장합니다
  • _lastTimeNotified: Float: 최근 도달 시간을 저장합니다
  • _timeLimit: Int: 도달 기준 시간을 초 단위로 저장합니다
  • _timeLimitReached: Bool: 시간 도달 여부를 저장합니다

onGamePause

onGamePause(player: PlayerObject)

  • 경기가 중지되면 호출합니다
  • _gameEventStats의 값을 c_GAME_STATS.PAUSE으로 갱신합니다
  • 플레이어의 동작으로 호출된 경우, 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
  • goal 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다
  • GUI 갱신을 위해 GameSystem 클래스의 updateWebGUI()를 호출합니다

onGameStart

onGameStart(player: PlayerObject)

  • 경기가 시작되면 호출합니다
  • 경기 제어 준비를 위해 handleGameStart()를 호출합니다
  • 콘솔창에 누적 경기 횟수를 메시지로 띄웁니다

onGameStop

onGameStop(player: PlayerObject)

  • 경기가 종료되면 호출합니다
  • _gameEventStats의 값을 c_GAME_STATS.STOP으로 갱신합니다
  • 선두자 데이터베이스를 지우기 위해 ScoreManager 클래스의 clearTouchedList()를 호출합니다
  • goal 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다
  • 플레이어의 동작으로 호출된 경우, 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
  • GUI 갱신을 위해 GameSystem 클래스의 updateWebGUI()를 호출합니다

onGameTick

onGameTick(void)

  • 경기가 진행되는 동안 호출합니다
  • 현재 시간 ≥_firstTimeNotified + 100을 만족하면 _firstTimeNotified의 값을 현재 시간으로 갱신합니다
  • 경기 제어를 처리하기 위해 handleGameTick()를 호출합니다

onGameUnpause

onGameUnpause(player: PlayerObject)

  • 경기가 재개되면 호출합니다
  • _gameEventStats의 값을 c_GAME_STATS.TICK으로 갱신합니다
  • 플레이어의 동작으로 호출된 경우, 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
  • GUI 갱신을 위해 GameSystem 클래스의 updateWebGUI()를 호출합니다

onKickRateLimitSet

onKickRateLimitSet(min: Int, rate: Int, burst: Int, player: PlayerObject)

  • 킥 제한이 설정되면 호출합니다
  • min 값은 두 킥 간의 최소 로직프레임입니다.
  • rate 값은 burst에 따른 추가 킥을 쓰는 값입니다.
  • burst 값은 추가 킥을 절약할 수 있는 값입니다.

onPlayerBallKick

onPlayerBallKick(player: PlayerObject)

  • 플레이어가 공을 차면 호출합니다
  • 선두자 데이터베이스 추가를 위해 ScoreManager 클래스의 addTouchedList()를 호출합니다

onPlayerJoin

onPlayerJoin(player: PlayerObject)

  • 신규 플레이어가 접속하면 호출합니다
  • 플레이어 데이터베이스 초기화를 위해 PlayerManager 클래스의 initPlayerList()를 호출합니다
  • GUI에 명단을 추가하기 위해 GameSystem 클래스의 addListIndex()를 호출합니다
	let hasVisitRecord = PM.updateAccount(player.id);	//	계정 데이터베이스 갱신
  • 계정 데이터베이스 갱신을 위해 PlayerManager 클래스의 updateAccount()를 호출합니다
  • 블랙리스트 여부를 판정하기 위해 Administration 클래스의 isBlacklist()를 호출합니다
  • 중복 및 다중 접속 감지를 위해 Administration 클래스의 hasMatchedConnection()를 호출합니다
  • 접속자가 2인 미만이면 레드팀으로 투입합니다
  • 권한 갱신을 위해 Administration 클래스의 updateAdmins()를 호출합니다
  • 녹화 중이면 플레이어에게 별도의 메시지를 전송합니다
  • 모든 구문이 온전하게 진행되었으면 hasVisitRecord 값을 반환합니다

onPlayerLeave

onPlayerLeave(player: PlayerSystem)

  • 접속자가 퇴장하면 호출합니다
  • 플레이어의 데이터베이스를 지우기 위해 PlayerSystem 클래스의 clearPlayer()를 호출합니다
  • 접속자가 있으면 권한 갱신을 위해 Administration 클래스의 updateAdmins()를 호출합니다
  • 접속자가 없으면 비밀번호 갱신을 위해 Administration 클래스의 updatePassword()를 호출합니다
  • 콘솔창에 접속 인원을 메시지로 띄웁니다

onPositionsReset

onPositionsReset(void)

  • 골 판정 직후 포지션이 초기화되면 호출합니다

onRoomLink

onRoomLink(address: String)

  • 시스템에서 링크가 생성되면 호출합니다
  • 서버 초기화가 필요한 경우 GameSystem 클래스의 initServer()initWebGUI()를 호출하고 구문을 종료합니다
  • 서버 안정을 위해 GameSystem 클래스의 enableRecaptcha()를 호출합니다

onStadiumChange

onStadiumChange(newMap: String, byPlayer: PlayerObject)

  • 경기장이 교체되면 호출합니다
  • 플레이어의 동작으로 호출된 경우, 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
  • 경기장 블랙리스트에 포함된 경우, 0번째 경기장으로 교체하고 Administration 클래스의 addBlacklistByPlayer()를 호출합니다

onTeamGoal

onTeamGoal(team: TeamID)

  • 골이 판정되면 호출합니다
  • 선두자 데이터베이스를 구하기 위해 ScoreManager 클래스의 lastTouchedPlayer를 불러옵니다
  • 어시스트 데이터베이스를 구하기 위해 ScoreManager 클래스의 findAssist()를 호출합니다
  • 플레이어의 전적 데이터베이스를 구하기 위해 ScoreManager 클래스의 findRankListByPlayer()를 호출합니다
  • 득점 데이터베이스 갱신을 위해 ScoreManager 클래스의 updateGoals()를 호출합니다
  • GUI 갱신을 위해 GameSystem 클래스의 updateWebGUI()를 호출합니다
  • 짧은 시간 동안 득점자를 등번호로 강조하는 goal 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

onTeamVictory

onTeamVictory(scores: ScoresObject)

  • 경기 승패가 결정되면 호출합니다
  • 승리한 팀을 구하기 위해 ScoreManager 클래스의 findWinner()findTeamName()를 호출합니다
  • 전적 데이터베이스를 갱신하기 위해 ScoreManager 클래스의 findRankListByPlayer()를 호출합니다

handleGameStart

handleGameStart(void)

  • 경기 제어를 준비합니다
  • _gameEventStats의 값을 c_GAME_STATS.START으로 갱신합니다
  • _countMatch의 값을 1 증감합니다
  • _firstTimeNotified의 값을 현재 시간으로 갱신합니다
  • _lastTimeNotified의 값을 현재 시간으로 갱신합니다
  • _timeLimitReached의 값을 false으로 초기화 합니다
  • 선두자 데이터베이스를 모두 지우기 위해 ScoreManager 클래스의 clearTouchedList()를 호출합니다
  • 플레이어의 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다

handleGameTick

handleGameTick(currentTime: Float)

  • 경기 제어를 처리합니다
  • 선두자 데이터베이스 갱신을 위해 ScoreManager 클래스의 updateTouchedList()를 호출합니다
  • _timeLimit < 1을 만족하면 false의 값으로 반환합니다
  • 최근 기록 시간에서 도달 기준 시간 이후로 경과된 경우, _lastTimeNotified의 값을 현재 시간으로 갱신하고 true의 값으로 반환합니다
  • 0초에서 도달 기준 시간 이후로 경과되면 _timeLimitReached의 값을 true로 갱신하고 true의 값으로 반환합니다
  • 모든 구문이 온전하게 진행되었으면 false의 값으로 반환합니다

get afkTime

  • 10~10800 사이의 값이면 _afkLimitTime를 반환합니다

get gameLink

  • _gameLink를 반환합니다

get gameStats

  • _gameEventStats를 반환합니다

get recStats

  • _isRecording를 반환합니다

get rptTime

  • _repeatedLimitTime를 반환합니다

get totalMatch

  • _countMatch를 반환합니다

set afkTime

set afkTime(v: Int)

  • 장기 무응답 판정 최소 시간을 지정합니다
  • v의 값은 10~10800 범위 안이며 _afkLimitTime의 값과 달라야 합니다
  • 장기 무응답 플레이어를 변경된 시간으로 판정하기 위해 모든 플레이어의 활동 시간을 갱신해야 하므로, PlayerManager 클래스의 updateTime()를 호출합니다
  • _afkLimitTime의 값을 수정합니다

set gameLink

set gameLink(v: String)

  • 서버 링크를 지정합니다
  • 서버를 초기화 할 때 한 번만 실행됩니다
  • _gameLink의 값을 수정합니다

set gameStats

set gameStats(v: Int)

  • 경기 진행 상태를 갱신합니다
  • _gameEventStats의 값을 수정합니다

set recStats

set recStats(v: Bool)

  • 녹화 상태를 갱신합니다
  • _isRecording의 값을 수정합니다

findStadiumNameList

findStadiumNameList(target: Int)

  • 경기장 데이터베이스의 이름을 반환합니다
  • target의 값이 유효한 경우 특정 인덱스를 가진 경기장의 이름을 반환합니다

findTeamName

findTeamName(value: teamID)

  • 팀 ID를 문자열로 반환합니다

checkPublicId

checkPublicId(msg: String, player: Int, hasAllRange: Bool)

  • #ID를 판별하여 지목한 대상의 ID를 문자열에서 정수형으로 반환합니다
  • hasAllRangetrue의 값을 가지면 미접속자의 ID도 포함합니다

loadMap

loadMap(target: Int, player: Int)

  • 데이터베이스 내에서 경기장을 교체합니다
  • 시스템이 금지한 경우, 경기장을 교체하지 않고 구문을 종료합니다

reorderPlayers

reorderPlayers(playerIdList: Array<Int>, moveToTop: Bool)

  • 플레이어의 데이터베이스를 지정 순번에 따라 재정렬합니다
  • 정렬할 명단을 지정하지 않은 경우, 모든 플레이어 데이터베이스를 정렬합니다
  • moveToTop의 값이 true인 경우, 데이터베이스를 내림차순으로 정렬합니다
  • GUI 갱신을 위해 GameSystem 클래스의 updateWebGUI()를 호출합니다

runCommand

runCommand(src: Array<String>, type: Array<String>, player: PlayerObject)

  • 명령어로부터 기능을 연결합니다
  • 입력자가 접속해 있지 않는 경우 false의 값으로 반환합니다
	let fn = Function('"use strict";return (' + src + ')')();	//	실행 구문
  • fn()을 통해 기능을 실행합니다
  • type[2]의 값이 부적절한 경우 -1fn()의 인자값으로 전달합니다
  • 모든 구문이 온전하게 진행되었으면 true의 값으로 반환합니다

startRecording

startRecording(hideAnchor: Bool)

  • 시스템 녹화를 시작합니다
  • 이미 진행하고 있는 녹화가 있으면 stopRecording()를 호출하여 종료합니다
  • 녹화 상태를 갱신하기 위해 _isRecording의 값을 갱신합니다

stopRecording

stopRecording(void)

  • 시스템 녹화를 종료합니다
  • 녹화 상태를 갱신하기 위해 _isRecording의 값을 갱신합니다
	let file = room.stopRecording();
  • 모든 구문이 온전하게 진행되었으면 file의 값을 반환합니다

class Administration

  • 시스템의 전반적인 권한을 제어합니다

constructor

constructor(dynamicAdmin: Bool, isAllowJoin: Bool, isLockStadium: Bool, defaultStadium: Int, maxAdmin: Int, pinHost: Bool)

  • _blacklist: Array<BlacklistSystem>: 블랙리스트 데이터베이스를 저장합니다
  • _enableDynamicAdmin: Bool: 권한 할당 방식을 저장합니다
  • _isAllowTeamSwitch: Bool: 플레이어 팀 자율 교체권을 저장합니다
  • _isLockStadium: Bool: 경기장 고정 여부를 저장합니다
  • _defaultStadium: String: 고정 경기장 데이터를 저장합니디
  • _maxAdminLimit: Int: 최고 관리자 상한 인원을 저장합니다
  • _pinHost: Bool: 호스트 팀 이동 여부를 저장합니다

onPlayerAdminChange

onPlayerAdminChange(givenPlayer: PlayerObject, byPlayer: PlayerObject)

  • 플레이어의 권한이 변경되면 호출합니다
	let target = PM.findPlayerById(givenPlayer.id);
  • 권한 변경 대상의 데이터베이스 갱신을 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • 플레이어의 동작으로 호출된 경우, 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
  • givenPlayer.admin의 값이 true인 경우
    • 보조 권한을 가진 플레이어가 마우스 클릭을 통한 게임 내 기능으로 권한이 변경되는 경우, 보조 권한을 해제합니다
  • givenPlayer.admin의 값이 false인 경우
    • 최고 권한을 가진 플레이어는 권한이 해제된 직후 보조 권한이 부여됩니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 addListIndex()를 호출합니다

onPlayerKicked

onPlayerKicked(kickedPlayer: PlayerObject, reason: String, ban: Bool, byPlayer: PlayerObject)

  • 접속자가 강제 퇴장되면 호출합니다
  • 강제 퇴장자의 데이터베이스 갱신을 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • reason의 값이 Bad actor로 감지되면 오류 메시지를 전송하고 구문을 종료합니다
  • 플레이어의 동작으로 호출된 경우, 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다

get allowJoin

  • _isAllowTeamSwitch의 값을 반환합니다

get dynmcAdmin

  • _enableDynamicAdmin의 값을 반환합니다

get lockStadium

  • _isLockStadium의 값을 반환합니다

get maxAdmin

  • 1~MAXPLAYERS 사이의 값이면 _maxAdminLimit를 반환합니다

get password

  • PASSWORD의 값을 반환합니다

get rstrStadium

  • _defaultStadium의 값을 반환합니다

set allowJoin

set allowJoin(bool: Bool)

  • 플레이어의 팀 자율 교체를 허용하거나 금지합니다
  • _isAllowTeamSwitch의 값을 수정합니다

set dynmcAdmin

set dynmcAdmin(bool: Bool)

  • 권한 할당 방식을 변경합니다
  • _enableDynamicAdmin의 값을 수정합니다

set lockStadium

set lockStadium(bool: Bool)

  • 경기장을 고정하거나 해제합니다
  • 경기장이 고정되면 GameManager 클래스의 loadMap()를 호출합니다

set password

set password(value: String)

  • 시스템 비밀번호를 지정합니다
  • 비밀번호 고정 장치가 활성화 돼 있는 경우 구문을 종료합니다
  • 모든 구문이 온전하게 진행되었으면 updatePassword()를 호출합니다

isBlacklist

isBlacklist(player: Int, isSuper: Bool)

  • 플레이어의 블랙리스트 포함 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()BlacklistSystem 클래스를 호출합니다
  • 플레이어의 공용 주소를 구하기 위해 findAddress()를 호출합니다
  • 일치하는 데이터베이스가 없으면 false의 값을 반환합니다
  • 이름 데이터가 비어 있으면 현재 데이터로 갱신합니다
  • 주소 데이터가 비어 있으면 현재 데이터로 갱신합니다
  • 데이터베이스 추가를 위해 addBlacklist()를 호출합니다
  • 모든 구문이 온전하게 진행되었으면 true의 값을 반환합니다

isMute

isMute(target: Int)

  • 플레이어의 채팅 금지 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

hasAdmin

hasAdmin(player: Int, level: Int)

  • 플레이어의 관리자 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

hasMatchedConnection

hasMatchedConnection(player: Int)

  • 플레이어의 중복 및 다중 접속 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • 비교 대상과 이름이 일치하고
    • 공용 네트워크도 일치하면 중복 접속으로 판정합니다
    • 공용 네트워크가 일치하지 않으면 다중 접속으로 판정합니다
  • 비교 대상과 공용 주소가 일치하면 다중 접속으로 판정합니다
  • 중복 및 다중 접속으로 판정된 경우 강제 퇴장합니다
    • 데모 모드가 활성화 돼 있는 경우 강제 퇴장하지 않습니다

findAddress

findAddress(target: Int)

  • 플레이어의 공용 주소를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

findAdminList

findAdminList(level: Int)

  • 관리자 데이터베이스를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

findBlacklistByAddress

findBlacklistByAddress(conn: PlayerObject.conn)

  • 특정 공용 주소를 가진 블랙리스트 데이터베이스를 반환합니다

findBlacklistByName

findBlacklistByName(str: String)

  • 특정 이름을 가진 블랙리스트 데이터베이스를 반환합니다

findMutedList

findMutedList(isPublic: Bool)

  • 채팅 금지자 데이터베이스를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

findNetwork

findNetwork(target: PlayerObject.auth)

  • 플레이어의 공용 네트워크를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

addBlacklist

addBlacklist(isSuper: Bool, name: String, conn: PlayerObject.conn)

  • 블랙리스트 데이터베이스를 등록합니다
  • 데이터베이스 초기화를 위해 BlacklistSystem 클래스를 호출합니다

addBlacklistByPlayer

addBlacklistByPlayer(target: Int, isSuper: Bool)

  • 특정 플레이어를 블랙리스트에 등록합니다
  • 슈퍼 블랙리스트로 등록한 직후 접속자가 있으면 강제 퇴장합니다
  • 데이터베이스 등록을 위해 addBlacklist()를 호출합니다

updateAdmins

updateAdmins(void)

  • 접속자의 권한을 갱신합니다
  • 정적 권한 할당 방식이 설정된 경우 구문을 종료합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • 최고 관리자가 이미 있는 경우 구문을 종료합니다
  • 권한을 부여하기 위해 giveAdmin()를 호출합니다
    • 블랙리스트에 해당하는 경우 보조 권한을 부여합니다

updatePassword

updatePassword(pass: String)

  • 시스템 비밀번호를 갱신합니다
  • 비밀번호 고정 장치가 활성화 돼 있는 경우
  • PASSWORD의 값을 수정합니다
    • pass의 값이 부적절하거나 공백인 경우 null 값을 대입합니다
  • 모든 구문이 온전하게 진행되었으면 PASSWORD의 값을 반환합니다

clearBans

clearBans(player: Int)

  • 서버 내 영구 퇴장 명단을 모두 지웁니다

clearMutedList

clearMutedList(player: Int)

  • 채팅 금지 명단을 모두 지웁니다
  • 데이터베이스를 구하기 위해 findMutedList()를 호출합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다

clearPassword

clearPassword(byPlayer: Int)

  • 시스템 비밀번호를 해제합니다
  • 비밀번호 고정 장치가 활성화 돼 있는 경우 구문을 종료합니다
  • 비밀번호 갱신을 위해 updatePassword()를 호출합니다

deleteAdmin

deleteAdmin(player: Int, isSub: Bool)

  • 플레이어의 권한을 해제합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

resetGame

resetGame(player: Int)

  • 경기를 재시작합니다

showAdminList

showAdminList(target: Int)

  • 게임에서 관리자 명단을 메시지로 전송합니다
  • 데이터베이스를 구하기 위해 findAdminList()를 호출합니다
  • 권한 유형에 따라 서로 다른 행으로 표시합니다
    • 접속자 중에서 관리자가 없는 경우 따로 표시합니다

showPassword

showPassword(player: Int)

  • 게임에서 시스템 비밀번호를 메시지로 전송합니다

cntAdmins

cntAdmins(level: Int)

  • 관리자 인원을 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

enablePinHost

enablePinHost(bool: Bool)

  • 호스트의 팀 이동을 허용하거나 제한합니다
  • 호스트가 비활성화 돼 있는 경우 구문을 종료합니다
  • bool의 값이 true인 경우 호스트를 관중석으로 팀을 고정합니다

giveAdmin

giveAdmin(player: Int, isSub: Bool)

  • 플레이어의 권한을 부여합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

kickPlayer

kickPlayer(target: Int, msg: String, ban: Bool, ...replace: Array<String>)

  • 플레이어를 강제 퇴장합니다

limitScore

limitScore(value: Int, byPlayer: Int)

  • 다음 경기의 제한 점수를 변경합니다
  • value의 값이 0~14 범위를 벗어난 경우 구문을 종료합니다
  • 경기가 진행 중인 경우 구문을 종료합니다

limitTime

limitTime(value: Int, byPlayer: Int)

  • 다음 경기의 제한 시간을 변경합니다
  • value의 값이 0~14 범위를 벗어난 경우 구문을 종료합니다
  • 경기가 진행 중인 경우 구문을 종료합니다

logonAdmin

logonAdmin(player: Int, msg, type: String)

  • 플레이어가 최고 권한 로그인에 성공하면 로그를 출력합니다
  • 이미 권한을 가지고 있는 경우 구문을 종료합니다
  • 장기 대기열에 포함된 경우 데이터베이스에서 제거합니다

missPassword

missPassword(player: Int, msg: String, type: Int)

  • 플레이어가 최고 권한 로그인에 실패한 경우 로그를 출력합니다
  • 이미 권한을 가지고 있는 경우 구문을 종료합니다

mutePlayer

mutePlayer(target: Int, time: Int, byPlayer: Int)

  • 플레이어의 채팅을 금지합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다
  • time ≥ 5를 만족하는 경우 time초 경과 직후 채팅을 허용하는 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

swapGame

swapGame(player: Int)

  • 경기를 시작하거나 종료합니다

unmutePlayer

unmutePlayer(target: Int, byPlayer: Int)

  • 플레이어의 금지된 채팅을 허용합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • 플레이어의 등번호를 초기화 합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다
  • 미접속자는 별도로 알리지 않습니다
  • mute 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다

class BlacklistSystem

  • 블랙리스트 명단을 제어합니다

constructor

constructor(isSuper: Bool, name: String, conn: PlayerObject.conn)

  • _super: Bool: 슈퍼 블랙리스트 여부를 저장합니다
  • _name: String: 이름을 저장합니다
  • _address: PlayerObject.conn: 공용 주소를 저장합니다

hasMatchedName

hasMatchedName(str: String)

  • 이름 일치 여부를 판정합니다
  • 이름이 공백이면 구문을 종료합니다
  • 우회 문자를 제외한 상태를 기준으로 처리합니다

hasMatchedAddress

hasMatchedAddress(conn: PlayerObject.conn)

  • 공용 주소 일치 여부를 판정합니다

hasMatchedDatabase

hasMatchedDatabase(name: String, address: PlayerObject.conn, isSuper: Bool)

  • 데이터베이스 일치 여부를 판정합니다
  • 이름 일치 여부를 판정하기 위해 hasMatchedName()를 호출합니다
  • 공용 주소 일치 여부를 판정하기 위해 hasMatchedAddress()를 호출합니다
  • 모두 불일치하면 false의 값을 반환합니다
  • 슈퍼 블랙리스트 여부에 따라 값을 반환합니다

class Notification

  • 알림 시스템을 관리하고 처리합니다

constructor

constructor(common: Int, acess: Int, caution: Int, info: Int, locked: Int, notice: Int, warning: Int)

  • common: String: 공통 메시지 제목 색상을 저장합니다
  • acess: String: 권한 요구 메시지 제목 색상을 저장합니다
  • caution: String: 주의 메시지 제목 색상을 저장합니다
  • info: String: 상세정보 메시지 제목 색상을 저장합니다
  • locked: String: 잠금/해제 메시지 제목 색상을 저장합니다
  • notice: String: 알림 메시지 제목 색상을 저장합니다
  • warning: String: 경고 메시지 제목 색상을 저장합니다
  • c_LIST_MSG_COLOR: Array<String>: 메시지 색상 목록을 저장합니다

get msgColor

  • c_LIST_MSG_COLOR의 값을 반환합니다

findColor

findColor(color: Int, hasRaw: Bool)

  • 색상 값을 16진수 정수형으로 반환합니다

findSound

findSound(sound: Int)

  • 소리 값을 정수형으로 반환합니다

findStyle

findStyle(style: Int)

  • 서식 값을 정수형으로 반환합니다

announce

announce(msg: String, target: Int, color: Int, style: Int, sound: Int, delay: Int, ...replace: Array<String>)

  • 메시지를 전송합니다
  • target의 값이 음수인 경우 대상을 제외한 다른 모든 플레이어에게 전송합니다
  • delay > 0를 만족하는 경우 delay밀리초 뒤에 전송하는 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

extMsg

extMsg(title: String, content: String, target: Int, advCom: String, titleColor: Int, contentColor: Int, delay: Int, ...replace: Array<String>)

  • 확장된 유니버셜 메시지를 전송합니다
  • 제목과 본문을 서로 다른 행으로 출력합니다
  • announce()를 호출합니다

uniMsg

uniMsg(title: String, content: String, target: Int, advCom: String, delay: Int, ...replace: Array<String>)

  • 유니버셜 메시지를 전송합니다
  • delay의 값은 초 단위입니다
  • extMsg()를 호출합니다

acess

acess(target: Int, reason: String, ...replace: Array<String>)

  • 권한 요구 메시지를 출력합니다
  • extMsg()를 호출합니다

alretMsg

alretMsg(player: Int)

  • 금지어가 감지되면 별도의 알림을 출력합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • 시스템 금지어 최대 감지량 ≤ 플레이어의 금지어 감지량를 만족하면 강제 퇴장합니다
  • 채팅 필터링 엄격도에 따라
    • 1단계에서는 별도로 처리하지 않습니다
    • 2단계에서는 감지 메시지를 출력합니다
    • 3단계에서는 강제 퇴장합니다
    • 4단계에서는 감지 메시지를 출력하고 채팅을 15초간 금지합니다
    • 5단계에서는 채팅을 30초간 금지하고 강제 퇴장합니다
    • 블랙리스트는 한 단계 더 엄격하게 처리합니다
  • announce()를 호출합니다

caution

caution(msg: String, target: Int, advCom: String, ...replace: Array<String>)

  • 주의 메시지를 출력합니다
  • extMsg()를 호출합니다

fmtStr

fmtStr(str: String, rep: Array<String>, target: Int)

  • 특정 기호를 변수의 값으로 치환한 후 문자열로 반환합니다
	if(rep == undefined || rep.length < 1) return PM.isValid(target) ? str.replace(subst, SYS.showPlayerInfo(target, c_PLAYERINFO_TYPE.NAME)) : str;
  • rep의 값이 유효하지 않는 경우 플레이어의 이름을 반환합니다

help

help(msg: String, exCom: String, target: Int, advCom: String, ...replace: Array<String>)

  • 도움말 메시지를 출력합니다
  • uniMsg()를 호출합니다

info

인자값 5개: info(title: String, context: String, target: Int, advCom: String, ...replace: Array<String>)

인자값 4개: info(title: String, context: String, target: Int, advCom: String)

기타: info(msg: String, target: Int, advCom: String)

  • 상세정보 메시지를 출력합니다
  • extMsg()를 호출합니다

locked

locked(isLock: Bool, msg: String, target: Int, advCom: String, ...replace: Array<String>)

  • 잠금/해제 메시지를 출력합니다
  • extMsg()를 호출합니다

msgCommand

msgCommand(title: String, content: String, target: Int, advCom: String, ...replace: Array<String>)

  • 명령어 목록을 출력합니다
  • uniMsg()를 호출합니다

notice

notice(msg: String, target: Int, advCom: String, ...replace: Array<String>)

  • 알림 메시지를 출력합니다
  • uniMsg()를 호출합니다

warning

warning(msg: String, target: Int, advCom: String, ...replace: Array<String>)

  • 경고 메시지를 출력합니다
  • extMsg()를 호출합니다

class ChatManager

  • 전반적인 채팅 시스템을 관리합니다

constructor

constructor(isFreeze: Bool, isLockPrivateChat: Bool, detectorLevel: Int, maxForbiddenWordCount: Int, maxRepeatedCount: Int)

  • _playerList: Array: 플레이어의 데이터베이스를 저장합니다
  • _isFreezeChat: Bool: 채팅 얼림 여부를 저장합니다
  • _isLockPrivateChat: Bool: 개인 채팅 금지 여부를 저장합니다
  • _detectorLevel: Int: 채팅 필터링 엄격도를 저장합니다
  • _maxForbiddenWordCount: Int: 금지어 최대 감지량을 저장합니다
  • _maxRepeatedCount: Int: 도배 최대 감지량을 저장합니다

onPlayerChat

onPlayerChat(player: PlayerObject, msg: String)

  • 플레이어가 채팅을 전송하면 호출합니다
  • 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
	let commandsList = [							//	명령어 목록
				internalCommands, standardCommands, customCommands
			];
  • 명령어 데이터베이스를 불러오기 위해 internalCommands, standardCommands, customCommands를 호출합니다
    • 문자열 첫 글자에 따라 명령어 유형을 결정합니다
      • 첫 글자가 !이면 0의 값으로 저장합니다
      • 첫 글자가 ?이면 1의 값으로 저장합니다
      • 첫 글자가 !!이면 2의 값으로 저장합니다
    • 명령어를 판독하고 기능을 연결하기 위해 GameManager 클래스의 runCommand()를 호출합니다
    • 명령어 입력이 감지된 경우 구문을 종료합니다
  • 채팅이 금지된 경우 감정 채팅 전송을 위해 sendEmojiChat()를 호출합니다
  • 채팅 로그 갱신을 위해 updateChatLog()를 호출합니다
  • 반복 채팅 감지를 위해 hasRepeatedChat()를 호출합니다
  • 입력된 문자열에서 #의 값이 감지된 경우 개인 채팅 명령어로 처리하기 위해 Commands 클래스의 comPrivateChat()를 호출합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • 플레이어의 채팅 모드가
    • 0의 값을 가지면 전체 채팅을 전송하기 위해 sendAllChat()를 호출합니다
    • 1의 값을 가지면 팀 채팅을 전송하기 위해 sendTeamChat()를 호출합니다

get isFreezeChat

  • _isFreezeChat의 값을 반환합니다

get isLockPrvChat

  • _isLockPrivateChat의 값을 반환합니다

get detectorLev

  • _detectorLevel의 값을 반환합니다

get maxFwdCount

  • 금지어 최대 감지량을 반환합니다
  • 3 이상의 값이면 _maxForbiddenWordCount를 반환합니다
  • 범위 외 값이면 null를 반환합니다

get maxRptCount

  • 반복 채팅 최대 감지량을 반환합니다
  • 3 이상의 값이면 _maxRepeatedCount를 반환합니다
  • 범위 외 값이면 null를 반환합니다

set isFreezeChat

set isFreezeChat(bool: Bool)

  • 채팅을 얼리거나 녹입니다
  • _isFreezeChat의 값을 수정합니다

set isLockPrvChat

set isLockPrvChat(bool: Bool)

  • 개인 채팅을 금지하거나 해제합니다
  • _isLockPrivateChat의 값을 수정합니다

set maxFwdCount

set maxFwdCount(limit: Int)

  • 금지어 최대 감지량을 변경합니다
  • _maxForbiddenWordCount의 값을 수정합니다

set maxRptCount

set maxRptCount(limit: Int)

  • 반복 채팅 최대 감지량을 변경합니다
  • _maxRepeatedCount의 값을 수정합니다

set detectorLev

set detectorLev(targetLev: Int)

  • 채팅 필터링 엄격도를 변경합니다
  • _detectorLevel의 값을 수정합니다

initPlayerList

initPlayerList(player: Int)

  • 플레이어의 데이터베이스를 초기화 합니다
  • ChatSystem 클래스를 호출합니다

isWhiteSpace

isWhiteSpace(str: String)

  • 문자열의 공백 여부를 판정합니다

hasForbiddenWord

hasForbiddenWord(msg: String)

  • 금지어 감지 여부를 반환합니다
  • 단어가 공백이면 처리하지 않습니다
  • 우회 문자를 제외한 상태를 기준으로 처리합니다

hasMutedChat

hasMutedChat(player: Int)

  • 플레이어의 채팅 금지 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 findPlayerById()를 호출합니다

hasRepeatedChat

hasRepeatedChat(player: Int)

  • 플레이어의 반복 채팅 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 findPlayerById()를 호출합니다

findPlayerById

findPlayerById(target: Int)

  • 특정 공용 ID를 가진 플레이어의 데이터베이스를 반환합니다

updateChatLog

updateChatLog(player, msg, time)

  • 플레이어의 채팅 로그를 갱신합니다
  • 플레이어의 데이터베이스를 구하기 위해 findPlayerById()를 호출합니다

showHelpCommandList

showHelpCommandList(title: String, cml: Array<String>, player: Int)

  • 명령어 목록을 메시지로 출력합니다
  • 권한 요구에 따라 명령어를 서로 다른 행으로 분류합니다

freezeChat

freezeChat(time: Int, player: Int)

  • 채팅을 얼립니다
  • _isFreezeChat의 값을 수정합니다
  • time ≥ 5를 만족하는 경우 time초 경과 직후 채팅을 녹이는 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

lockPrivateChat

lockPrivateChat(bool: Bool, player: Int)

  • 개인 채팅을 금지하거나 허용합니다
  • _isLockPrivateChat의 값을 수정합니다

sendAlert

sendAlert(msg: String, target: Int, ...replace: Array<String>)

  • 관리자 채팅을 전송합니다
  • 호스트가 존재하면 room.sendChat()를 호출합니다
  • 호스트가 존재하지 않으면 Notification 클래스의 announce()를 호출합니다

sendAllChat

sendAllChat(player: Int, msg: String)

  • 전체 채팅을 전송합니다
  • 금지어 감지를 위해 hasForbiddenWord()를 호출합니다
  • 채팅 필터링 엄격도에 따라
    • 4단계에서는 내용을 숨긴 채 전송합니다
    • 5단계에서는 내용을 숨긴 채 전송합니다
  • sendMsg()를 호출합니다
  • 금지어가 감지된 경우 Notification 클래스의 alretMsg()를 호출합니다

sendEmojiChat

sendEmojiChat(player: Int, msg: String)

  • 감정 채팅을 전송합니다
  • 내용을 등번호에 출력하기 위해 PlayerManager 클래스의 giveAvatar()를 호출합니다

sendMsg

sendMsg(msg: String, target: Int, ...replace: Array<String>)

  • 일반 메시지를 출력합니다
  • Notification 클래스의 announce()를 호출합니다

sendPrivateChat

sendPrivateChat(toPlayer: Int, fromPlayer: Int, msg: String)

  • 개인 채팅을 전송합니다
  • 외부에서 불러온 경우 sendAlert()를 호출합니다
  • 채팅 필터링 엄격도에 따라
    • 4단계에서는 내용을 숨긴 채 전송합니다
    • 5단계에서는 내용을 숨긴 채 전송합니다
  • 금지어 감지를 위해 hasForbiddenWord()를 호출합니다

sendTeamChat

sendTeamChat(teamId: TeamID, player: Int, msg: String)

  • 팀 채팅을 전송합니다
  • 금지어 감지를 위해 hasForbiddenWord()를 호출합니다
  • 채팅 필터링 엄격도에 따라
    • 4단계에서는 내용을 숨긴 채 전송합니다
    • 5단계에서는 내용을 숨긴 채 전송합니다
  • 금지어가 감지된 경우 Notification 클래스의 alretMsg()를 호출합니다

unfreezeChat

unfreezeChat(player: Int)

  • 채팅을 녹입니다
  • _isFreezeChat의 값을 수정합니다
  • freeze 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다

class ChatSystem

  • 채팅 시스템을 처리합니다

constructor

constructor(id: Int)

  • _id: Int: 플레이어의 공용 ID를 저장합니다
  • _str: String: 입력된 문자열을 저장합니다
  • _timeList: Array<Int>: 입력 시간을 저장합니다
  • _time: Int: 마지막으로 입력한 시간을 저장합니다
  • _repeatedCount: Int: 반복 채팅 누적 감지량을 저장합니다
  • _forbiddenWordCount: Int: 금지어 누적 감지량을 저장합니다

get cntFwd

  • _forbiddenWordCount의 값을 반환합니다

get cntRpt

  • _repeatedCount의 값을 반환합니다

set cntFwd

set cntFwd(v: Int)

  • 금지어 누적 감지량을 변경합니다
  • _forbiddenWordCount의 값을 수정합니다

set cntRpt

set cntRpt(v: Int)

  • 반복 채팅 감지량을 변경합니다
  • _repeatedCount의 값을 수정합니다

hasMutedChat

hasMutedChat(void)

  • 플레이어의 채팅 금지 여부를 반환합니다
  • Administration 클래스의 isMute()를 호출합니다

hasRepeatedChat

hasRepeatedChat(void)

  • 반복 채팅 여부를 반환합니다
  • 반복 채팅 감지량이 미설정 돼 있는 경우 구문을 종료하고 false의 값으로 반환합니다
  • 채팅 필터링이 비활성화 돼 있는 경우 구문을 종료하고 false의 값으로 반환합니다
  • 금지어 분산 입력을 감지합니다
  • 채팅 로그 데이터가 충분하지 않으면 구문을 종료하고 false의 값으로 반환합니다
  • 우회 문자를 제외한 상태를 기준으로 처리합니다
  • 내용과 무관하게 짧은 시간내 연속적인 채팅 입력이 감지되면 반복 채팅으로 간주합니다
  • 채팅 필터링 엄격도에 따라
    • 1단계에서는 별도로 처리하지 않습니다
    • 2단계에서는 감지 메시지를 출력합니다
    • 3단계에서는 깅제 퇴장합니다
    • 4단계에서는 감지 메시지를 출력하고 채팅을 15초간 금지합니다
    • 5단계에서는 채팅을 30초간 금지하고 강제 퇴장합니다
    • 블랙리스트에서는 한 단계 더 엄격하게 처리합니다

updateChatLog

updateChatLog(msg: String, time: Int)

  • 플레이어의 채팅 로그를 갱신합니다
  • 일정 수준 이상의 기록이 쌓여 있으면 가장 오래된 기록부터 삭제하고 새로운 기록을 추가합니다

class Commands

  • 명령어의 기능 수행을 처리합니다

constructor

constructor(maxMsgLength: Int)

  • _maxStringLength: Int: 채팅 글자 제한 수를 저장합니다

get maxMsgLen

  • _maxStringLength의 값을 반환합니다

set maxMsgLen

set maxMsgLen(n: Int)

  • 채팅 글자 제한 수를 변경합니다
  • 15~255 범위 외 값이면 구문을 종료합니다
  • _maxStringLength의 값을 수정합니다

alertSpam

alertSpam(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 도배 방지 문자를 출력합니다
  • type의 값이 1인 경우
    • 권한이 있는 경우 명령어 사용법을 전송합니다
    • 권한이 없는 경우 helpCom()를 호출합니다

comUpdateUniform

comUpdateUniform(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 팀 유니폼을 변경합니다
    • PlayerManager 클래스의 updateUniform()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comAdminList

comAdminList(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 관리자 명단을 조회합니다
    • Administration 클래스의 showAdminList()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comAllChat

comAllChat(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 전체 채팅을 전송합니다
    • ChatManager 클래스의 sendAllChat()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comPrivateChat

comPrivateChat(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 개인 채팅을 전송합니다
    • ChatManager 클래스의 sendPrivateChat()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comTeamChat

comTeamChat(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 팀 채팅을 전송합니다
    • ChatManager 클래스의 sendTeamChat()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comAfk

comAfk(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 장기 무응답 플레이어 명단에 추가하거나 제외합니다
    • PlayerManager 클래스의 enableSleepMode()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comAllowJoin

comAllowJoin(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 팀 자율 교체를 허용하거나 금지합니다
    • _isAllowTeamSwitch의 값을 수정합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comAvatar

comAvatar(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 플레이어의 등번호를 변경합니다
    • PlayerManager 클래스의 giveAvatar()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comChatMode

comChatMode(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 플레이어의 기본 채팅 모드를 변경합니다
    • 데이터베이스 갱신을 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comClearBans

comClearBans(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 영구 퇴장 명단을 모두 지웁니다
    • 권한이 있는 경우 Administration 클래스의 clearBans()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comClearPassword

comClearPassword(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 비밀번호를 해제합니다
    • 권한이 있는 경우 Administration 클래스의 clearPassword()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comClearUniform

comClearUniform(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 팀 유니폼을 원래대로 돌립니다
    • PlayerManager 클래스의 clearUniform()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comFreezeChat

comFreezeChat(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 채팅을 얼리거나 녹입니다
    • 권한이 있는 경우 ChatManager 클래스의 freezeChat()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comJoin

comJoin(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 플레이어를 경기에 투입하거나 팀을 교체합니다
    • joinPlayer()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comKick

comKick(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 특정 플레이어를 강제 퇴장합니다
    • 권한이 없는 경우 구문을 종료합니다
    • #ID를 판별하기 위해 GameManager 클래스의 checkPublicId()를 호출합니다
    • 지목 대상이 이미 퇴장한 경우 구문을 종료합니다
    • 지목 대상보다 권한이 낮은 경우 구문을 종료합니다
    • 모든 구문이 온전하게 진행되었으면 Administration 클래스의 kickPlayer()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comLockPrivateChat

comLockPrivateChat(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 개인 채팅을 금지하거나 허용합니다
    • 권한이 있는 경우 ChatManager 클래스의 lockPrivateChat()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comMute

comMute(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 특정 플레이어의 채팅을 금지합니다
    • 권한이 있는 경우 Administration 클래스의 mutePlayer()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comMutedList

comMutedList(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 채팅 금지 명단을 조회합니다
    • PlayerManager 클래스의 showMutedList()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comPinHost

comPinHost(player: Int, msg: String, type: Int)

  • 호스트가 비활성화 돼 있는 경우 구문을 종료합니다
  • type의 값이 0인 경우
    • 호스트의 팀 이동을 허용하거나 제한합니다
    • 권한이 있는 경우 Administration 클래스의 enablePinHost()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comRecaptcha

comRecaptcha(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • reCAPTCHA를 활성화 하거나 비활성화 합니다
    • 권한이 있는 경우 GameSystem 클래스의 enableRecaptcha()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comRecording

comRecording(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 녹화를 시작하거나 종료합니다
    • 최고 권한이 있는 경우 GameManager 클래스의 stopRecording() 또는 startRecording()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comResetAvatar

comResetAvatar(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 플레이어의 등번호를 원래대로 돌립니다
    • PlayerManager 클래스의 resetAvatar()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comResetGame

comResetGame(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 경기를 재시작합니다
    • 권한이 있는 경우 Administration 클래스의 resetGame()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comSetPassword

comSetPassword(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 비밀번호를 지정합니다
    • 권한이 없는 경우 구문을 종료합니다
    • 비밀번호 고정 장치가 활성화 돼 있는 경우 구문을 종료합니다
    • 4~30 범위 외 값이면 구문을 종료합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comSetScore

comSetScore(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 다음 경기의 제한 점수를 변경합니다
    • 권한이 있는 경우 Administration 클래스의 limitScore()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comSetTime

comSetTime(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 다음 경기의 제한 시간을 변경합니다
    • 권한이 있는 경우 Administration 클래스의 limitTime()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comShowPassword

comShowPassword(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 현재 설정된 비밀번호를 조회합니다
    • 권한이 있는 경우 Administration 클래스의 showPassword()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comSleepList

comSleepList(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 장기 대기열 명단을 조회합니다
    • PlayerManager 클래스의 showSleepList()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comSwapGame

comSwapGame(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 경기를 시작하거나 종료합니다
    • 권한이 있는 경우 Administration 클래스의 swapGame()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comUnfreezeChat

comUnfreezeChat(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 채팅을 녹입니다
    • 권한이 있는 경우 ChatManager 클래스의 unfreezeChat()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

comUnmute

comUnmute(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 금지된 플레이어의 채팅을 허용합니다
    • 권한이 없는 경우 구문을 종료합니다
    • msg의 값이 "all"인 경우 Administration 클래스의 clearMutedList()를 호출하고 구문을 종료합니다
    • 모든 구문이 온전하게 진행되었으면 Administration 클래스의 unmutePlayer()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

helpBot

helpBot(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 서버 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpChat

helpChat(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 채팅 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpCom

helpCom(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 명령어 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpJoin

helpJoin(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 참가 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpMap

helpMap(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 경기장 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpMisc

helpMisc(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 기타 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpRank

helpRank(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 랭크 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

helpScore

helpScore(player: Int, msg: String, type: Int)

  • type의 값이 0 이외의 값이면 구문을 종료합니다
  • 점수 도움말을 전송합니다
  • ChatManager 클래스의 showHelpCommandList()를 전송합니다

infoLink

infoLink(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 서버 주소를 메시지로 전송합니다
  • type의 값이 1인 경우
    • infoRoom()를 호출합니다

infoMaps

infoMaps(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 경기장 데이터베이스를 조회합니다
    • GameManager 클래스의 findStadiumNameList()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

infoRanking

infoRanking(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 플레이어의 랭킹 정보를 메시지로 전송합니다
    • #ID를 판별하기 위해 GameManager 클래스의 checkPublicId()를 호출합니다
    • 플레이어의 전적 데이터베이스를 구하기 위해 ScoreManager 클래스의 findRankListByGrade()를 호출합니다
    • ScoreManager 클래스의 sendRanking()를 호출합니다
  • type의 값이 1인 경우
    • 랭킹 측정 방식을 메시지로 전송합니다

infoRoom

infoRoom(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 서버 정보를 메시지로 전송합니다
    • GameSystem 클래스의 _releaseDatefindInfo()를 호출합니다
  • type의 값이 1인 경우
    • infoLink()를 호출합니다

infoStats

infoStats(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 플레이어의 점수 정보를 메시지로 전송합니다
    • 플레이어의 전적 데이터베이스를 구하기 위해 ScoreManager 클래스의 findRankListByPlayer()를 호출합니다
  • type의 값이 1인 경우
    • helpScore()를 호출합니다

joinPlayer

joinPlayer(player: Int, msg: String)

  • 플레이어의 팀을 교체합니다
  • 팀 자율 교체가 금지된 경우 구문을 종료합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • #ID를 판별하기 위해 GameManager 클래스의 checkPublicId()를 호출합니다
  • 입력한 문자열에 따라 comAllowJoin()를 호출합니다
  • 지목 대상이 장기 대기열 명단에 포함된 경우 구문을 종료합니다
  • 모든 구문이 온전하게 진행되었으면 PlayerManager 클래스의 moveTeam()를 호출합니다

loadMap

loadMap(player: Int, msg: String, type: Int)

  • type의 값이 0인 경우
    • 데이터베이스 내에서 경기장을 교체합니다
    • 권한이 있는 경우 GameManager 클래스의 loadMap()를 호출합니다
  • type의 값이 1인 경우
    • 명령어 사용법을 전송합니다

class PlayerManager

  • 플레이어의 데이터베이스를 전반적으로 제어합니다

constructor

  • _playerList: Array<PlayerSystem>: 플레이어의 데이터베이스를 저장합니다

onPlayerActivity

onPlayerActivity(player: PlayerObject)

  • 플레이어의 키 입력이 감지되면 호출합니다
  • 활동 시간을 갱신하기 위해 updateTime()를 호출합니다
  • 선두하고 있는 경우 데이터베이스 추가를 위해 ScoreManager 클래스의 addTouchedList()를 호출합니다

onPlayerInactivity

onPlayerInactivity(player: Int)

  • 플레이어의 응답이 없는 경우 호출합니다
  • afk 타이머가 이 메서드를 호출합니다
  • 데모 모드가 활성화 돼 있는 경우 구문을 종료합니다
  • 모든 구문이 온전하게 진행되었으면 Administration 클래스의 kickPlayer()를 호출합니다

onPlayerTeamChange

onPlayerTeamChange(player: PlayerObject, byPlayer: PlayerObject)

  • 플레이어의 팀이 변경되면 호출합니다
  • 호스트 팀 이동이 제한돼 있고 대상이 호스트이면 구문을 종료합니다
  • 장기 대기열 명단에 포함된 경우 관전석으로 이동합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 clearListIndex()addListIndex()를 호출합니다
  • goal 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다
  • 활동 시간을 갱신하기 위해 PlayerManager 클래스의 updateTime()를 호출합니다
  • GUI 갱신을 위해 GameSystem 클래스의 updateWebGUI()를 호출합니다

initPlayerList

initPlayerList(player: PlayerObject)

  • 플레이어의 데이터베이스를 초기화 합니다
  • 전적 데이터베이스 초기화를 위해 ScoreManager 클래스의 initRankList()를 호출합니다
  • 채팅 데이터베이스 초기화를 위해 ChatManager 클래스의 initPlayerList()를 호출합니다
  • PlayerSystem 클래스를 호출하고 _playerList에 데이터베이스를 추가합니다

isAfkPlayer

isAfkPlayer(player: Int, time: Int)

  • 플레이어의 장기 무응답 여부를 반환합니다

isValid

isValid(target: PlayerObject || PlayerSystem, includeHost: Bool)

  • 유효 플레이어 데이터베이스 여부를 반환합니다

hasCommonRange

hasCommonRange(player: Int, ball: Int, range: Float)

  • 플레이어와 공 사이의 충돌 여부를 반환합니다

findDiscProp

findDiscProp(target: Int)

  • 플레이어의 디스크 속성을 반환합니다

findLocalId

findLocalId(publicId: Int)

  • 플레이어의 개인 ID를 반환합니다

findPlayerList

findPlayerList(isPublic: Bool)

  • 플레이어 데이터베이스 명단을 isPublic의 값에 따라 접속자 혹은 모든 기록을 반환합니다

findPlayerListByTeam

findPlayerListByTeam(team: TeamID)

  • 특정 팀 ID를 가진 플레이어 데이터베이스 명단을 반환합니다

findPlayerById

findPlayerById(target: Int)

  • 특정 공용 ID를 가진 플레이어의 데이터베이스를 반환합니다

findTagGrade

findTagGrade(player: Int)

  • 플레이어의 권한 마크를 반환합니다

findTagTeam

findTagTeam(team: TeamID)

  • 플레이어의 팀 마크를 반환합니다

addSleepPlayer

addSleepPlayer(player: Int)

  • 플레이어를 장기 대기열 명단에 추가합니다

updateAccount

updateAccount(player: Int)

  • 플레이어의 계정을 갱신합니다
  • 중복 계정이 존재하지 않는 경우 구문을 종료하고 false의 값을 반환합니다
	for(const [k, v] of Object.entries(oldPlayer)){
		if(!["id", "name", "team", "admin", "time", "network", "address",
			"isSleep", "detector"
		].includes(k.replace('_', ''))) newPlayer[k] = v;
	}
  • 일부 항목을 제외한 모든 데이터베이스를 신규 계정에 동기화 합니다
  • 이전 데이터베이스에서 최고 권한이 있고 접속자 중에 관리자가 없는 경우 권한을 부여합니다
  • 전적 데이터베이스의 갱신을 위해 ScoreManager 클래스의 updateAccount()를 호출합니다
  • 모든 구문이 온전하게 진행되었으면 true의 값으로 반환합니다

updateTime

updateTime(player: Int)

  • 플레이어의 응답 시간을 갱신합니다
  • afkTimer, afkAvatar, afkCheck 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다
  • 장기 무응답 판정 시간이 유효하지 않는 경우 구문을 종료합니다
  • 판정 메시지를 전송하는 afkCheck 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다
    • 등번호 알림을 출력하는 afkAvatar 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다
  • 강제 퇴장을 처리하는 afkTimer 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

updateUniform

updateUniform(team: TeamID, angle: Int, textColor: Int, bgColor: Array<Int>)

  • 팀 유니폼을 지정합니다

clearPlayerById

clearPlayerById(player: Int)

  • 플레이어의 데이터베이스를 지웁니다

clearUniform

clearUniform(team: TeamID)

  • 팀 유니폼을 원래대로 돌립니다

deleteSleepPlayer

deleteSleepPlayer(player: Int)

  • 플레이어를 장기 대기열 명단에서 제거합니다

resetAvatar

resetAvatar(player: Int)

  • 플레이어의 등번호를 원래대로 돌립니다

showMutedList

showMutedList(player: Int, isPublic: Bool)

  • 채팅 금지 명단을 메시지로 출력합니다
  • Administration 클래스의 findMutedList()를 호출합니다

showSleepList

showSleepList(player: Int, isPublic: Bool)

  • 장기 대기열 명단을 메시지로 출력합니다

cntPlayers

cntPlayers(team: TeamID || String)

  • 접속자 인원을 반환합니다
  • team == "public"을 만족하는 경우 _playerList를 반환합니다

enableSleepMode

enableSleepMode(player: Int, bool: Bool)

  • 플레이어를 장기 무응답 명단에 추가하거나 제외합니다
  • addSleepPlayer()deleteSleepPlayer()를 호출합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다
  • 권한 갱신을 위해 Administration 클래스의 updateAdmins()를 호출합니다

giveAvatar

giveAvatar(player: Int, msg: String)

  • 플레이어의 등번호를 변경합니다

moveTeam

moveTeam(player: Int, team: TeamID)

  • 플레이어의 팀을 교체합니다

class PlayerSystem

  • 플레이어의 데이터베이스를 처리합니다

constructor

constructor(id: Int, name: String, team: TeamID, admin: Bool, conn: PlayerObject.conn, auth: PlayerObject.auth)

  • _id: Int: 플레이어의 공용 ID를 저장합니다
  • _name: String: 플레이어의 이름을 저장합니다
  • _address: PlayerObject.conn: 플레이어의 공용 주소를 저장합니다
  • _network: PlayerObject.auth: 플레이어의 공용 네트워크를 저장합니다
  • _team: TeamID: 플레이어의 팀 ID를 저장합니다
  • _admin: Int: 플레이어의 권한을 저장합니다
  • _time: Int: 플레이어의 마지막 응답 시간을 저장합니다
  • _chatmode: Int: 플레이어의 기본 채팅 모드를 저장합니다
  • _detector: Int: 플레이어의 금지어 감지량을 저장합니다
  • _uniqueAvatar: String: 플레이어의 초기 등번호를 저장합니다
  • _isMute: Bool: 플레이어의 채팅 금지 여부를 저장합니다
  • _isSleep: Bool: 플레이어의 장기 무응답 여부를 저장합니다
  • _hasKicked: Bool: 플레이어의 강제 퇴장 여부를 저장합니다

get chatmode

  • _chatmode의 값을 반환합니다

get discProp

  • room.getPlayerDiscProperties()의 값을 반환합니다

get dpPosition

  • 플레이어의 좌표를 반환합니다

get dpGravityVector

  • 플레이어의 중력 벡터를 반환합니다

get dpSpeedVector

  • 플레이어의 속도 벡터를 반환합니다

get localId

  • 플레이어의 개인 ID를 반환합니다

get unqAvtr

  • _uniqueAvatar의 값을 반환합니다

set chatmode

set chatmode(value: Int)

  • 플레이어의 채팅 모드를 변경합니다
  • _chatmode의 값을 수정합니다

set discProp

set discProp(value: DiscPropertiesObject)

  • 플레이어의 디스크 속성을 수정합니다
  • room.setPlayerDiscProperties()를 호출합니다

set unqAvtr

set unqAvtr(value: String)

  • 플레이어의 개인 등번호를 지정합니다
  • _uniqueAvatar의 값을 수정합니다
  • 등번호 초기화를 위해 resetAvatar()를 호출합니다

isAfk

isAfk(time: Int)

  • 플레이어의 장기 무응답 여부를 반환합니다
	let limit = SYS.hasInRange(time, 5, 60 * 60 * 3) ? time : GM.afkTime;
  • 5 < limit < 10800 범위 외 값이면 구문을 종료하고 false의 값을 반환합니다
  • 미접속자인 경우 구문을 종료하고 false의 값을 반환합니다
  • 경기 도중 관전인 경우 false의 값을 반환합니다
  • 경기 미진행 상태에서 관리자가 아닌 경우 false의 값을 반환합니다
  • 장기 대기열 명단에 포함된 경우 false의 값을 반환합니다
  • 모든 구문이 온전하게 진행되었으면 true의 값을 반환합니다

hasCommonRange

hasCommonRange(ball: Int, range: Float)

  • 플레이어와 공 사이의 충돌 여부를 반환합니다
  • 디스크 속성을 구하기 위해 ScoreManager 클래스의 findDiscProp()를 호출합니다
  • 거리를 계산하기 위해 ScoreManager 클래스의 calcDistance()를 호출합니다

addSleepList

addSleepList(void)

  • 플레이어를 장기 대기열 명단에 추가합니다
  • _isSleep의 값을 수정합니다
  • 관전석으로 팀을 교체합니다
  • 최고 권한을 가지고 있으면 보조 권한을 부여합니다

clearPlayer

clearPlayer(void)

  • 플레이어의 데이터베이스를 지웁니다
  • GUI에 명단을 삭제하기 위해 GameSystem 클래스의 clearListIndex()를 호출합니다
  • 선두자 데이터베이스를 지우기 위해 ScoreManager 클래스의 clearTouchedListByPlayer()를 호출합니다
  • 플레이어 소유의 모든 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByPlayer()를 호출합니다
  • _team의 값을 c_TEAM.SPECTATOR으로 갱신합니다
  • _time의 값을 현재 시간으로 갱신합니다
  • _chatmode의 값을 0으로 갱신합니다
  • _isSleep의 값을 false로 갱신합니다
  • 강제 퇴장된 경우에 한해 _admin_hasKicked의 값을 수정합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다

deleteAdmin

deleteAdmin(isSub: Bool)

  • 플레이어의 권한을 해제합니다
  • 최고 권한에서 완전히 권한을 해제하거나 보조 권한을 해제하는 경우
    • _admin의 값을 0으로 수정합니다
    • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다

deleteSleepPlayer

deleteSleepPlayer(void)

  • 플레이어를 장기 대기열 명단에서 제거합니다
  • _isSleep의 값을 수정합니다
  • 권한 갱신을 위해 Administration 클래스의 updateAdmins()를 호출합니다

resetAvatar

resetAvatar(void)

  • 플레이어의 등번호를 개인 등번호로 되돌립니다
  • giveAvatar()를 호출합니다

showPlayerInfo

showPlayerInfo(type: Int)

  • 플레이어의 정보를 반환합니다
  • type == c_PLAYERINFO_TYPE.LOCAL를 만족하는 경우
    • 플레이어의 개인 ID와 이름을 반환합니다
  • type == c_PLAYERINFO_TYPE.PUBLIC를 만족하는 경우
    • 플레이어의 공용 ID와 이름을 반환합니다
  • type == c_PLAYERINFO_TYPE.NAME를 만족하는 경우
    • 플레이어의 이름을 반환합니다
  • 이름이 비어 있으면 공백으로 표시합니다

adjustGravityVector

adjustGravityVector(x: Float, y: Float)

  • 플레이어의 중력 벡터를 변경합니다
  • discProp를 호출합니다

adjustSpeedVector

adjustSpeedVector(x: Float, y: Float)

  • 플레이어의 속도 벡터를 변경합니다
  • discProp를 호출합니다

giveAdmin

giveAdmin(isSub: Bool)

  • 플레이어의 권한을 부여합니다
  • 블랙리스트에 포함되는 경우 최고 권한을 부여하지 않습니다
  • Administration 클래스의 maxAdmin의 값이 최고 관리자 인원보다 적은 경우 최고 권한을 부여하지 않고 구문을 종료합니다
  • Administration 클래스의 maxAdmin * 2의 값이 보조 관리자 인원보다 적은 경우 보조 권한을 부여하지 않고 구문을 종료합니다
  • 모든 구문이 온전하게 진행되었으면 GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다

giveAvatar

giveAvatar(str: String)

  • 플레이어의 등번호를 변경합니다
  • room.setPlayerAvatar()를 호출합니다

movePosition

movePosition(dx: Float, dy: Float)

  • 플레이어를 현재 위치 기준에서 지정 좌표로 이동합니다
  • discProp를 호출합니다

moveTeam

moveTeam(t: TeamID)

  • 플레이어의 팀을 교체합니다
  • room.setPlayerTeam()를 호출합니다

teleportPosition

teleportPosition(tx: Float, ty: Float)

  • 플레이어를 지정 위치로 좌표를 변경합니다
  • discProp를 호출합니다

class ScoreManager

  • 점수 및 랭킹 데이터베이스를 전반적으로 제어합니다

constructor

constructor(collisionSensitivity: Float)

  • _collisionRange: Float: 충돌 범위 민감도를 저장합니다
  • _totalGoals: Array: 팀 누적 골을 저장합니다
  • _touchedList: Array<TouchedPlayer>: 선두자 데이터베이스를 저장합니다
  • _rankList: Array<StatusSystem>: 전적 데이터베이스를 저장합니다

onPlayerTeamChange

onPlayerTeamChange(player: PlayerObject, byPlayer: PlayerObject)

  • 플레이어의 팀이 변경되면 호출합니다
  • 일정 수준 이상의 선두자 데이터베이스가 있으면 clearTouchedListByPlayer()를 호출합니다

onPositionsReset

onPositionsReset(void)

  • 골 판정 직후 포지션이 초기화되면 호출합니다
  • 선두자 데이터베이스를 모두 지우기 위해 clearTouchedList()를 호출합니다

initRankList

initRankList(player: Int)

  • 전적 데이터베이스를 초기화 합니다
  • StatusSystem 클래스를 호출하고 _rankList에 데이터베이스를 추가합니다

initTouchedList

initTouchedList(player: Int)

  • 선두자 데이터베이스를 초기화 합니다
  • TouchedPlayer 클래스를 호출하고 _touchedList에 데이터베이스를 추가합니다

get collRange

  • _collisionRange의 값을 반환합니다

get gameTime

  • scores.time의 값을 반환합니다

get lastTouchedPlayer

  • 최근 선두자의 데이터베이스를 반환합니다
  • 적절한 값이 없는 경우 null를 반환합니다

get limitScore

  • scores.scoreLimit를 반환합니다
  • 적절한 값이 없는 경우 0을 반환합니다

get limitTime

  • scores.timeLimit를 반환합니다
  • 적절한 값이 없는 경우 0을 반환합니다

get scores

  • room.getScores()의 값을 반환합니다

get totalRedGoals

  • _totalGoals[c_TEAM.RED]의 값을 반환합니다

get totalBlueGoals

  • _totalGoals[c_TEAM.BLUE]의 값을 반환합니다

set collRange

set collRange(v: Float)

  • 충돌 범위 민감도를 변경합니다
  • 1~16 범위 외 값이면 구문을 종료합니다
  • _collisionRange의 값을 수정합니다

set totalRedGoals

set totalRedGoals(v: Int)

  • 레드팀 누적 골을 변경합니다
  • _totalGoals[c_TEAM.RED]의 값을 수정합니다

set totalBlueGoals

set totalBlueGoals(v: Int)

  • 블루팀 누적 골을 변경합니다
  • _totalGoals[c_TEAM.BLUE]의 값을 수정합니다

hasCommonRange

hasCommonRange(da: DiscPropertiesObject, db: DiscPropertiesObject, range: Float)

  • 디스크 간의 충돌 여부를 반환합니다
  • 거리를 계산하기 위해 calcDistance()를 호출합니다

findAssist

findAssist(target: Int)

  • 어시스트의 선두자 데이터베이스를 반환합니다
  • 팀 인원이 일정 수준 이상을 만족하지 않으면 구문을 종료합니다

findDiscProp

findDiscProp(target: Int)

  • 공의 디스크 속성을 반환합니다

findDiscColor

findDiscColor(target: Int)

  • 디스크 색상을 16진수로 반환합니다
  • 데이터베이스를 구하기 위해 findDiscProp()를 호출합니다
  • 부적절한 값이면 -1을 반환합니다

findRankListByPlayer

findRankListByPlayer(target: Int)

  • 특정 공용 ID를 가진 전적 데이터베이스를 반환합니다

findRankListByGrade

findRankListByGrade(grade: Int)

  • 특정 순위를 가진 전적 데이터베이스를 반환합니다

findTouchedListByPlayer

findTouchedListByPlayer(target: Int)

  • 특정 공용 ID를 가진 선두자의 데이터베이스를 반환합니다

findWinner

findWinner(scores: ScoresObject)

  • 두 팀 사이의 점수를 비교해 우위인 팀을 반환합니다
  • 점수가 동일하면 3의 값을 반환합니다

addTouchedList

addTouchedList(player: Int)

  • 선두자 데이터베이스를 추가합니다
  • 일정 수준 이상의 데이터베이스가 있으면 오래된 데이터베이스부터 지우기 위해 clearTouchedListByPlayer()를 호출합니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다
  • 선두자 데이터베이스를 주기적으로 갱신하는 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

updateAccount

updateAccount(op: Int, np: Int)

  • 플레이어의 전적 데이터베이스를 신규 계정에 동기화 합니다

updateGoals

updateGoals(team: TeamID)

  • 팀 득점 골을 갱신합니다
  • 경기를 진행하고 있지 않으면 구문을 종료합니다
  • 팀 유형에 따라 _totalGoals[c_TEAM.RED]_totalGoals[c_TEAM.BLUE]의 값을 수정합니다

updateTouchedList

updateTouchedList(target: Int)

  • 선두자 데이터베이스를 갱신합니다
  • 플레이어와 공 사이의 충돌 여부를 판정하기 위해 hasCommonRange()를 호출합니다
  • 중복된 데이터베이스가 없으면 addTouchedList()를 호출합니다

clearRankListByPlayer

clearRankListByPlayer(player: Int)

  • 플레이어의 전적 데이터베이스를 지웁니다

clearTouchedList

clearTouchedList(void)

  • 선두자 데이터베이스를 모두 지웁니다

clearTouchedListByPlayer

clearTouchedListByPlayer(player: Int)

  • 플레이어의 선두자 데이터베이스를 지웁니다
  • GUI에 명단을 갱신하기 위해 GameSystem 클래스의 updateListIndex()를 호출합니다

sendRanking

sendRanking(target: Int, player: Int)

  • 전적 데이터베이스를 메시지로 전송합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

calcDistance

calcDistance(a: DiscPropertiesObject, b: DiscPropertiesObject)

  • 두 객체 간의 물리적인 거리를 계산하여 반환합니다

calcGoalsByTeam

calcGoalsByTeam(team: TeamID)

  • 특정 팀의 경기 득점 골을 반환합니다

calcGravityVector

calcGravityVector(target: Int)

  • 플레이어의 중력 벡터를 반환합니다

calcPosition

calcPosition(target: Int)

  • 플레이어의 좌표를 반환합니다

calcSpeedVector

calcSpeedVector(target: Int)

  • 플레이어의 속도 벡터를 반환합니다

calcTotalGoalsByTeam

calcTotalGoalsByTeam(team: Int)

  • 특정 팀의 득점 누적 골을 반환합니다

class StatusSystem

  • 플레이어의 전적 데이터베이스를 처리합니다

constructor

constructor(id: Int)

  • _id: Int: 플레이어의 공용 ID를 저장합니다
  • _win: Int: 승리한 경기 수를 저장합니다
  • _lost: Int: 패배한 경기 수를 저장합니다
  • _goal: Int: 득점한 골 수를 저장합니다
  • _ownGoal: Int: 실점한 골 수를 저장합니다
  • _assist: Int: 도움 횟수를 저장합니다

get asst

  • _assist의 값을 반환합니다

get goal

  • _goal의 값을 반환합니다

get grade

  • 플레이어의 순위를 반환합니다

get lost

  • _lost의 값을 반환합니다

get owgl

  • _ownGoal의 값을 반환합니다

get scores

  • 플레이어의 총 점수를 반환합니다

get status

  • 플레이어의 기록 정보를 반환합니다

get about

  • 플레이어의 상세 기록 정보를 반환합니다

get records

  • 플레이어의 순위 정보를 반환합니다

get win

  • _win의 값을 반환합니다

get winPct

  • 플레이어의 승률을 반환합니다
  • 소수점 둘째 자리까지 반올림 합니다

set asst

set asst(v: Int)

  • 도움 횟수를 갱신합니다
  • _assist의 값을 수정합니다

set goal

set goal(v: Int)

  • 득점한 골 수를 갱신합니다
  • _goal의 값을 수정합니다

set lost

set lost(v: Int)

  • 패배 경기 수를 갱신합니다
  • _lost의 값을 수정합니다

set owgl

set owgl(v: Int)

  • 실점한 골 수를 갱신합니다
  • _ownGoal의 값을 수정합니다

set win

set win(v: Int)

  • 승리 경기 수를 갱신합니다
  • _win의 값을 수정합니다

clearPlayer

clearPlayer(void)

  • 플레이어의 전적 데이터베이스를 지웁니다

class TouchedPlayer

  • 플레이어의 선두 데이터베이스를 처리합니다

constructor

constructor(id: Int)

  • _id: Int: 플레이어의 공용 ID를 저장합니다
  • _team: Int: 플레이어의 소속 팀 ID를 저장합니다
  • _time: Int: 감지 시간을 저장합니다
  • _pos: Int: 감지 직후 좌표를 저장합니다
  • _disc: Int: 감지 직후 디스크 속성을 저장합니다

hasCommonRange

hasCommonRange(ball: Int, range: Float)

  • 플레이어와 공 사이의 충돌 여부를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

class TimeManager

  • 타이머 데이터베이스 및 시간 시스템을 전반적으로 처리합니다

constructor

constructor(timeFormats: Int)

  • _timeFormats: Int: 시간 출력 형식을 저장합니다
  • _timerList: Array<TimerSystem>: 타이머 데이터베이스를 저장힙니다

get fullDate

  • Date()의 값을 반환합니다

get time

  • fullDate.getTime()의 값을 반환합니다

get year

  • fullDate.getFullYear()의 값을 반환합니다

get month

  • fullDate.getMonth() + 1의 값을 반환합니다

get day

  • fullDate.getDate()의 값을 반환합니다

get hours

  • fullDate.getHours()의 값을 반환합니다

get minutes

  • fullDate.getMinutes()의 값을 반환합니다

get secs

  • fullDate.getSeconds()의 값을 반환합니다

get meridiem

  • 오후이면 2의 값을 반환합니다
  • 오전이면 1의 값을 반환합니다

get fmtTime

  • _timeFormats의 값을 반환합니다

set fmtTime

set fmtTime(index: Int)

  • 시간 출력 형식을 변경합니다
  • _timeFormats의 값을 수정합니다

findTimer

findTimer(findId: String)

  • 타이머 데이터베이스를 ID로 반환합니다
  • 유효하지 않는 경우 undefined의 값으로 반환합니다

findTimerByName

findTimerByName(name: String, player: Int)

  • 특정 이름의 타이머 데이터베이스를 반환합니다

findTimerByPlayer

findTimerByPlayer(target: Int)

  • 특정 플레이어의 타이머 데이터베이스를 반환합니다

findTimers

findTimers(target: timerSystem, hasTarget: Bool)

  • 비슷한 유형의 타이머 데이터베이스를 반환합니다

addTimer

addTimer(name: String, func, player: Int, delay: Int, isRepeat: Bool, runDirectly: Bool, seq: Int)

  • 타이머 데이터베이스를 추가합니다
  • 이름이 비어 있으면 구문을 종료합니다
  • TimerSystem 클래스를 호출하고 _timerList에 데이터베이스를 추가합니다
  • 반복 타이머로 설정한 경우
    • delay의 값이 부적절하거나 100 미만인 경우 로그를 별도로 출력하고 구문을 종료합니다
    • 100 ≤ delay < 1000를 만족하는 경우 타이머의 ID와 이름 그리고 타이머 간격을 포함한 로그를 별도로 출력합니다
  • 이미 처리한 타이머 데이터베이스는 삭제합니다
  • 모든 구문이 온전하게 진행되었으면 생성한 타이머의 데이터베이스를 반환합니다

clearTimer

clearTimer(findId: String, skipTrmnFn: Bool)

  • 타이머 데이터베이스를 삭제합니다

clearTimerByName

clearTimerByName(name: String, player: Int)

  • 특정 이름의 타이머 데이터베이스를 삭제합니다

clearTimerByPlayer

clearTimerByPlayer(player: Int)

  • 특정 플레이어의 타이머 데이터베이스를 삭제합니다

resetTimers

resetTimers(void)

  • 모든 타이머 데이터베이스를 삭제합니다

showCurrentTime

showCurrentTime(type: Int)

  • 시간 출력 형식에 따라 현재 시간을 반환합니다

showDate

showDate(void)

  • 현재 날짜 및 시간을 반환합니다

showNormalTime

showNormalTime(void)

  • 현재 시간을 간단하게 반환합니다

showTime

showTime(void)

  • 현재 시간을 상세하게 반환합니다

class TimerSystem

  • 타이머 데이터베이스를 제어합니다

constructor

constructor(name: String, id: String, exct: Function(), trmn: Function(), delay: Int, preId: String, target: Int, seq: Int)

  • _id: String: 타이머의 ID를 저장합니다
  • _name: String: 타이머의 이름을 저장합니다
  • _player: Int: 플레이어의 공용 ID를 저장합니다
  • _time: Int: 등록 시간을 저장합니다
  • _delay: Int: 지연 시간을 저장합니다
  • _exctFn: Function(): 실행 함수를 저장합니다
  • _trmnFn: Function(): 종료 함수를 저장합니다
  • _proc: setTimeout: 타이머 함수를 저장합니다
	let proc = setTimeout(() => {
		exct();
		if(isRepeat == false) TS.clearTimer(id);
	}, dt);
	...
	this._exctFn	= Object.freeze(exct);	// 실행 함수를 저장합니다
	...
	this._proc	= Object.freeze(proc);	// 타이머 함수를 저장합니다
  • 타이머가 호출되면 실행 함수를 처리하고 반복 여부에 따라 타이머를 삭제합니다
  • _sequence: Int: 진행 순서를 저장합니다
  • _isRepeat: Bool: 반복 여부를 저장합니다
	let overloaded = TS.findTimerByName(name, target).filter(t => t._isRepeat == false);
	if(overloaded.length > 0) overloaded.forEach(t => !t._id.includes('r'));
  • 이미 처리한 타이머 데이터베이스는 삭제합니다

findTimerByName

findTimerByName(void)

  • 특정 이름의 타이머 데이터베이스를 반환합니다
  • TimeManager 클래스의 findTimerByName()를 호출합니다

findTimerByPlayer

findTimerByPlayer(void)

  • 특정 플레이어의 타이머 데이터베이스를 반환합니다
  • TimeManager 클래스의 findTimerByPlayer()를 호출합니다

clearTimer

clearTimer(skipTrmnFn: Bool)

  • 타이머 데이터베이스를 삭제합니다
  • TimeManager 클래스의 _timerList를 호출합니다
  • skipTrmnFn의 값이 true인 경우 종료 함수를 실행하지 않습니다

clearTimerByName

clearTimerByName(void)

  • 특정 이름의 타이머 데이터베이스를 삭제합니다
  • TimeManager 클래스의 clearTimerByName()를 호출합니다

clearTimerByPlayer

clearTimerByPlayer(void)

  • 특정 플레이어의 타이머 데이터베이스를 삭제합니다
  • TimeManager 클래스의 clearTimerByPlayer()를 호출합니다

calcCurrentSequence

calcCurrentSequence(mx: Int, mn: Int)

  • 타이머의 현재 진행 순서를 반환합니다

calcTotalSequence

calcTotalSequence(seq: Int)

  • 타이머의 누적 진행 순서를 반환합니다

class GameSystem

  • 게임 내부 데이터베이스를 전반적으로 처리합니다

constructor

constructor(versionRoom: String, releaseDate: String, isDev: Bool, isDemo: Bool, lockPass: Bool)

  • _isDev: Bool: 개발자 버전 유무를 저장합니다
  • _isDemo: Bool: 데모 모드 유무를 저장합니다
  • _versionRoom: String: 서버 버전을 저장합니다
  • _releaseDate: String: 릴리스 일자를 저장합니다
  • _cssStyleList: Array<String>: CSS 스타일을 저장합니다
  • _hasInitServer: Bool: 서버 초기화 여부를 저장합니다
  • _hasInitWebGUI: Bool: GUI 초기화 여부를 저장합니다
  • _lockPass: Bool: 비밀번호 고정 여부를 저장합니다

onClickBtnSendLog

onClickBtnSendLog(void)

  • 로그 전송 버튼 클릭 이벤트를 처리합니다
  • 입력한 값이 있는 경우 printMsg()를 호출합니다
  • 로그 입력란의 내용을 비웁니다

onKeyDownSend

onKeyDownSend(e: KeyboardEvent)

  • 로그 입력란의 키 입력 이벤트를 처리합니다
  • enter 키 입력이 감지되면 onClickBtnSendLog()를 호출합니다

initAttributeColors

initAttributeColors(obj: HTMLElement, colBg: String, colText: String, str: String, isGradient: Bool, brd: String)

  • 속성 색상을 초기화 합니다

initAttributeId

initAttributeId(obj: HTMLElement, cssName: String, id: String)

  • 객체 ID를 초기화 합니다
  • CSS 클래스 초기화를 위해 initCssClass()를 호출합니다

initCssClass

initCssClass(elm: HTMLElement, str: String)

  • 객체의 CSS 클래스를 초기화 합니다
  • _cssStyleList에 일치하는 데이터베이스가 없으면 구문을 종료합니다

initElement

initElement(tag: String, id: String, cssName: String)

  • 요소를 초기화 합니다
  • 객체 ID 초기화를 위해 initAttributeId()를 호출합니다

initServer

initServer(url: String)

  • 서버를 초기화 합니다
  • 제한 점수와 제한 시간을 0점으로 지정합니다
  • 경기장 교체를 위해 GameManager 클래스의 loadMap()를 호출합니다
  • 개발자 모드가 활성화 돼 있는 경우 비밀번호 등록을 요구합니다
    • 시스템 비밀번호 갱신을 위해 Administration 클래스의 updatePassword()를 요구합니다
    • _lockPass의 값을 수정합니다
  • internalCommands 데이터베이스에서 AMN.logonAdmin에 대응하는 명령어를 찾을 수 없는 경우
    • 임의로 4자리 숫자로 이루어진 최고 권한 로그인 비밀번호를 설정하고 customCommands 데이터베이스에 추가합니다
  • 콘솔창에 서버 정보를 출력합니다
  • 슈퍼 블랙리스트 명단을 초기화 합니다
    • 아래와 같은 형식으로 명단을 작성할 수 있습니다.
	let bl = [
		...
		[true, "알파고"],
		[true, undefined, "12345678901234567890"]
		...
	]
  • 일반 블랙리스트 명단을 초기화 합니다
    • 아래와 같은 형식으로 명단을 작성할 수 있습니다.
	let bl = [
		...
		[false, "알파고"],
		[false, undefined, "12345678901234567890"]
		...
	]
  • 블랙리스트 데이터베이스 등록을 위해 Administration 클래스의 addBlacklist()를 호출합니다
  • 시스템 비밀번호가 설정돼 있고 개발자 모드가 활성화 돼 있으며, 비공개 방인 경우 reCAPTCHA 활성화를 위해 enableRecaptcha()를 호출합니다
  • 데모 모드가 활성화 돼 있는 경우 로그에 별도의 메시지를 전송합니다
  • _hasInitServer의 값을 수정합니다

initWebGUI

initWebGUI(void)

  • GUI를 초기화 합니다
  • 서버 초기화가 필요한 경우 구문을 종료합니다
  • _framebody의 값을 수정합니다
  • addWebElement(), initElement(), initAttributeColors()를 호출합니다
  • 서버 정보 UI를 생성합니다
    • 접거나 펼칠 수 있는 기능을 제공합니다
  • 인원 정보 UI를 생성합니다
  • 경기 정보 UI를 생성합니다
  • 좌석 정보 UI를 생성합니다
  • 로그 출력 UI를 생성합니다
    • 접거나 펼칠 수 있는 기능을 제공합니다
  • 로그 입력 UI를 생성합니다
  • UMUX 저작물 표기를 출력합니다
  • _hasInitWebGUI의 값을 수정합니다

hasInRange

hasInRange(num: Float, min: Float, max: Float)

  • 주어진 값이 특정 범위에 포함되는지 반환합니다

findInfo

findInfo(void)

  • UMUX 저작물 및 버전을 반환합니다
  • 이 기능은 임의로 수정하거나 삭제하지 마십시오

addEventInput

addEventInput(obj: HTMLElement, ev: Function())

  • 속성에 클릭 이벤트를 지정합니다

addListIndex

addListIndex(player: Int)

  • GUI에서 플레이어의 명단을 추가합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • GUI에서 명단을 갱신하기 위해 updateListIndex()를 호출합니다

addWebElement

addWebElement(pe: HTMLElement, ce: HTMLElement)

  • GUI에 자식 객체를 추가합니다

updateListIndex

updateListIndex(player: Int)

  • GUI에서 플레이어의 명단을 갱신합니다
  • 미접속자인 경우 명단을 삭제하기 위해 clearListIndex()를 호출하고 구문을 종료합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • updateNotification 타이머를 지우기 위해 TimeManager 클래스의 clearTimerByName()를 호출합니다
  • 명단 우측에 현재 상태를 간단히 알리는 아이콘을 표시합니다
    • 플레이어가 선두하고 있으면 을 추가합니다
    • 채팅이 금지돼 있으면 🥶을 추가합니다
    • 자리를 비우고 있는 경우 😴을 추가합니다
    • 플레이어의 권한 마크를 구하기 위해 PlayerManager 클래스의 findTagGrade()를 호출합니다
      • 이 아이콘은 항상 우측에 표시합니다
	let maxIcons = 5;
  • 최대 알림 개수는 maxIcons의 값에 따릅니다
  • 간단 알림을 갱신하는 updateNotification 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다

updateWebGUI

updateWebGUI(void)

  • GUI를 갱신합니다
  • 인원 정보 UI를 갱신합니다
  • 경기 정보 UI를 갱신합니다
    • 배경 색상을 변경하기 위해 initAttributeColors()를 호출합니다

clearListIndex

clearListIndex(player: Int)

  • GUI에서 플레이어의 명단을 삭제합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다
  • GUI에서 명단을 갱신하기 위해 updateListIndex()를 호출합니다

showPlayerInfo

showPlayerInfo(player: Int, type: Int)

  • 플레이어의 정보를 반환합니다
  • 플레이어의 데이터베이스를 구하기 위해 PlayerManager 클래스의 findPlayerById()를 호출합니다

enableDemo

enableDemo(bool: Bool)

  • 데모 모드를 활성화 하거나 비활성화 합니다
  • 모든 접속자에게 적용 메시지를 전송합니다
  • 콘솔창에 적용 메시지를 전송합니다
    • 중복 및 다중 접속 플레이어를 감지해도 대상을 강제 퇴장하지 않습니다
    • 비활동 플레이어를 감지해도 대상을 강제 퇴장하지 않습니다
  • _isDemo의 값을 수정합니다

enableRecaptcha

enableRecaptcha(isActive: Bool, player: Int)

  • reCAPTCHA를 활성화 하거나 비활성화 합니다
  • room.setRequireRecaptcha()를 호출합니다

fillLine

fillLine(amount: Int, line: Int)

  • 자릿수를 교정합니다

lockPassword

lockPassword(bool: Bool)

  • 시스템 비밀번호 고정 장치를 활성화 하거나 비활성화 합니다

log

log(io: Bool, msg: String, type: Int, ...replace: Array<String>)

  • 로그를 전달합니다
  • 빈 메시지는 전송하지 않습니다
  • 출력 시간을 구하기 위해 TimeManager 클래스의 showCurrentTime()를 호출합니다
  • outputLogMsg()를 호출합니다

outputLogMsg

outputLogMsg(msg: String, time: String, textColor: String, bgColor: String)

  • 로그를 출력합니다
  • 출력 시간을 구하기 위해 TimeManager 클래스의 showCurrentTime()를 호출합니다
  • GUI 갱신을 위해 updateWebGUI()를 호출합니다

printMsg

printMsg(msg: String, target: Int)

  • 서버 메시지를 전송합니다
  • 전송 메시지 출력을 위해 log()를 호출합니다
  • target의 값에 따라 ChatManager 클래스의 sendTeamChat() 또는 sendPrivateChat()를 전송합니다
  • 모든 구문이 온전하게 진행되었으면 ChatManager 클래스의 sendAlert()를 호출합니다

sendError

sendError(type: Int)

  • 오류 메시지와 로그를 출력합니다

명령어

  • 명령어 입력을 통해 특정 기능을 시스템에서 수행합니다
  • ChatManager 클래스의 onPlayerChat()가 명령어 입력을 감지하기 위해 이 데이터베이스를 호출합니다
  • GameManager 클래스의 runCommand()가 이 데이터베이스로부터 기능을 수행할 수 있도록 연결합니다
  • 명령어 추가는 아래와 같이 작성합니다
// 게임 채팅에서 `!1234`, '!!1234', '?1234' 중에 하나를 입력하면
// AMN.logonAdmin()를 실행합니다
["AMN.logonAdmin"] :	["1234"]


// 하나의 함수에 여러 개의 문자열을 대응할 수 있습니다
// 아래와 같은 경우 `1234`, `4321`, `1111`, `2222` 중에 하나를 골라서 `!` 및 `!!` 또는 `?`를 앞에 두면
// AMN.logonAdmin()를 실행합니다
["AMN.logonAdmin"] :	["1234", "4321", "1111", "2222"]

const internalCommands

  • UMUX 내부 시스템을 접근하는 명령어입니다.
  • 기존 명령어 삭제 및 신규 명령어 추가는 금지합니다.
  • 기존 명령어 접근을 막거나 주석 처리는 권장하지 않습니다.

const standardCommands

  • UMUX 표준 명령어입니다.
  • 기존 명령어 삭제 및 신규 명령어 추가는 권장하지 않습니다.
  • 기존 명령어 접근을 막거나 주석 처리는 권장하지 않습니다.

let customCommands

  • UMUX 커스텀 명령어입니다.
  • 신규 명령어 추가에 적합하며, 권장합니다.

이벤트

room.onGameStart

onGameStart(byPlayer: PlayerObject)

  • 경기가 시작되면 호출합니다
  • GameManager 클래스의 onGameStart()를 호출합니다

room.onGameTick

onGameTick(void)

  • 경기가 진행되는 동안 호출합니다
  • GameManager 클래스의 onGameTick()를 호출합니다

room.onGameStop

onGameStop(byPlayer: PlayerObject)

  • 경기가 종료되면 호출합니다
  • GameManager 클래스의 onGameStop()를 호출합니다

room.onGamePause

onGamePause(byPlayer: PlayerObject)

  • 경기가 중지되면 호출합니다
  • GameManager 클래스의 onGamePause()를 호출합니다

room.onGameUnpause

onGameUnpause(byPlayer: PlayerObject)

  • 경기가 재개되면 호출합니다
  • GameManager 클래스의 onGameUnpause()를 호출합니다

room.onKickRateLimitSet

onKickRateLimitSet(min: Int, rate: Int, burst: Int, player: PlayerObject)

  • 킥 제한이 설정되면 호출합니다
  • GameManager 클래스의 onKickRateLimitSet()를 호출합니다

room.onPlayerActivity

onPlayerActivity(player: PlayerObject)

  • 플레이어의 키 입력이 감지되면 호출합니다
  • 선두자 데이터베이스 갱신을 위해 PlayerManager 클래스의 onPlayerActivity()를 호출합니다

room.onPlayerAdminChange

onPlayerAdminChange(givenPlayer: PlayerObject, byPlayer: PlayerObject)

  • 플레이어의 권한이 변경되면 호출합니다
  • 권한 데이터베이스 갱신을 위해 Administration 클래스의 onPlayerAdminChange()를 호출합니다

room.onPlayerBallKick

onPlayerBallKick(player: PlayerObject)

  • 플레이어가 공을 차면 호출합니다
  • 선두자 데이터베이스 추가를 위해 GameManager 클래스의 onPlayerBallKick()를 호출합니다

room.onPlayerChat

onPlayerChat(player: PlayerObject, msg: String)

  • 플레이어가 채팅을 전송하면 호출합니다
  • 채팅 내용을 확인하기 위해 ChatSystem 클래스의 onPlayerChat()를 호출합니다
  • 명령어 입력 기록을 남기지 않기 위해 false의 값을 반환합니다

room.onPlayerJoin

onPlayerJoin(player: PlayerObject)

  • 신규 플레이어가 접속하면 호출합니다
  • 플레이어 데이터베이스 추가를 위해 GameManager 클래스의 onPlayerJoin()를 호출합니다

room.onPlayerLeave

onPlayerLeave(player: PlayerObject)

  • 접속자가 퇴장하면 호출합니다
  • 강제 퇴장 직후 이벤트를 제어하는 gm_onPlayerLeave 타이머를 생성하기 위해 TimeManager 클래스의 addTimer()를 호출합니다
    • 플레이어 데이터베이스 갱신을 위해 GameManager 클래스의 onPlayerLeave()를 호출합니다

room.onPlayerKicked

onPlayerKicked(kickedPlayer: PlayerObject, reason: String, ban: Bool, byPlayer: PlayerObject)

  • 접속자가 강제 퇴장되면 호출합니다
  • 플레이어 데이터베이스 갱신을 위해 Administration 클래스의 onPlayerKicked()를 호출합니다

room.onPlayerTeamChange

onPlayerTeamChange(player: PlayerObject, byPlayer: PlayerObject)

  • 플레이어의 팀이 변경되면 호출합니다
  • 플레이어 데이터베이스 갱신을 위해 PlayerManager 클래스의 onPlayerTeamChange()를 호출합니다
  • 선두자 데이터베이스 갱신을 위해 ScoreManager 클래스의 onPlayerTeamChange()를 호출합니다

room.onPositionsReset

onPositionsReset(void)

  • 골 판정 직후 포지션이 초기화되면 호출합니다
  • GameManager 클래스의 onPositionsReset()를 호출합니다

room.onStadiumChange

onStadiumChange(newMap: String, byPlayer: PlayerObject)

  • 경기장이 교체되면 호출합니다
  • 경기장 유효 확인을 위해 GameManager 클래스의 onStadiumChange()를 호출합니다

room.onRoomLink

onRoomLink(url: String)

  • 시스템에서 링크가 생성되면 호출합니다
  • GameManager 클래스의 onRoomLink()를 호출합니다

room.onTeamGoal

onTeamGoal(team: TeamID)

  • 골이 판정되면 호출합니다
  • GameManager 클래스의 onTeamGoal()를 호출합니다

room.onTeamVictory

onTeamVictory(scores: ScoresObject)

  • 경기 승패가 결정되면 호출합니다
  • GameManager 클래스의 onTeamVictory()를 호출합니다

기타

타이머 작성

...
/*** 게임 매니저 클래스 ***/
class GameManager{
	...
	onTeamGoal(team){ 					/* 골 판정 이벤트 */
		...
		let goalTimer = TM.addTimer("goal", {
			EXECUTE : () => {					// 실행 함수
				let showAvatar = function(s, t, c){
					...
					// s: 타이머의 현재 진행 순서
					// t: 플레이어의 ID
					// c: 변경할 등번호의 문자(열)
				}
				let target = goalTimer.findTimerByName().at(-1);
				if(target == undefined) return false;
				let currentOrder = goalTimer.calcCurrentSequence(target._sequence, 2);
				let totalSequence = goalTimer.calcTotalSequence(target._sequence);
				showAvatar(currentOrder, goalTimer._player, '⚽');
				if(PM.isValid(assist)) showAvatar(currentOrder, assist, '👍');
				if(totalSequence > 5) return goalTimer.clearTimerByName();
			},
			TERMINATE : () => {					// 종료 함수
				PM.resetAvatar(goalTimer._player);
				if(PM.isValid(assist)) PM.resetAvatar(assist);
			}
		}, player, SEC_TO_MS / 2, true, true);
		...
	}
	...
}
...
  • 이 타이머는 골 판정 직후부터 일정한 간격의 반복을 몇 초 동안, 득점자/어시스트의 등번호를 변경하는 기능을 수행합니다
  • goalTimer의 값은 이 타이머의 데이터베이스를 저장합니다

let goalTimer = TM.addTimer("goal", {

let goalTimer = TM.addTimer("goal", {
	EXECUTE : () => {		// 실행 함수
		...
	},
	TERMINATE : () => {		// 종료 함수
		...
	}
}, player, SEC_TO_MS / 2, true, true);
/*
	(SEC_TO_MS / 2)의 값은 500ms와 같습니다
*/
  • EXECUTE 기능은 타이머가 목표 시간에 도달하면 실행합니다

     EXECUTE : () => {					// 실행 함수
     	let showAvatar = function(s, t, c){
     		...
     		// s: 타이머의 현재 진행 순서
     		// t: 플레이어의 ID
     		// c: 변경할 등번호의 문자(열)
     	}
     	let target = goalTimer.findTimerByName().at(-1);
     	if(target == undefined) return false;
     	let currentOrder = goalTimer.calcCurrentSequence(target._sequence, 2);
     	let totalSequence = goalTimer.calcTotalSequence(target._sequence);
     	showAvatar(currentOrder, goalTimer._player, '⚽');
     	if(PM.isValid(assist)) showAvatar(currentOrder, assist, '👍');
     	if(totalSequence > 5) return goalTimer.clearTimerByName();
     },
    • target의 값에 상주 중인 최신 타이머의 데이터베이스를 저장합니다

    let target = goalTimer.findTimerByName().at(-1);

    • currentOrder의 값에 타이머의 현재 순서를 저장합니다. 여기서는 순서의 최댓값으로 2가 지정되었습니다

    let currentOrder = goalTimer.calcCurrentSequence(target._sequence, 2);

    • 값은 0, 1 중에 하나로 결정됩니다
    • 누적 진행 순서가 5를 초과한 경우 타이머를 삭제합니다
      • 이때 종료 함수를 실행합니다
  • TERMINATE 기능은 EXECUTE 실행 직후, 또는 타이머가 종료되는 순간에 실행합니다

     TERMINATE : () => {					// 종료 함수
     	PM.resetAvatar(goalTimer._player);
     	if(PM.isValid(assist)) PM.resetAvatar(assist);
     }
    • 이 타이머의 종료 함수에서는 득점자/어시스트를 타이머 실행 직전의 등번호로 되돌리는 기능을 수행합니다
    • 종료 함수는 생략할 수 있습니다
      let goalTimer = TM.addTimer("goal", () => {		// 실행 함수만
      	...
      }, player, SEC_TO_MS / 2, true, true);

⚠️ **GitHub.com Fallback** ⚠️