This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TUTORIAL] Own server messages in the alert box on login scr  (Read 15689 times)

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
[TUTORIAL] Own server messages in the alert box on login scr
« on: August 21, 2011, 01:11:13 pm »
Because some guys ask, here is a little hint how to have your own server messages in the login screen.
You need a webserver on port 80 where you can put the message text file the client will load on every startup.

- Setup a new folder called alert on the root of your webserver.
- Put an index.htm or an index.php if you want to generate the news from a database there.
- Add the messages to this file in the following form.

Code: [Select]
<html><body>
SERVERALERT:
<p>TEST1<br />Message number 1<br />Message number 1 Line2<br /><br /></p>
<p>TEST2<br />Message number 2<br />Message number 2 Line2<br /><br /></p>
</body></html>

- You have to be careful. The WoW HTML renderer (CSimpleHTML) does not support many HTML commands. So test your output after every change.
- Add the file InterfaceGlueXMLGlueStrings.lua to your patch if not already done.
- Open it and search the string SERVER_ALERT_URL and set it to your server's URL.
- Now create your MPQ and start the client.
- Be aware that this file is not language neutral. Adding it to your patch will get the people using your patch the same language at glue screens as you have. You may want to have multiple patches like this for every language or do the edit in a language neutral file.

If you are skilled in php you can create the messages from a forum DB or one you setup and fill yourself.


http://is.gd/3MdmKx
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

doresain

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 202
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #1 on: August 21, 2011, 05:46:43 pm »
you need an unlocked wow.exe binary for this
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #2 on: August 24, 2011, 09:06:44 pm »
You need to unlock for all interface cahnges. So i think everyone will have it :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Laniax

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 62
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #3 on: August 25, 2011, 12:14:20 am »
You could also do this without an MPQ.

You can simple add a entry in your hosts file that changes launcher.worldofwarcraft.com to your own webhost, which has a index.html/php file that has the above info. Works exactly the same way, except you do the redirection inside windows, and not inside the WoW GLUE files.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Current project: AIO Emulation solution.

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #4 on: August 25, 2011, 01:27:16 am »
Quote from: "Laniax"
You could also do this without an MPQ.

You can simple add a entry in your hosts file that changes launcher.worldofwarcraft.com to your own webhost, which has a index.html/php file that has the above info. Works exactly the same way, except you do the redirection inside windows, and not inside the WoW GLUE files.

Do you really want to let your users edit a file with the possibility to hijack every access to remote resources of the system instead of distributing a change inside an MPQ, you will most likely ship anyway as you have modded stuff?

Editing the host-file is nothing one should do for reasons like this. You don't edit the hosts file instead of changing the realmlist, do you?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #5 on: August 25, 2011, 12:09:23 pm »
And if you paly on different servers this will not work. All clients you start will show the messages of the one setup in the hosts file.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Laniax

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 62
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #6 on: August 25, 2011, 10:53:15 pm »
Both of you are correct, im just saying this as there is a non-mpq solution if someone searches that. It can be done by a custom launcher so users cant fuck it up. I never said it would be a better way of doing.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Current project: AIO Emulation solution.

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login scr
« Reply #7 on: August 29, 2011, 10:27:57 pm »
Quote from: "Laniax"
Both of you are correct, im just saying this as there is a non-mpq solution if someone searches that. It can be done by a custom launcher so users cant fuck it up. I never said it would be a better way of doing.
That file should be only writable by an admin, so requiring that for your launcher is not really good. ;)

Btw: An public repository for your server? Nice.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Meiya Stormsinger

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 9
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #8 on: June 14, 2012, 09:29:31 am »
I am currently using this on my login UI, but there's a problem...

Html tags won't register, I have a file named index.html, yet when I use the <html> tags, it actually shows up in the window, so only plain text works, any ideas?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #9 on: June 14, 2012, 01:09:25 pm »
You only cna use a very low set of tags. Even bold or strong dont work. I think it was only hr and br. Thats it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

mathex

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 24
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #10 on: April 20, 2013, 09:37:25 pm »
Hello, I've now followed this tutorial 100% and I get an error where it says that I need to re install WoW, I've narrowed it down to being whenever I edit an interface file. So I was wondering if any of you as mentioned above have a download link for a "unlocked" wow.exe or mind explaining how to do that? Thank you very much :-)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

mathex

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 24
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #12 on: April 20, 2013, 09:47:48 pm »
Quote from: "Ascathos"
http://modcraft.io/viewtopic.php?f=59&t=883

Thank you very much, Sir.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #13 on: April 21, 2013, 05:50:11 pm »
I'm struggling to get this to work for some reason.

I know the URL is visited because I have this code:

Code: [Select]
SERVERALERT:TESTING
<?php

$myFile 
"test.txt";
$fh fopen($myFile'w') or die("can't open file");
fwrite($fh"TESTING THIS");
fclose($fh);

/*"SERVERALERT:
<html><body>
<p>TEST1<br />Message number 1<br />Message number 1 Line2<br /><br /></p>
<p>TEST2<br />Message number 2<br />Message number 2 Line2<br /><br /></p>
</body></html>*/
?>


The text file is created and written to when I start WoW up.

However, the event is never fired:
Code: [Select]
function AccountLogin_OnEvent(event, arg1, arg2, arg3)
if ( event == "SHOW_SERVER_ALERT" ) then
ServerAlertText:SetText(arg1);
ServerAlertFrame:Show();
This snippet of code is never called, so the text is never updated and the frame never shown.

I did find I had to edit both:
Code: [Select]
GlueLocalization.lua
GlueStrings.lua
Both files contain SERVER_ALERT_URL's that need to be modified - as the localisation one is loaded after the GlueStrings.lua one and thus overwrites it. The GlueStrings.Lua will only overwrite it if the GlueLocalization.lua is not included in your patch, because your custom patch is loaded last.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL] Own server messages in the alert box on login
« Reply #14 on: April 23, 2013, 06:21:03 am »
Ok thanks nice tip stoneharry.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954