Welcome to the Builder Academy

Question Does the typo, idea, bug commands work?

More
14 Sep 2020 05:06 - 14 Sep 2020 05:35 #9741 by cry1004
Your concern is unfortunately a reality for me.
I tested the code line by line.
I wanted to see how the code works.
I also added your code to the command_interpreter function.
Code:
log("Char doing the command: %p %s, descriptor: %p", ch, GET_NAME(ch), ch->desc);
The code above returned the following result.
Code:
Char doing the command: 01B80790 울보천사, descriptor: 01B82A60
Code:
void command_interpreter(struct char_data *ch, char *argument) { int cmd, length; char *line; char *p; char arg[MAX_INPUT_LENGTH]; char hanparse[MAX_INPUT_LENGTH]; /* 한글 어순 */ char hancommand[MAX_INPUT_LENGTH]; /* 한글 명령 */ REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE); /* just drop to next line for hitting CR */ skip_spaces(&argument); if (!*argument) return; if(strlen(argument) > MAX_INPUT_LENGTH - 100) { send_to_char(ch,"너무 많이 입력하였습니다.\r\n"); return; } /* 입력한 문장을 hanparse로 복사한다. */ sprintf(hanparse, "%s", argument); /* 입력한 문장의 끝에 느낌표, 물음표, 마침표가 있으면 대화 명령으로 변경한다. */ if(check_comma(hanparse)) strcat(hanparse, " 말"); /* 키보드의 숫자 키패드의 번호를 입력시 해당 방향으로 이동하는 명령어로 변경한다. */ if((strlen(hanparse) <= 2) && is_number(hanparse)) switch(atoi(hanparse)) { case 6: sprintf(hanparse, "동"); break; case 4: sprintf(hanparse, "서"); break; case 2: sprintf(hanparse, "남"); break; case 8: sprintf(hanparse, "북"); break; case 9: sprintf(hanparse, "북동"); break; case 7: sprintf(hanparse, "북서"); break; case 3: sprintf(hanparse, "남동"); break; case 1: sprintf(hanparse, "남서"); break; } /* if(strrchr(hanparse, ' ')) { sprintf(hancommand, "%s ", strrchr(hanparse, ' ')); hanparse[strlen(hanparse) - (strlen(hancommand) - 1)] = '\0'; strcat(hancommand, hanparse); argument = hancommand; } else argument = hanparse; skip_spaces(&argument); */ log("Char doing the command: %p %s, descriptor: %p", ch, GET_NAME(ch), ch->desc); if(strrchr(hanparse, ' ')) { /* 문장에 공백이 있으면 두 단어를 입력한 것으로 간주하고 */ int len; p = LastWord(hanparse, &len); strcat(hancommand, p); hanparse[strlen(hanparse) - (strlen(hancommand)+1)] = '\0'; argument = RemoveFirstWord(hanparse); } else argument = hanparse; /* special case to handle one-character, non-alphanumeric commands; * requested by many people so "'hi" or ";godnet test" is possible. * Patch sent by Eric Green and Stefan Wasilewski. */ /* if (!ishanalp(*argument)) { arg[0] = argument[0]; arg[1] = '\0'; line = argument + 1; } else line = any_one_arg(argument, arg); skip_spaces(&line); send_to_char(ch, "arg: %s line: %s\r\n", arg, line); */ // strcat(arg, hancommand); // line = FirstWord(hanparse); strcat(arg, FirstWord(hanparse)); line = hancommand; log("hancommand:%s<<\r\n", hancommand); log("arg:%s<<\r\n", arg); log("argument:%s<<\r\n", argument); log("line:%s<<\r\n", line); /* Since all command triggers check for valid_dg_target before acting, the levelcheck * here has been removed. Otherwise, find the command. */ { int cont; /* continue the command checks */ cont = command_wtrigger(ch, arg, line); /* any world triggers ? */ if (!cont) cont = command_mtrigger(ch, arg, line); /* any mobile triggers ? */ if (!cont) cont = command_otrigger(ch, arg, line); /* any object triggers ? */ if (cont) return; /* yes, command trigger took over */ } /* Allow IMPLs to switch into mobs to test the commands. */ if (IS_NPC(ch) && ch->desc && GET_LEVEL(ch->desc->original) >= LVL_IMPL) { if (script_command_interpreter(ch, argument)) return; } //total 930 cmd for (length = strlen(arg), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++) if (complete_cmd_info[cmd].command_pointer != do_action && !strncmp(complete_cmd_info[cmd].command, arg, length)) if (GET_LEVEL(ch) >= complete_cmd_info[cmd].minimum_level) break; send_to_char(ch, "1: %d %s\r\n", cmd, complete_cmd_info[766].command); //766 /* it's not a 'real' command, so it's a social */ if(*complete_cmd_info[cmd].command == '\n') for (length = strlen(arg), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++) if (complete_cmd_info[cmd].command_pointer == do_action && !strncmp(complete_cmd_info[cmd].command, arg, length)) if (GET_LEVEL(ch) >= complete_cmd_info[cmd].minimum_level) break; if (*complete_cmd_info[cmd].command == '\n') { int found = 0; send_to_char(ch, "%s", CONFIG_HUH); for (cmd = 0; *cmd_info[cmd].command != '\n'; cmd++) { if (*arg != *cmd_info[cmd].command || cmd_info[cmd].minimum_level > GET_LEVEL(ch)) continue; /* Only apply levenshtein counts if the command is not a trigger command. */ if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) && (cmd_info[cmd].minimum_level >= 0) ) { if (!found) { send_to_char(ch, "\r\n이것을 찾으셨나요?:\r\n===================\r\n"); found = 1; } send_to_char(ch, " %s\r\n", cmd_info[cmd].command); } } } else if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL) send_to_char(ch, "\r\n당신은 꽁꽁 얼어 붙어 아무것도 할 수 없습니다.\r\n"); else if (complete_cmd_info[cmd].command_pointer == NULL) send_to_char(ch, "\r\n%s : 그런 명령은 없습니다.\r\n", arg); else if (IS_NPC(ch) && complete_cmd_info[cmd].minimum_level >= LVL_IMMORT) send_to_char(ch, "\r\n%s : 당신은 사용할 수 없는 명령입니다.\r\n", arg); else if (GET_POS(ch) < complete_cmd_info[cmd].minimum_position) switch (GET_POS(ch)) { case POS_DEAD: send_to_char(ch, "\r\n당신은 죽었습니다! :-(\r\n"); break; case POS_INCAP: case POS_MORTALLYW: send_to_char(ch, "\r\n당신은 아무것도 할 수 없습니다.\r\n"); break; case POS_STUNNED: send_to_char(ch, "\r\n당신의 머리위로 별들이 빙빙 돌고 있습니다. 기절하셨는데요?\r\n"); break; case POS_SLEEPING: send_to_char(ch, "\r\n꿈속에서 무엇을 하시려고요?\r\n"); break; case POS_RESTING: send_to_char(ch, "\r\n음.. 지금 쉬고 계시는데요? 먼저 일어나세요.\r\n"); break; case POS_SITTING: send_to_char(ch, "\r\n자리에서 먼저 일어나세요?\r\n"); break; case POS_FIGHTING: send_to_char(ch, "\r\n당신의 목숨이 달려있어요. 싸움에 집중해 주세요!\r\n"); break; } else if (no_specials || !special(ch, cmd, line)) { send_to_char(ch, "\r\n오류: %s\r\n", *complete_cmd_info[cmd].command_pointer); //((*complete_cmd_info[cmd].command_pointer) (ch, line, cmd, complete_cmd_info[cmd].subcmd)); } }

