Browse Source

Added "showjoin" game command

pull/3/head
JustinAJ 10 years ago
parent
commit
21011df5ee
  1. 28
      RenX.SetJoin/RenX_SetJoin.cpp
  2. 1
      RenX.SetJoin/RenX_SetJoin.h

28
RenX.SetJoin/RenX_SetJoin.cpp

@ -61,6 +61,34 @@ const Jupiter::ReadableString &ViewJoinGameCommand::getHelp(const Jupiter::Reada
GAME_COMMAND_INIT(ViewJoinGameCommand)
// ShowJoin Game Command
void ShowJoinGameCommand::create()
{
this->addTrigger(STRING_LITERAL_AS_REFERENCE("showjoin"));
this->addTrigger(STRING_LITERAL_AS_REFERENCE("shjoin"));
}
void ShowJoinGameCommand::trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString &parameters)
{
if (player->uuid.isEmpty() == false)
{
const Jupiter::ReadableString &setjoin = Jupiter::IRC::Client::Config->get(configSection, player->uuid);
if (setjoin.isEmpty() == false)
source->sendMessage(Jupiter::StringS::Format("[%.*s] %.*s", player->name.size(), player->name.ptr(), setjoin.size(), setjoin.ptr()));
else source->sendMessage(player, STRING_LITERAL_AS_REFERENCE("Error: No setjoin found."));
}
else source->sendMessage(player, STRING_LITERAL_AS_REFERENCE("Error: A setjoin message requires steam."));
}
const Jupiter::ReadableString &ShowJoinGameCommand::getHelp(const Jupiter::ReadableString &)
{
STRING_LITERAL_AS_NAMED_REFERENCE(defaultHelp, "Displays your join message. Syntax: showjoin");
return defaultHelp;
}
GAME_COMMAND_INIT(ShowJoinGameCommand)
// DelJoin Game Command
void DelJoinGameCommand::create()

1
RenX.SetJoin/RenX_SetJoin.h

@ -36,6 +36,7 @@ private:
GENERIC_GAME_COMMAND(SetJoinGameCommand)
GENERIC_GAME_COMMAND(ViewJoinGameCommand)
GENERIC_GAME_COMMAND(ShowJoinGameCommand)
GENERIC_GAME_COMMAND(DelJoinGameCommand)
#endif // _RENX_SETJOIN_H_HEADER
Loading…
Cancel
Save