Cleanup /gcrules.

This commit is contained in:
UnknownShadow200 2016-03-25 09:35:56 +11:00
parent 4e78c32497
commit 6f06dff408
4 changed files with 28 additions and 48 deletions

View File

@ -1,19 +1,19 @@
/*
Copyright 2011 MCForge
Dual-licensed under the Educational Community License, Version 2.0 and
the GNU General Public License, Version 3 (the "Licenses"); you may
not use this file except in compliance with the Licenses. You may
obtain a copy of the Licenses at
http://www.opensource.org/licenses/ecl2.php
http://www.gnu.org/licenses/gpl-3.0.html
Unless required by applicable law or agreed to in writing,
software distributed under the Licenses are distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
Copyright 2011 MCForge
Dual-licensed under the Educational Community License, Version 2.0 and
the GNU General Public License, Version 3 (the "Licenses"); you may
not use this file except in compliance with the Licenses. You may
obtain a copy of the Licenses at
http://www.opensource.org/licenses/ecl2.php
http://www.gnu.org/licenses/gpl-3.0.html
Unless required by applicable law or agreed to in writing,
software distributed under the Licenses are distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the Licenses for the specific language governing
permissions and limitations under the Licenses.
*/
using System;
namespace MCGalaxy.Commands
@ -26,31 +26,12 @@ namespace MCGalaxy.Commands
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public CmdGcrules() { }
//bla
public override void Use(Player p, string message)
{
RulesMethod(p);
p.Readgcrules = true;
p.Timereadgcrules = DateTime.Now;
public override void Use(Player p, string message) {
CmdGlobal.ShowRules(p, false);
}
public void RulesMethod(Player p)
{
Player.SendMessage(p, "&cBy using the Global Chat you agree to the following rules:");
Player.SendMessage(p, "1. No Spamming");
Player.SendMessage(p, "2. No Advertising (Trying to get people to come to your server)");
Player.SendMessage(p, "3. No links");
Player.SendMessage(p, "4. No Excessive Cursing (You are allowed to curse, but not pointed at anybody)");
Player.SendMessage(p, "5. No use of $ Variables.");
Player.SendMessage(p, "6. English only. No exceptions.");
Player.SendMessage(p, "7. Be respectful");
Player.SendMessage(p, "8. Do not ask for ranks");
Player.SendMessage(p, "9. Do not ask for a server name");
Player.SendMessage(p, "10. Use common sense.");
Player.SendMessage(p, "11. Don't say any server name");
}
public override void Help(Player p)
{
public override void Help(Player p) {
Player.SendMessage(p, "/gcrules - Shows global chat rules");
Player.SendMessage(p, "To chat in global chat, use /global");
}

View File

@ -43,14 +43,14 @@ namespace MCGalaxy.Commands
if (p.muted) { Player.SendMessage(p, "You are muted."); return; }
if (p.ignoreGlobalChat || p.ignoreAll) { Player.SendMessage(p, "You cannot use Global Chat while you have it muted."); return; }
if (Server.chatmod && !p.voice) { Player.SendMessage(p, "You cannot use Global Chat while in Chat Moderation!"); return; }
if (!Server.gcaccepted.Contains(p.name.ToLower())) { RulesMethod(p); return; }
if (!Server.gcaccepted.Contains(p.name.ToLower())) { ShowRules(p, true); return; }
} //Server.GlobalChat.Say((p != null ? p.name + ": " : "Console: ") + message, p);
Server.GlobalChat.Say(p == null ? "Console: " + message : p.name + ": " + message, p);
Player.GlobalMessage("%G<[Global] " + (p != null ? p.name + ": " : "Console: ") + "&f" + (Server.profanityFilter ? ProfanityFilter.Parse(message) : message), true);
}
public void RulesMethod(Player p)
{
public static void ShowRules(Player p, bool showAccept) {
Player.SendMessage(p, "&cBy using the Global Chat you agree to the following rules:");
Player.SendMessage(p, "1. No Spamming");
Player.SendMessage(p, "2. No Advertising (Trying to get people to your server)");
@ -63,10 +63,11 @@ namespace MCGalaxy.Commands
Player.SendMessage(p, "9. Do not ask for a server name");
Player.SendMessage(p, "10. Use common sense.");
Player.SendMessage(p, "11. Don't say any server name");
Player.SendMessage(p, "&3Type /gcaccept to accept these rules");
if (showAccept)
Player.SendMessage(p, "&3Type /gcaccept to accept these rules");
}
public override void Help(Player p)
{
public override void Help(Player p) {
Player.SendMessage(p, "/global [message] - Send a message to Global Chat.");
}
}

View File

@ -264,7 +264,7 @@ namespace MCGalaxy {
{
if (!IPInPrivateRange(ip))
{
Kick("Login failed! Try again.", true); return;
Kick("Login failed! Try signing in again.", true); return;
}
}
}

View File

@ -335,8 +335,6 @@ namespace MCGalaxy {
prefix = (title == "") ? prefix : prefix + color + "[" + titlecolor + title + color + "] ";
}
public bool Readgcrules = false;
public DateTime Timereadgcrules = DateTime.MinValue;
public bool CheckIfInsideBlock() {
ushort x = (ushort)(pos[0] / 32), y = (ushort)(pos[1] / 32), z = (ushort)(pos[2] / 32);
byte head = level.GetTile(x, y, z);