The result of the next for inquiry was 930.
Maybe he found 930 commands.
Code:
for (length = strlen(arg), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++)

Then, I entered the Typo command where errors occur in the game.

Returned 766 as a result of execution of the following code.
I think the typo command is on the command list, and it's the 766.
Code:
if(*complete_cmd_info[cmd].command == '\n') for (length = strlen(arg), cmd = 0; *complete_cmd_info[cmd].command != '\n'; cmd++) if (complete_cmd_info[cmd].command_pointer == do_action && !strncmp(complete_cmd_info[cmd].command, arg, length)) if (GET_LEVEL(ch) >= complete_cmd_info[cmd].minimum_level) break;

Finally, this is where the error occurs.
When I returned complete_cmd_info[cmd].command_pointer as a string, it wasn't the typo command I entered and it returned strange characters.
Code:
((*complete_cmd_info[cmd].command_pointer) (ch, line, cmd, complete_cmd_info[cmd].subcmd));
It seems that complete_cmd_info[cmd].command_pointer is an array, but I want to know what information it contains.

It did not contain the Hangul typo command I entered, but it was a broken character.
I think it contains the location of the ibt command.

I changed typo to a Korean command and input it, and the result is as follows.
Code:
log("hancommand:%s<<\r\n", hancommand); log("arg:%s<<\r\n", arg); log("argument:%s<<\r\n", argument); log("line:%s<<\r\n", line);
It is the result of entering only typo Korean command.
Code:
09/14 13:20:40 :: hancommand:<< 09/14 13:20:40 :: arg:오타<< 09/14 13:20:40 :: argument:오타<< 09/14 13:20:40 :: line:<<

