[Release] MOTD

09/16/2008 20:28 Rechocto#1
For those of you who have ever MUDded, you know what an MOTD is. For those of you who don't.. It's basically a welcome message.

When you log on it sends you whatever lines as your welcome message..

If you don't know where it is, it's in Client.GetPacket() and its above the following lines:

Code:
                                        SendPacket(General.MyPackets.GeneralData(MyChar.UID, 0, 0, 0, 75));
                                        There = true;
Simply replace the welcome lines (above the 2 lines stated above) with :

Code:
                                        System.IO.StreamReader tr = new System.IO.StreamReader(System.Windows.Forms.Application.StartupPath + @"\MOTD.txt");
                                        string A = null;
                                        while((A = tr.ReadLine()) != null ) {
                                            SendPacket(General.MyPackets.SendMsg(MessageId, "System", MyChar.Name, A, 2000));
                                        }
                                        tr.Close();
Then in your Debug folder (or whatever folder your server starts from) add a file called MOTD.txt, and edit it, save it. Now when you want a new welcome message, instead of editing it in your source then recompiling and restarting, you only need edit this file and save it.

Simple, I know, but I have had a look at several sources and none of them do this; so there you have it.
09/16/2008 21:42 -Shoҳ-#2
A motd is something different.
09/16/2008 21:49 taguro#3
This is actually a really good contribution... thanks for sharing this. I've just put it my source.
09/16/2008 21:50 Zanzibar#4
Indeed Gr8 lul
09/16/2008 21:53 glupkotrup#5
@Shox If its different why did ya thanked him? :rolleyes: Just asking!
@Rechoto Nice (alltho already had this but with Welcome.txt xD)
09/16/2008 22:12 -Shoҳ-#6
Quote:
Originally Posted by glupkotrup View Post
@Shox If its different why did ya thanked him? :rolleyes: Just asking!
@Rechoto Nice (alltho already had this but with Welcome.txt xD)
because he did alot of work:p
09/16/2008 22:24 glupkotrup#7
Nope coz you didn't knew how to change the welcome message... I hate ppl who lye! :mad:
09/16/2008 22:28 -Shoҳ-#8
Quote:
Originally Posted by glupkotrup View Post
Nope coz you didn't knew how to change the welcome message... I hate ppl who lye! :mad:
-.- are you damn serious? everyone knows how to change the welcome message
09/16/2008 22:31 glupkotrup#9
Roflmao... I think not everyone... :rolleyes:
09/16/2008 22:32 Rechocto#10
Don't fight, it was a very simple code and some people wouldn't have thought to write it, so I released it :)
09/16/2008 22:43 glupkotrup#11
Lol the guy is too serious... I can't go on like that :D
09/17/2008 00:49 tao4229#12
Good for people who don't know hardly ANYTHING about coding.

+thanks, Not because I need it, and if you think I'm lying, come play my server k? But because some n00ps may need this =D I actually thought about doing this, but doing it in Config.ini :p
09/17/2008 00:54 Zanzibar#13
I wanna play on you......... i mean yourr server :rolleyes:
09/17/2008 00:58 Rechocto#14
pm me for link, zanzibar :)
09/17/2008 01:06 Zanzibar#15
Why cant u pm me the link I r too is are is r lazy r