- Added svn:eol-style=native property.
- Added missing newline at EOF (bugreport:7347) git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17193 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
b7d35015e1
commit
9e2bf9e2e2
@ -1,129 +1,129 @@
|
||||
// rAthena msg_athena.conf
|
||||
// Message Configuration of char-server
|
||||
// -----------------------
|
||||
0: Novice
|
||||
1: Swordsman
|
||||
2: Magician
|
||||
3: Archer
|
||||
4: Acolyte
|
||||
5: Merchant
|
||||
6: Thief
|
||||
7: Knight
|
||||
8: Priest
|
||||
9: Wizard
|
||||
10: Blacksmith
|
||||
11: Hunter
|
||||
12: Assassin
|
||||
13: Crusader
|
||||
14: Monk
|
||||
15: Sage
|
||||
16: Rogue
|
||||
17: Alchemist
|
||||
18: Bard
|
||||
19: Dancer
|
||||
20: Wedding
|
||||
21: Super Novice
|
||||
22: Gunslinger
|
||||
23: Ninja
|
||||
24: Christmas
|
||||
25: High Novice
|
||||
26: High Swordsman
|
||||
27: High Magician
|
||||
28: High Archer
|
||||
29: High Acolyte
|
||||
30: High Merchant
|
||||
31: High Thief
|
||||
32: Lord Knight
|
||||
33: High Priest
|
||||
34: High Wizard
|
||||
35: Whitesmith
|
||||
//35: Mastersmith //IRO name
|
||||
36: Sniper
|
||||
37: Assassin Cross
|
||||
38: Paladin
|
||||
39: Champion
|
||||
40: Professor
|
||||
//40: Scholar //IRO name
|
||||
41: Stalker
|
||||
42: Creator
|
||||
//42: Biochemist //IRO Name
|
||||
43: Clown
|
||||
//43: Minstrel //IRO Name
|
||||
44: Gypsy
|
||||
45: Baby Novice
|
||||
46: Baby Swordsman
|
||||
47: Baby Magician
|
||||
48: Baby Archer
|
||||
49: Baby Acolyte
|
||||
50: Baby Merchant
|
||||
51: Baby Thief
|
||||
52: Baby Knight
|
||||
53: Baby Priest
|
||||
54: Baby Wizard
|
||||
55: Baby Blacksmith
|
||||
56: Baby Hunter
|
||||
57: Baby Assassin
|
||||
58: Baby Crusader
|
||||
59: Baby Monk
|
||||
60: Baby Sage
|
||||
61: Baby Rogue
|
||||
62: Baby Alchemist
|
||||
63: Baby Bard
|
||||
64: Baby Dancer
|
||||
65: Super Baby
|
||||
66: Taekwon
|
||||
67: Star Gladiator
|
||||
68: Soul Linker
|
||||
//79: FREE
|
||||
//70: FREE
|
||||
71: Summer
|
||||
72: Gangsi
|
||||
73: Death Knight
|
||||
74: Dark Collector
|
||||
75: Rune Knight
|
||||
76: Warlock
|
||||
77: Ranger
|
||||
78: Arch Bishop
|
||||
79: Mechanic
|
||||
80: Guillotine Cross
|
||||
81: Royal Guard
|
||||
82: Sorcerer
|
||||
83: Minstrel
|
||||
//83: Maestro //IRO Name
|
||||
84: Wanderer
|
||||
85: Sura
|
||||
86: Genetic
|
||||
//86: Geneticist //IRO Name
|
||||
87: Shadow Chaser
|
||||
88: Baby Rune Knight
|
||||
89: Baby Warlock
|
||||
90: Baby Ranger
|
||||
91: Baby Arch Bishop
|
||||
92: Baby Mechanic
|
||||
93: Baby Guillotine Cross
|
||||
94: Baby Royal Guard
|
||||
95: Baby Sorcerer
|
||||
96: Baby Minstrel
|
||||
97: Baby Wanderer
|
||||
98: Baby Sura
|
||||
99: Baby Genetic
|
||||
100: Baby Shadow Chaser
|
||||
101: Expanded Super Novice
|
||||
102: Expanded Super Baby
|
||||
103: Kagerou
|
||||
104: Oboro
|
||||
105: Unknown Job
|
||||
|
||||
//Auction
|
||||
200: Auction Manager
|
||||
201: Auction
|
||||
202: Thanks, you won the auction!.
|
||||
203: Payment for your auction!.
|
||||
204: No buyers have been found for your auction.
|
||||
205: Auction canceled.
|
||||
206: Auction closed.
|
||||
207: Auction winner.
|
||||
208: Someone has placed a higher bid.
|
||||
209: You have placed a higher bid.
|
||||
210: You have won the auction.
|
||||
211: Payment for your auction!.
|
||||
// rAthena msg_athena.conf
|
||||
// Message Configuration of char-server
|
||||
// -----------------------
|
||||
0: Novice
|
||||
1: Swordsman
|
||||
2: Magician
|
||||
3: Archer
|
||||
4: Acolyte
|
||||
5: Merchant
|
||||
6: Thief
|
||||
7: Knight
|
||||
8: Priest
|
||||
9: Wizard
|
||||
10: Blacksmith
|
||||
11: Hunter
|
||||
12: Assassin
|
||||
13: Crusader
|
||||
14: Monk
|
||||
15: Sage
|
||||
16: Rogue
|
||||
17: Alchemist
|
||||
18: Bard
|
||||
19: Dancer
|
||||
20: Wedding
|
||||
21: Super Novice
|
||||
22: Gunslinger
|
||||
23: Ninja
|
||||
24: Christmas
|
||||
25: High Novice
|
||||
26: High Swordsman
|
||||
27: High Magician
|
||||
28: High Archer
|
||||
29: High Acolyte
|
||||
30: High Merchant
|
||||
31: High Thief
|
||||
32: Lord Knight
|
||||
33: High Priest
|
||||
34: High Wizard
|
||||
35: Whitesmith
|
||||
//35: Mastersmith //IRO name
|
||||
36: Sniper
|
||||
37: Assassin Cross
|
||||
38: Paladin
|
||||
39: Champion
|
||||
40: Professor
|
||||
//40: Scholar //IRO name
|
||||
41: Stalker
|
||||
42: Creator
|
||||
//42: Biochemist //IRO Name
|
||||
43: Clown
|
||||
//43: Minstrel //IRO Name
|
||||
44: Gypsy
|
||||
45: Baby Novice
|
||||
46: Baby Swordsman
|
||||
47: Baby Magician
|
||||
48: Baby Archer
|
||||
49: Baby Acolyte
|
||||
50: Baby Merchant
|
||||
51: Baby Thief
|
||||
52: Baby Knight
|
||||
53: Baby Priest
|
||||
54: Baby Wizard
|
||||
55: Baby Blacksmith
|
||||
56: Baby Hunter
|
||||
57: Baby Assassin
|
||||
58: Baby Crusader
|
||||
59: Baby Monk
|
||||
60: Baby Sage
|
||||
61: Baby Rogue
|
||||
62: Baby Alchemist
|
||||
63: Baby Bard
|
||||
64: Baby Dancer
|
||||
65: Super Baby
|
||||
66: Taekwon
|
||||
67: Star Gladiator
|
||||
68: Soul Linker
|
||||
//79: FREE
|
||||
//70: FREE
|
||||
71: Summer
|
||||
72: Gangsi
|
||||
73: Death Knight
|
||||
74: Dark Collector
|
||||
75: Rune Knight
|
||||
76: Warlock
|
||||
77: Ranger
|
||||
78: Arch Bishop
|
||||
79: Mechanic
|
||||
80: Guillotine Cross
|
||||
81: Royal Guard
|
||||
82: Sorcerer
|
||||
83: Minstrel
|
||||
//83: Maestro //IRO Name
|
||||
84: Wanderer
|
||||
85: Sura
|
||||
86: Genetic
|
||||
//86: Geneticist //IRO Name
|
||||
87: Shadow Chaser
|
||||
88: Baby Rune Knight
|
||||
89: Baby Warlock
|
||||
90: Baby Ranger
|
||||
91: Baby Arch Bishop
|
||||
92: Baby Mechanic
|
||||
93: Baby Guillotine Cross
|
||||
94: Baby Royal Guard
|
||||
95: Baby Sorcerer
|
||||
96: Baby Minstrel
|
||||
97: Baby Wanderer
|
||||
98: Baby Sura
|
||||
99: Baby Genetic
|
||||
100: Baby Shadow Chaser
|
||||
101: Expanded Super Novice
|
||||
102: Expanded Super Baby
|
||||
103: Kagerou
|
||||
104: Oboro
|
||||
105: Unknown Job
|
||||
|
||||
//Auction
|
||||
200: Auction Manager
|
||||
201: Auction
|
||||
202: Thanks, you won the auction!.
|
||||
203: Payment for your auction!.
|
||||
204: No buyers have been found for your auction.
|
||||
205: Auction canceled.
|
||||
206: Auction closed.
|
||||
207: Auction winner.
|
||||
208: Someone has placed a higher bid.
|
||||
209: You have placed a higher bid.
|
||||
210: You have won the auction.
|
||||
211: Payment for your auction!.
|
||||
|
@ -1,26 +1,26 @@
|
||||
// rAthena msg_athena.conf
|
||||
// Message Configuration of login-server
|
||||
// -----------------------
|
||||
0: Unregistered ID.
|
||||
1: Incorrect Password.
|
||||
2: Account Expired.
|
||||
3: Rejected from server.
|
||||
4: Blocked by GM.
|
||||
5: Not latest game EXE.
|
||||
6: Banned.
|
||||
7: Server Over-population.
|
||||
8: Account limit from company
|
||||
9: Ban by DBA
|
||||
10: Email not confirmed
|
||||
11: Ban by GM
|
||||
12: Working in DB
|
||||
13: Self Lock
|
||||
14: Not Permitted Group
|
||||
15: Not Permitted Group
|
||||
16: Account gone.
|
||||
17: Login info remains.
|
||||
18: Hacking investigation.
|
||||
19: Bug investigation.
|
||||
20: Deleting char.
|
||||
21: Deleting spouse char.
|
||||
22: Unknown Error.
|
||||
// rAthena msg_athena.conf
|
||||
// Message Configuration of login-server
|
||||
// -----------------------
|
||||
0: Unregistered ID.
|
||||
1: Incorrect Password.
|
||||
2: Account Expired.
|
||||
3: Rejected from server.
|
||||
4: Blocked by GM.
|
||||
5: Not latest game EXE.
|
||||
6: Banned.
|
||||
7: Server Over-population.
|
||||
8: Account limit from company
|
||||
9: Ban by DBA
|
||||
10: Email not confirmed
|
||||
11: Ban by GM
|
||||
12: Working in DB
|
||||
13: Self Lock
|
||||
14: Not Permitted Group
|
||||
15: Not Permitted Group
|
||||
16: Account gone.
|
||||
17: Login info remains.
|
||||
18: Hacking investigation.
|
||||
19: Bug investigation.
|
||||
20: Deleting char.
|
||||
21: Deleting spouse char.
|
||||
22: Unknown Error.
|
||||
|
@ -535,4 +535,4 @@ sub GetDesiredConf { my ($rhDefConf) = @_;
|
||||
$rhUserConf=GetValidateConf($rhDefConf);
|
||||
}
|
||||
return $rhUserConf;
|
||||
}
|
||||
}
|
||||
|
@ -5130,4 +5130,4 @@ void display_helpscreen(bool do_exit)
|
||||
ShowInfo(" --msg-config <file>\t\tAlternative message configuration.\n");
|
||||
if( do_exit )
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
274
src/common/cli.c
274
src/common/cli.c
@ -1,137 +1,137 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "cbasetypes.h"
|
||||
#include "showmsg.h"
|
||||
#include "core.h"
|
||||
#include "cli.h"
|
||||
|
||||
char* MAP_CONF_NAME;
|
||||
char* INTER_CONF_NAME;
|
||||
char* LOG_CONF_NAME;
|
||||
char* BATTLE_CONF_FILENAME;
|
||||
char* ATCOMMAND_CONF_FILENAME;
|
||||
char* SCRIPT_CONF_NAME;
|
||||
char* GRF_PATH_FILENAME;
|
||||
//char
|
||||
char* CHAR_CONF_NAME;
|
||||
char* SQL_CONF_NAME;
|
||||
//login
|
||||
char* LOGIN_CONF_NAME;
|
||||
//common
|
||||
char* LAN_CONF_NAME; //char-login
|
||||
char* MSG_CONF_NAME; //all
|
||||
|
||||
bool opt_has_next_value(const char* option, int i, int argc)
|
||||
{
|
||||
if (i >= argc - 1) {
|
||||
ShowWarning("Missing value for option '%s'.\n", option);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*======================================================
|
||||
* Servers Version Screen [MC Cameri]
|
||||
*------------------------------------------------------*/
|
||||
void display_versionscreen(bool do_exit)
|
||||
{
|
||||
ShowInfo(CL_WHITE"rAthena SVN version: %s" CL_RESET"\n", get_svn_revision());
|
||||
ShowInfo(CL_GREEN"Website/Forum:"CL_RESET"\thttp://rathena.org/\n");
|
||||
ShowInfo(CL_GREEN"IRC Channel:"CL_RESET"\tirc://irc.rathena.net/#rathena\n");
|
||||
ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n");
|
||||
if (do_exit)
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int cli_get_options(int argc, char ** argv)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 1; i < argc; i++) {
|
||||
const char* arg = argv[i];
|
||||
|
||||
if (arg[0] != '-' && (arg[0] != '/' || arg[1] == '-')) {// -, -- and /
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
} else if ((++arg)[0] == '-') {// long option
|
||||
arg++;
|
||||
|
||||
if (strcmp(arg, "help") == 0) {
|
||||
display_helpscreen(true);
|
||||
} else if (strcmp(arg, "version") == 0) {
|
||||
display_versionscreen(true);
|
||||
} else if (strcmp(arg, "msg-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
MSG_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "run-once") == 0) // close the map-server as soon as its done.. for testing [Celest]
|
||||
{
|
||||
runflag = CORE_ST_STOP;
|
||||
} else if (SERVER_TYPE & (ATHENA_SERVER_LOGIN | ATHENA_SERVER_CHAR)) { //login or char
|
||||
if (strcmp(arg, "lan-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
LAN_CONF_NAME = argv[++i];
|
||||
} else if (SERVER_TYPE == ATHENA_SERVER_LOGIN) { //login
|
||||
if (strcmp(arg, "login-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
LOGIN_CONF_NAME = argv[++i];
|
||||
} else {
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else if (SERVER_TYPE == ATHENA_SERVER_CHAR) { //char
|
||||
if (strcmp(arg, "char-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
CHAR_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "inter-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
INTER_CONF_NAME = argv[++i];
|
||||
} else {
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
} else if (SERVER_TYPE == ATHENA_SERVER_MAP) { //map
|
||||
if (strcmp(arg, "map-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
MAP_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "battle-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
BATTLE_CONF_FILENAME = argv[++i];
|
||||
} else if (strcmp(arg, "atcommand-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
ATCOMMAND_CONF_FILENAME = argv[++i];
|
||||
} else if (strcmp(arg, "script-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
SCRIPT_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "grf-path-file") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
GRF_PATH_FILENAME = argv[++i];
|
||||
} else if (strcmp(arg, "inter-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
INTER_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "log-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
LOG_CONF_NAME = argv[++i];
|
||||
}
|
||||
else {
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
} else switch (arg[0]) {// short option
|
||||
case '?':
|
||||
case 'h':
|
||||
display_helpscreen(true);
|
||||
break;
|
||||
case 'v':
|
||||
display_versionscreen(true);
|
||||
break;
|
||||
default:
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "cbasetypes.h"
|
||||
#include "showmsg.h"
|
||||
#include "core.h"
|
||||
#include "cli.h"
|
||||
|
||||
char* MAP_CONF_NAME;
|
||||
char* INTER_CONF_NAME;
|
||||
char* LOG_CONF_NAME;
|
||||
char* BATTLE_CONF_FILENAME;
|
||||
char* ATCOMMAND_CONF_FILENAME;
|
||||
char* SCRIPT_CONF_NAME;
|
||||
char* GRF_PATH_FILENAME;
|
||||
//char
|
||||
char* CHAR_CONF_NAME;
|
||||
char* SQL_CONF_NAME;
|
||||
//login
|
||||
char* LOGIN_CONF_NAME;
|
||||
//common
|
||||
char* LAN_CONF_NAME; //char-login
|
||||
char* MSG_CONF_NAME; //all
|
||||
|
||||
bool opt_has_next_value(const char* option, int i, int argc)
|
||||
{
|
||||
if (i >= argc - 1) {
|
||||
ShowWarning("Missing value for option '%s'.\n", option);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*======================================================
|
||||
* Servers Version Screen [MC Cameri]
|
||||
*------------------------------------------------------*/
|
||||
void display_versionscreen(bool do_exit)
|
||||
{
|
||||
ShowInfo(CL_WHITE"rAthena SVN version: %s" CL_RESET"\n", get_svn_revision());
|
||||
ShowInfo(CL_GREEN"Website/Forum:"CL_RESET"\thttp://rathena.org/\n");
|
||||
ShowInfo(CL_GREEN"IRC Channel:"CL_RESET"\tirc://irc.rathena.net/#rathena\n");
|
||||
ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n");
|
||||
if (do_exit)
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int cli_get_options(int argc, char ** argv)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 1; i < argc; i++) {
|
||||
const char* arg = argv[i];
|
||||
|
||||
if (arg[0] != '-' && (arg[0] != '/' || arg[1] == '-')) {// -, -- and /
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
} else if ((++arg)[0] == '-') {// long option
|
||||
arg++;
|
||||
|
||||
if (strcmp(arg, "help") == 0) {
|
||||
display_helpscreen(true);
|
||||
} else if (strcmp(arg, "version") == 0) {
|
||||
display_versionscreen(true);
|
||||
} else if (strcmp(arg, "msg-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
MSG_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "run-once") == 0) // close the map-server as soon as its done.. for testing [Celest]
|
||||
{
|
||||
runflag = CORE_ST_STOP;
|
||||
} else if (SERVER_TYPE & (ATHENA_SERVER_LOGIN | ATHENA_SERVER_CHAR)) { //login or char
|
||||
if (strcmp(arg, "lan-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
LAN_CONF_NAME = argv[++i];
|
||||
} else if (SERVER_TYPE == ATHENA_SERVER_LOGIN) { //login
|
||||
if (strcmp(arg, "login-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
LOGIN_CONF_NAME = argv[++i];
|
||||
} else {
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else if (SERVER_TYPE == ATHENA_SERVER_CHAR) { //char
|
||||
if (strcmp(arg, "char-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
CHAR_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "inter-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
INTER_CONF_NAME = argv[++i];
|
||||
} else {
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
} else if (SERVER_TYPE == ATHENA_SERVER_MAP) { //map
|
||||
if (strcmp(arg, "map-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
MAP_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "battle-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
BATTLE_CONF_FILENAME = argv[++i];
|
||||
} else if (strcmp(arg, "atcommand-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
ATCOMMAND_CONF_FILENAME = argv[++i];
|
||||
} else if (strcmp(arg, "script-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
SCRIPT_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "grf-path-file") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
GRF_PATH_FILENAME = argv[++i];
|
||||
} else if (strcmp(arg, "inter-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
INTER_CONF_NAME = argv[++i];
|
||||
} else if (strcmp(arg, "log-config") == 0) {
|
||||
if (opt_has_next_value(arg, i, argc))
|
||||
LOG_CONF_NAME = argv[++i];
|
||||
}
|
||||
else {
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
} else switch (arg[0]) {// short option
|
||||
case '?':
|
||||
case 'h':
|
||||
display_helpscreen(true);
|
||||
break;
|
||||
case 'v':
|
||||
display_versionscreen(true);
|
||||
break;
|
||||
default:
|
||||
ShowError("Unknown option '%s'.\n", argv[i]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,40 +1,40 @@
|
||||
/*
|
||||
* File: cli.h
|
||||
* Author: lighta
|
||||
*
|
||||
* Created on February 21, 2013, 6:15 PM
|
||||
*/
|
||||
|
||||
#ifndef CLI_H
|
||||
#define CLI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//map
|
||||
extern char* MAP_CONF_NAME;
|
||||
extern char* INTER_CONF_NAME;
|
||||
extern char* LOG_CONF_NAME;
|
||||
extern char* BATTLE_CONF_FILENAME;
|
||||
extern char* ATCOMMAND_CONF_FILENAME;
|
||||
extern char* SCRIPT_CONF_NAME;
|
||||
extern char* GRF_PATH_FILENAME;
|
||||
//char
|
||||
extern char* CHAR_CONF_NAME;
|
||||
extern char* SQL_CONF_NAME;
|
||||
//login
|
||||
extern char* LOGIN_CONF_NAME;
|
||||
//common
|
||||
extern char* LAN_CONF_NAME; //char-login
|
||||
extern char* MSG_CONF_NAME; //all
|
||||
|
||||
extern void display_helpscreen(bool exit);
|
||||
int cli_get_options(int argc, char ** argv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CLI_H */
|
||||
|
||||
/*
|
||||
* File: cli.h
|
||||
* Author: lighta
|
||||
*
|
||||
* Created on February 21, 2013, 6:15 PM
|
||||
*/
|
||||
|
||||
#ifndef CLI_H
|
||||
#define CLI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//map
|
||||
extern char* MAP_CONF_NAME;
|
||||
extern char* INTER_CONF_NAME;
|
||||
extern char* LOG_CONF_NAME;
|
||||
extern char* BATTLE_CONF_FILENAME;
|
||||
extern char* ATCOMMAND_CONF_FILENAME;
|
||||
extern char* SCRIPT_CONF_NAME;
|
||||
extern char* GRF_PATH_FILENAME;
|
||||
//char
|
||||
extern char* CHAR_CONF_NAME;
|
||||
extern char* SQL_CONF_NAME;
|
||||
//login
|
||||
extern char* LOGIN_CONF_NAME;
|
||||
//common
|
||||
extern char* LAN_CONF_NAME; //char-login
|
||||
extern char* MSG_CONF_NAME; //all
|
||||
|
||||
extern void display_helpscreen(bool exit);
|
||||
int cli_get_options(int argc, char ** argv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CLI_H */
|
||||
|
||||
|
@ -1,72 +1,72 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "malloc.h"
|
||||
#include "msg_conf.h"
|
||||
#include "showmsg.h"
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Return the message string of the specified number by [Yor]
|
||||
//-----------------------------------------------------------
|
||||
|
||||
const char* _msg_txt(int msg_number,int size, char ** msg_table)
|
||||
{
|
||||
if (msg_number >= 0 && msg_number < size &&
|
||||
msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
|
||||
return msg_table[msg_number];
|
||||
|
||||
return "??";
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Read Message Data
|
||||
*------------------------------------------*/
|
||||
int _msg_config_read(const char* cfgName,int size, char ** msg_table)
|
||||
{
|
||||
int msg_number;
|
||||
char line[1024], w1[1024], w2[1024];
|
||||
FILE *fp;
|
||||
static int called = 1;
|
||||
|
||||
if ((fp = fopen(cfgName, "r")) == NULL) {
|
||||
ShowError("Messages file not found: %s\n", cfgName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((--called) == 0)
|
||||
memset(msg_table, 0, sizeof (msg_table[0]) * size);
|
||||
|
||||
while (fgets(line, sizeof (line), fp)) {
|
||||
if (line[0] == '/' && line[1] == '/')
|
||||
continue;
|
||||
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
|
||||
continue;
|
||||
|
||||
if (strcmpi(w1, "import") == 0)
|
||||
_msg_config_read(w2,size,msg_table);
|
||||
else {
|
||||
msg_number = atoi(w1);
|
||||
if (msg_number >= 0 && msg_number < size) {
|
||||
if (msg_table[msg_number] != NULL)
|
||||
aFree(msg_table[msg_number]);
|
||||
msg_table[msg_number] = (char *) aMalloc((strlen(w2) + 1) * sizeof (char));
|
||||
strcpy(msg_table[msg_number], w2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
ShowInfo("Finished reading %s.\n",cfgName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Cleanup Message Data
|
||||
*------------------------------------------*/
|
||||
void _do_final_msg(int size, char ** msg_table){
|
||||
int i;
|
||||
for (i = 0; i < size; i++)
|
||||
aFree(msg_table[i]);
|
||||
}
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "malloc.h"
|
||||
#include "msg_conf.h"
|
||||
#include "showmsg.h"
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Return the message string of the specified number by [Yor]
|
||||
//-----------------------------------------------------------
|
||||
|
||||
const char* _msg_txt(int msg_number,int size, char ** msg_table)
|
||||
{
|
||||
if (msg_number >= 0 && msg_number < size &&
|
||||
msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
|
||||
return msg_table[msg_number];
|
||||
|
||||
return "??";
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Read Message Data
|
||||
*------------------------------------------*/
|
||||
int _msg_config_read(const char* cfgName,int size, char ** msg_table)
|
||||
{
|
||||
int msg_number;
|
||||
char line[1024], w1[1024], w2[1024];
|
||||
FILE *fp;
|
||||
static int called = 1;
|
||||
|
||||
if ((fp = fopen(cfgName, "r")) == NULL) {
|
||||
ShowError("Messages file not found: %s\n", cfgName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((--called) == 0)
|
||||
memset(msg_table, 0, sizeof (msg_table[0]) * size);
|
||||
|
||||
while (fgets(line, sizeof (line), fp)) {
|
||||
if (line[0] == '/' && line[1] == '/')
|
||||
continue;
|
||||
if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
|
||||
continue;
|
||||
|
||||
if (strcmpi(w1, "import") == 0)
|
||||
_msg_config_read(w2,size,msg_table);
|
||||
else {
|
||||
msg_number = atoi(w1);
|
||||
if (msg_number >= 0 && msg_number < size) {
|
||||
if (msg_table[msg_number] != NULL)
|
||||
aFree(msg_table[msg_number]);
|
||||
msg_table[msg_number] = (char *) aMalloc((strlen(w2) + 1) * sizeof (char));
|
||||
strcpy(msg_table[msg_number], w2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
ShowInfo("Finished reading %s.\n",cfgName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
* Cleanup Message Data
|
||||
*------------------------------------------*/
|
||||
void _do_final_msg(int size, char ** msg_table){
|
||||
int i;
|
||||
for (i = 0; i < size; i++)
|
||||
aFree(msg_table[i]);
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#ifndef MSG_CONF_H
|
||||
#define MSG_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
const char* _msg_txt(int msg_number,int size, char ** msg_table);
|
||||
int _msg_config_read(const char* cfgName,int size, char ** msg_table);
|
||||
void _do_final_msg(int size, char ** msg_table);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSG_CONF_H */
|
||||
|
||||
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
|
||||
// For more information, see LICENCE in the main folder
|
||||
|
||||
#ifndef MSG_CONF_H
|
||||
#define MSG_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
const char* _msg_txt(int msg_number,int size, char ** msg_table);
|
||||
int _msg_config_read(const char* cfgName,int size, char ** msg_table);
|
||||
void _do_final_msg(int size, char ** msg_table);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSG_CONF_H */
|
||||
|
||||
|
@ -549,4 +549,4 @@ sub GetDesiredConf { my ($rhDefConf) = @_;
|
||||
$rhUserConf=GetValidateConf($rhDefConf);
|
||||
}
|
||||
return $rhUserConf;
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,5 @@ case $1 in
|
||||
echo "Uninstallation succed"
|
||||
;;
|
||||
'*')
|
||||
echo "Please enter a target usage './uninstall { all | bin }'"
|
||||
echo "Please enter a target usage './uninstall { all | bin }'"
|
||||
esac
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user