I derive all arguments from command_interpreter including the last command I entered, the first subcommand I entered, and a strings between the two commands.

How do I convert the arg, line, argument I created into cmd?
((*complete_cmd_info[cmd].command_pointer) (ch, line, cmd, complete_cmd_info[cmd].subcmd));

arg is the command I entered. If only one word is entered, it becomes that word, and if multiple words are entered, it is the last word.

line is the first word entered in the string. If you enter only one word, it will be null, if you enter multiple words, it will be the first word, and it will be subcmd.

argument is a string containing spaces excluding arg and line.
This will be the title of your typo command.

I divided the sentence entered in command_interpreter into 3 types. Command, subcommand, argument
It seems that it will be solved by just knowing to put this in cmd and send it to ibt.

(ch, line, cmd, complete_cmd_info[cmd].subcmd)
I wrote to the forum, and I was thinking again.

ch seems to contain the information of the player who entered the command.

complete_cmd_info[cmd].subcmd equals subcom.
So what are line and cmd?

If line is a command, should I specify the last word entered in the string in the code I wrote?

So, should cmd be an argument excluding two commands?

It seems to be a very difficult problem for me.

I'll wait for your advice.
Last edit: 14 Sep 2020 05:35 by cry1004.

Please Log in or Create an account to join the conversation.

More
15 Sep 2020 05:10 - 15 Sep 2020 08:01 #9747 by cry1004
I started the compilation test again from scratch today.
I compiled using msvs 2019.
I consulted the following article on how to compile. I used the conf.h.msvs file.
Running on Windows using Visual Studio

Compiling in the Dubug mode as a guide in this article results in the following error and does not generate an executable:
Code:
1>------ Rebuild All started: Project: TbaMUD_Eng, Configuration: Debug Win32 ------ 1>act.comm.c 1>act.informative.c 1>act.item.c 1>act.movement.c 1>act.offensive.c 1>act.other.c 1>act.social.c 1>act.wizard.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4215,12): warning C4013: '_chdir' undefined; assuming extern returning int 1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4222,9): warning C4013: 'execl' undefined; assuming extern returning int 1>aedit.c 1>asciimap.c 1>ban.c 1>boards.c 1>bsd-snprintf.c 1>castle.c 1>cedit.c 1>class.c 1>comm.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\comm.c(440,13): warning C4013: 'close' undefined; assuming extern returning int 1>config.c 1>constants.c 1>db.c 1>Generating Code... 1>Compiling... 1>dg_comm.c 1>dg_db_scripts.c 1>dg_event.c 1>dg_handler.c 1>dg_misc.c 1>dg_mobcmd.c 1>dg_objcmd.c 1>dg_olc.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_olc.c(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss 1>dg_scripts.c 1>dg_triggers.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_triggers.c(407,26): warning C4090: 'function': different 'const' qualifiers 1>dg_variables.c 1>dg_wldcmd.c 1>fight.c 1>genmob.c 1>genobj.c 1>genolc.c 1>genqst.c 1>genshp.c 1>genwld.c 1>genzon.c 1>Generating Code... 1>Compiling... 1>graph.c 1>handler.c 1>hedit.c 1>house.c 1>ibt.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\ibt.c(515,79): warning C4133: 'function': incompatible types - from 'long *' to 'const time_t *const ' 1>improved-edit.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\improved-edit.c(690,44): warning C4018: '<': signed/unsigned mismatch 1>interpreter.c 1>limits.c 1>lists.c 1>magic.c 1>mail.c 1>medit.c 1>mobact.c 1>modify.c 1>msgedit.c 1>mud_event.c 1>oasis.c 1>oasis_copy.c 1>oasis_delete.c 1>oasis_list.c 1>Generating Code... 1>Compiling... 1>objsave.c 1>oedit.c 1>players.c 1>prefedit.c 1>protocol.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(1391,38): warning C4018: '<=': signed/unsigned mismatch 1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2240,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)' 1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2241,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)' 1>qedit.c 1>quest.c 1>random.c 1>redit.c 1>sedit.c 1>shop.c 1>spec_assign.c 1>spec_procs.c 1>spells.c 1>spell_parser.c 1>C:\Users\울보천사\Desktop\tbamud-master\src\spell_parser.c(75,34): warning C4018: '<': signed/unsigned mismatch 1>tedit.c 1>utils.c 1>weather.c 1>zedit.c 1>zmalloc.c 1>Generating Code... 1>comm.obj : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _game_loop 1>comm.obj : error LNK2019: unresolved external symbol _accept@12 referenced in function _new_descriptor 1>comm.obj : error LNK2019: unresolved external symbol _bind@12 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _close_socket 1>comm.obj : error LNK2019: unresolved external symbol _ioctlsocket@12 referenced in function _nonblock 1>comm.obj : error LNK2019: unresolved external symbol _htonl@4 referenced in function _get_bind_addr 1>comm.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _inet_addr@4 referenced in function _parse_ip 1>comm.obj : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function _get_bind_addr 1>comm.obj : error LNK2019: unresolved external symbol _listen@8 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _perform_socket_read 1>comm.obj : error LNK2019: unresolved external symbol _select@20 referenced in function _game_loop 1>comm.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _perform_socket_write 1>comm.obj : error LNK2019: unresolved external symbol _setsockopt@20 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _gethostbyaddr@12 referenced in function _new_descriptor 1>comm.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function _init_socket 1>C:\Users\울보천사\Desktop\tbamud-master\bin\TbaMud_Eng\Debug\TbaMUD_Eng.exe : fatal error LNK1120: 18 unresolved externals 1>Done building project "TbaMUD_Eng.vcxproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I will try to solve the errors one by one.
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4215,12): warning C4013: '_chdir' undefined; assuming extern returning int

