Jump to content

Global Chat c++ compile error


Recommended Posts

Hello,

i have a problem to compile my game.

Error:

 

input_main.cpp: In member function 'int CInputMain::Chat(CHARACTER*, const char*                      , size_t)':
input_main.cpp:744: error: 'global_chat' was not declared in this scope
input_main.cpp:803: error: 'pack_chat' was not declared in this scope
input_main.cpp:815: error: 'pack_chat' was not declared in this scope
input_main.cpp:833: error: 'pack_chat' was not declared in this scope
input_main.cpp:860: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:865: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:872: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:890: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:909: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:917: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:924: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:930: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:936: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:942: error: a function-definition is not allowed here before '{'                       token
input_main.cpp:3376: error: expected `}' at end of input
compile item_manager.cpp
input_main.cpp: At global scope:
input_main.cpp:48: warning: 'int __deposit_limit()' defined but not used
gmake: *** [OBJDIR/input_main.o] Error 1
gmake: *** Waiting for unfinished jobs....
In file included from item.cpp:22:
belt_inventory_helper.h: In static member function 'static BYTE CBeltInventoryHe                      lper::GetBeltGradeByRefineLevel(int)':
belt_inventory_helper.h:28: warning: comparison between signed and unsigned inte                      ger expressions

 

 

 

my input_main.cpp

		ch->SetLastShoutPulse(thecore_heart->pulse);

			if(global_chat)
			{
				char buf[256];
				char chatbuf_global[CHAT_MAX_LEN + 1];
				const BYTE char_empire = ch->GetEmpire();
				if (ch->GetGMLevel() != GM_PLAYER)
				{
					strlcpy(buf, LC_TEXT("Staff"), sizeof(buf));
					std::string staff_color = "|cFFFFC700|H|h[";
					staff_color += buf;
					staff_color += "]|cFFA7FFD4|H|h";
					sprintf(chatbuf_global, "%s %s", staff_color.c_str(), chatbuf);
				}
				else if (char_empire == 1)
				{
					strlcpy(buf, LC_TEXT("Shinsoo"), sizeof(buf));
					std::string kingdom_red = "|cFFff0000|H|h[";
					kingdom_red += buf;
					kingdom_red += "]|cFFA7FFD4|H|h";
					sprintf(chatbuf_global, "%s %s", kingdom_red.c_str(), chatbuf);
				}
				else if (char_empire == 2)
				{
					strlcpy(buf, LC_TEXT("Chunjo"), sizeof(buf));
					std::string kingdom_yel = "|cFFFFFF00|H|h[";
					kingdom_yel += buf;
					kingdom_yel += "]|cFFA7FFD4|H|h";
					sprintf(chatbuf_global, "%s %s", kingdom_yel.c_str(), chatbuf);
				}
				else if (char_empire == 3) {
					strlcpy(buf, LC_TEXT("Jinno"), sizeof(buf));
					std::string kingdom_blue = "|cFF0080FF|H|h[";
					kingdom_blue += buf;
					kingdom_blue += "]|cFFA7FFD4|H|h";
					sprintf(chatbuf_global, "%s %s", kingdom_blue.c_str(), chatbuf);
				}
				
				TPacketGGShout p;

				p.bHeader = HEADER_GG_SHOUT;
				p.bEmpire = char_empire;
				strlcpy(p.szText, chatbuf_global, sizeof(p.szText));

				P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));

				SendShout(chatbuf_global, ch->GetEmpire());

				return (iExtraLen);
			}

7157dcf641.png

 

I hope somebody can help me with this error.

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.