EOSERV Forum > EOSERV > A useful edit..
Topic is locked.
Page: << 1 >>
A useful edit..
Author Message
Post #1291 A useful edit..

It sucks how you can only change news by recompiling.. So I changed that.. If you want to edit it also do the following:


Open welcome.cpp Which is in src/handlers/ 

First add this to the top of the file:
#include <string>
using namespace std;

Now, find the part with the welcome messages.. and replace the first 5 with this:

reply.AddBreakString(static_cast<string>(admin_config["globmess1"])); // shown in the scr tab
reply.AddBreakString(static_cast<string>(admin_config["globmess2"]));
reply.AddBreakString(static_cast<string>(admin_config["globmess3"]));
reply.AddBreakString(static_cast<string>(admin_config["globmess4"]));
reply.AddBreakString(static_cast<string>(admin_config["globmess5"]));

You can add more if you want, just adding more to the admin.ini later.. But 5 should be enough, note that the first one displays in the src tab.

Now goto your admin.ini file and add this:

## Global Messages ##

# Note - Message 1 - Displays in SRC

globmess1 = Message displayed in SCR tab (usually a welcome!)
globmess2 = News Message 1
globmess3 = News Message 2
globmess4 = News Message 3
globmess5 = News Message 4

-- 

I just thougt this would be easier than compiling everytime you have news.

Questions, comments, post.
15 years, 8 weeks ago
Post #1293 Re: A useful edit..

I got these errors

..srchandlersWelcome.cpp||In member function `bool EOClient::Handle_Welcome(int, PacketReader&)':|
..srchandlersWelcome.cpp|158|error: `string' has not been declared|
..srchandlersWelcome.cpp|159|error: `string' has not been declared|
..srchandlersWelcome.cpp|160|error: `string' has not been declared|
..srchandlersWelcome.cpp|161|error: `string' has not been declared|
..srchandlersWelcome.cpp|162|error: `string' has not been declared|
..srchandlersWelcome.cpp|163|error: `string' has not been declared|
..srchandlersWelcome.cpp|164|error: `string' has not been declared|
..srchandlersWelcome.cpp|165|error: `string' has not been declared|
..srchandlersWelcome.cpp|166|error: `string' has not been declared|
..srchandlersWelcome.cpp|167|error: `string' has not been declared|
||=== Build finished: 10 errors, 0 warnings ===|


Fixed :D

there was errors in your code i fixed it for you

reply.AddBreakString(static_cast<std::string>(admin_config["globmess1"])); // shown in the scr tab
reply.AddBreakString(static_cast<std::string>(admin_config["globmess2"]));
reply.AddBreakString(static_cast<std::string>(admin_config["globmess3"]));
reply.AddBreakString(static_cast<std::string>(admin_config["globmess4"]));
reply.AddBreakString(static_cast<std::string>(admin_config["globmess5"]));
15 years, 8 weeks ago
Post #1308 Re: A useful edit..

There wasn't an error, you didn't add:


#include<string>
using namespace std;

to the top.
15 years, 8 weeks ago
Post #1309 Re: A useful edit..
Arcitex posted: (20th Mar 2009 11:42 am)

There wasn't an error, you didn't add:


#include<string>
#include <iostream>

to the top.
No, the problem was you forgot to put std:: before string; and why are you including iostream?

15 years, 8 weeks ago
Post #1311 Re: A useful edit..

so does this work?

15 years, 8 weeks ago
Post #1320 Re: A useful edit..
Sausage posted: (20th Mar 2009 11:44 am)

Arcitex posted: (20th Mar 2009 11:42 am)

There wasn't an error, you didn't add:


#include<string>
#include <iostream>

to the top.
No, the problem was you forgot to put std:: before string; and why are you including iostream?



Rofl, I posted that right before school.. I c & p'd the wrong thing.. I meant to put: using namespace std;
15 years, 8 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > A useful edit..