Add the following code to the line after #include "screen.h" of the act.wizard.c file.
Code:
#ifdef CIRCLE_WINDOWS /* Includes for Win32 */ # ifdef __BORLANDC__ # include <dir.h> # else /* MSVC */ # include <direct.h> # endif #endif /* CIRCLE_WINDOWS */

The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4222,9): warning C4013: 'execl' undefined; assuming extern returning int/

comm.c file extern time_t motdmod; Add the following code to the previous line.
Code:
#ifdef _WIN32 #include <io.h> #else #include <unistd.h> #endif

sysdep.h file Find the code below. You can find it on line 101.
Code:
#ifdef CIRCLE_WINDOWS # include <sys\types.h> #endif

Make the following changes.
Code:
#ifdef CIRCLE_WINDOWS # include <sys\types.h> # include <process.h> #endif

The error below changes the encoding of dg_olc.c or deletes lines 263~281 of the dg_olc.c file.
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_olc.c(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss

The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_triggers.c(407,26): warning C4090: 'function': different 'const' qualifiers

Find the next function. dg_triggers.c file 370 lins
Code:
void act_mtrigger(const char_data *ch, char *str, char_data *actor,
Make the following changes. Removed const from const char_data.
Code:
void act_mtrigger(char_data *ch, char *str, char_data *actor,

dg_scripts.h file 207 lins
Code:
void act_mtrigger(const char_data *ch, char *str,
Change it like this: Removed const from const char_data.
Code:
void act_mtrigger(char_data *ch, char *str,

The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\ibt.c(515,79): warning C4133: 'function': incompatible types - from 'long *' to 'const time_t *const '
Add the following line to the line before #include "conf.h" in the ibt.c file.
Code:
#define _USE_32BIT_TIME_T

The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\improved-edit.c(690,44): warning C4018: '<': signed/unsigned mismatch

Find the following code in the improved-edit.c file at line 690.
Code:
strncpy(replace_buffer, *string, len < max_size - 1 ? len : max_size - 1);
Change it like this: Insert (size_t).
Code:
strncpy(replace_buffer, *string, (size_t)len < max_size - 1 ? len : max_size - 1);

The following error message:
Code:
1>comm.obj : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _game_loop 1>comm.obj : error LNK2019: unresolved external symbol _accept@12 referenced in function _new_descriptor 1>comm.obj : error LNK2019: unresolved external symbol _bind@12 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _close_socket 1>comm.obj : error LNK2019: unresolved external symbol _ioctlsocket@12 referenced in function _nonblock 1>comm.obj : error LNK2019: unresolved external symbol _htonl@4 referenced in function _get_bind_addr 1>comm.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _inet_addr@4 referenced in function _parse_ip 1>comm.obj : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function _get_bind_addr 1>comm.obj : error LNK2019: unresolved external symbol _listen@8 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _perform_socket_read 1>comm.obj : error LNK2019: unresolved external symbol _select@20 referenced in function _game_loop 1>comm.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _perform_socket_write 1>comm.obj : error LNK2019: unresolved external symbol _setsockopt@20 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _gethostbyaddr@12 referenced in function _new_descriptor 1>comm.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _init_socket 1>comm.obj : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function _init_socket

Add the following code to the line before #include "conf.h" in the comm.c file.
Code:
#pragma comment(lib, "Ws2_32.lib")

The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(1391,38): warning C4018: '<=': signed/unsigned mismatch 1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2240,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)' 1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2241,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)'

protocol.c file 1393 lines
Code:
else if ( strlen(apTrigger) <= MaxTriggerLength )
Make the following changes. (int) insert
Code:
else if ( (int)strlen(apTrigger) <= MaxTriggerLength )

2205 lines. find this Function
Code:
static const char *GetMSSP_Players()
Make the following changes. (void) insert
Code:
static const char *GetMSSP_Players(void)

2214 lines. find this Function
Code:
static const char *GetMSSP_Uptime()
Make the following changes. (void) insert
Code:
static const char *GetMSSP_Uptime(void)

The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\spell_parser.c(75,34): warning C4018: '<': signed/unsigned mismatch

Find the following code on line 75 of the spell_parser.c file.
Code:
if (strlen(syls[j].news) < maxlen) {
Make the following changes.
Code:
int str_len = strlen(syls[j].news); if (str_len < maxlen) {

If you rebuild the solution, you won't see all the error messages.

I finished the build, ran the game and logged in.
Then, I entered the typo command.
As I said, the program ended.
I recalled my previous memories.
ANSI codes starting with Q cause problems and terminate the program.
QNRM, QRED, QCYN, QBRED etc

I changed the ANSI code to code starting with K.
KNRM, KRED, KGRN etc

I recompiled, ran the server and connected to the game.
When I entered only the typo command, it worked fine.

However, when I input it with arguments such as
Code:
typo submit test string test test
==> the server was down.

As I said before, this was compiled into an English original, and the typo command was also entered in English.
It was not a Korean language problem.

I think there is a problem with the ACMD (do_ibt) function.
In the following code, problems appear to occur when separating the letter title and subcmd in arg_text.
Code:
arg_text = one_argument(argument, arg); two_arguments(argument, arg, arg2);

I brought the first word from argument to subcmd to change the order of Korean commands.
However, this time I did not change the code for the order of Korean commands.

From the second word, it will be the title or number of the letter.

This is Function returned null.
Code:
first_ibt = get_first_ibt(subcmd);

There seems to be a reason for the error because of that too.

In my opinion, separating the title and command in argument and first_ibt = get_first_ibt(subcmd); I think I need to fix the null return of the function.

The file I used for this compilation is the original file downloaded from tbamud.com. In order to solve the error message that occurs when compiling, only the above-mentioned part was modified and compiled in dubug mode.
Last edit: 15 Sep 2020 08:01 by cry1004.

Please Log in or Create an account to join the conversation.

More
15 Sep 2020 21:08 - 15 Sep 2020 22:08 #9748 by thomas
That was a very detailed recipe for reproducing the problem. I'll see if I can reproduce it locally:

Install MSVC 2019: ok
Add header files: ok
Add source files: ok
Adjust properties so build works: ok

Here, I simply ignored the warnings because I wanted to test if the typo command works:
Code:
1>------ Build started: Project: tbamud, Configuration: Debug Win32 ------ 1>act.comm.c 1>act.informative.c 1>act.item.c 1>act.movement.c 1>act.offensive.c 1>act.other.c 1>act.social.c 1>act.wizard.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\act.wizard.c(4215,12): warning C4013: '_chdir' undefined; assuming extern returning int 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\act.wizard.c(4222,9): warning C4013: 'execl' undefined; assuming extern returning int 1>aedit.c 1>asciimap.c 1>ban.c 1>boards.c 1>bsd-snprintf.c 1>castle.c 1>cedit.c 1>class.c 1>comm.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\comm.c(440,13): warning C4013: 'close' undefined; assuming extern returning int 1>config.c 1>constants.c 1>db.c 1>Generating Code... 1>Compiling... 1>dg_comm.c 1>dg_db_scripts.c 1>dg_event.c 1>dg_handler.c 1>dg_misc.c 1>dg_mobcmd.c 1>dg_objcmd.c 1>dg_olc.c 1>dg_scripts.c 1>dg_triggers.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\dg_triggers.c(407,26): warning C4090: 'function': different 'const' qualifiers 1>dg_variables.c 1>dg_wldcmd.c 1>fight.c 1>genmob.c 1>genobj.c 1>genolc.c 1>genqst.c 1>genshp.c 1>genwld.c 1>genzon.c 1>Generating Code... 1>Compiling... 1>graph.c 1>handler.c 1>hedit.c 1>house.c 1>ibt.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\ibt.c(515,79): warning C4133: 'function': incompatible types - from 'long *' to 'const time_t *const ' 1>improved-edit.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\improved-edit.c(690,44): warning C4018: '<': signed/unsigned mismatch 1>interpreter.c 1>limits.c 1>lists.c 1>magic.c 1>mail.c 1>medit.c 1>mobact.c 1>modify.c 1>msgedit.c 1>mud_event.c 1>oasis.c 1>oasis_copy.c 1>oasis_delete.c 1>oasis_list.c 1>Generating Code... 1>Compiling... 1>objsave.c 1>oedit.c 1>players.c 1>prefedit.c 1>protocol.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\protocol.c(1391,38): warning C4018: '<=': signed/unsigned mismatch 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\protocol.c(2240,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)' 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\protocol.c(2241,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)' 1>qedit.c 1>quest.c 1>random.c 1>redit.c 1>sedit.c 1>shop.c 1>spec_assign.c 1>spec_procs.c 1>spells.c 1>spell_parser.c 1>C:\Users\Thomas\Documents\GitHub\tbamud\src\spell_parser.c(75,34): warning C4018: '<': signed/unsigned mismatch 1>tedit.c 1>utils.c 1>weather.c 1>zedit.c 1>zmalloc.c 1>Generating Code... 1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification 1>tbamud.vcxproj -> C:\Users\Thomas\Documents\GitHub\tbamud\bin\tbamud.exe 1>Done building project "tbamud.vcxproj". ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

And it does:
Code:
500H 100M 82V (news) (motd) > typo Usage: typo submit <header> typo list typo show <num> typo remove <num> typo edit <num> typo resolve <num> 500H 100M 82V (news) (motd) > typo submit testing Write your typo. Instructions: /s to save, /h for more options. ] testing content ] /s Typo saved! 500H 100M 82V (news) (motd) > typo submit several words in the header. And more. ... Write your typo. Instructions: /s to save, /h for more options. ] Testing content. Again. ] /s Typo saved! 500H 100M 82V (news) (motd) > typo list No |Name |Room |Level| Description ---|------------|------|-----|------------------------------------------------- 1|Welcor | 1204| 34| testing 2|Welcor | 1204| 34| several words in the header. And more.... 2 typos in file. 0 resolved, 2 unresolved Typos in RED are unresolved typos. Typos in YELLOW are in-progress typos. Typos in GREEN are resolved typos. You may use typo remove, resolve or edit to change the list.. You may use typo show <number> to see more indepth about the typo.

I think your many linker errors come from missing some dependencies under "project properties > configuration properties > Linker > Input > Additional Dependencies". This is what I have there:
Code:
wsock32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
If you don't change the code to remove the warnings, does it work for you?
Last edit: 15 Sep 2020 22:08 by thomas.
The following user(s) said Thank You: cry1004

Please Log in or Create an account to join the conversation.

More
15 Sep 2020 23:27 - 15 Sep 2020 23:42 #9749 by cry1004
Thanks for the reply

"project properties> configuration properties> Linker> Input> Additional Dependencies" I entered only what you told me and compiled.
Code:
wsock32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)

There was only a warning message when compiling, and it compiled without errors.

I checked the operation of the original English version and tested the Korean version.

All commands work really well.
It must have been because of the Additional Dependencies as you said.
Thank you very much for your willingness to test.

It was just a matter of compilation options, and I wrestled with the code for a few days.
Last edit: 15 Sep 2020 23:42 by cry1004.

Please Log in or Create an account to join the conversation.

Time to create page: 0.248 seconds