1
0

Made MagicCarpet more magical!

This commit is contained in:
Tiger Wang 2013-10-04 22:22:01 +01:00
parent 55e6963107
commit 914a318b8e
3 changed files with 33 additions and 7 deletions

View File

@ -0,0 +1,28 @@
IniFile = cIniFile( "settings.ini" )
IniFile:ReadFile()
UsePrefixes = IniFile:GetValueSet( "Messaging", "Prefixes", "true" )
IniFile:WriteFile()
function SendMessage(a_Player, a_Message)
if (UsePrefixes) then
a_Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. a_Message)
else
a_Player:SendMessage(cChatColor.Yellow .. a_Message)
end
end
function SendMessageSuccess(a_Player, a_Message)
if (UsePrefixes) then
a_Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. a_Message)
else
a_Player:SendMessage(cChatColor.Green .. a_Message)
end
end
function SendMessageFailure(a_Player, a_Message)
if (UsePrefixes) then
a_Player:SendMessage(cChatColor.Red .. "[INFO] " .. cChatColor.White .. a_Message)
else
a_Player:SendMessage(cChatColor.Red .. a_Message)
end
end

View File

@ -33,17 +33,15 @@ end
function HandleCarpetCommand( Split, Player )
Carpet = Carpets[ Player ]
PluginManager = cPluginManager:Get()
local Core = PluginManager:GetPlugin("Core")
if( Carpet == nil ) then
Carpets[ Player ] = cCarpet:new()
Core:Call("SendMessageSuccess", Player, "You're on a magic carpet!")
Core:Call("SendMessage", Player, "Look straight down to descend. Jump to ascend.")
SendMessageSuccess(Player, "You're on a magic carpet!")
SendMessage(Player, "Look straight down to descend. Jump to ascend.")
else
Carpet:remove()
Carpets[ Player ] = nil
Core:Call("SendMessageSuccess", Player, "The carpet vanished!")
SendMessageSuccess(Player, "The carpet vanished!")
end
return true

View File

@ -321,7 +321,7 @@ void cServer::OnConnectionAccepted(cSocket & a_Socket)
return;
}
LOG("Client \"%s\" connected!", ClientIP.c_str());
LOGD("Client \"%s\" connected!", ClientIP.c_str());
cClientHandle * NewHandle = new cClientHandle(&a_Socket, m_ClientViewDistance);
if (!m_SocketThreads.AddClient(a_Socket, NewHandle))