Added a config for disabling novice/summoner character creation (#3008)

* Added a config for disabling novice/summoner character creation.
* Summoner can no longer be created on pre-renewal by default.
Thanks to @Lemongrass3110 for the help
This commit is contained in:
Jittapan Pluemsumran
2018-04-04 16:40:03 +07:00
committed by GitHub
parent fdc48770aa
commit aab5d54945
7 changed files with 32 additions and 4 deletions

View File

@@ -1456,7 +1456,8 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i
}
#if PACKETVER >= 20151001
if (start_job != JOB_NOVICE && start_job != JOB_SUMMONER)
if(!(start_job == JOB_NOVICE && (charserv_config.allowed_job_flag&1)) &&
!(start_job == JOB_SUMMONER && (charserv_config.allowed_job_flag&2)))
return -2; // Invalid job
// Check for Doram based information.
@@ -2779,6 +2780,12 @@ void char_set_defaults(){
charserv_config.clan_remove_inactive_days = 14;
charserv_config.mail_return_days = 14;
charserv_config.mail_delete_days = 14;
#if defined(RENEWAL) && PACKETVER >= 20151001
charserv_config.allowed_job_flag = 3;
#else
charserv_config.allowed_job_flag = 1;
#endif
}
/**
@@ -3057,6 +3064,8 @@ bool char_config_read(const char* cfgName, bool normal){
charserv_config.mail_return_days = atoi(w2);
} else if (strcmpi(w1, "mail_delete_days") == 0) {
charserv_config.mail_delete_days = atoi(w2);
} else if (strcmpi(w1, "allowed_job_flag") == 0) {
charserv_config.allowed_job_flag = atoi(w2);
} else if (strcmpi(w1, "import") == 0) {
char_config_read(w2, normal);
}