Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
essentials.Subsystems.Chat.WorldChatPlugin Class Reference
Inheritance diagram for essentials.Subsystems.Chat.WorldChatPlugin:
essentials.Subsystems.Chat.IChatCommandHandler

Public Member Functions

 WorldChatPlugin (IChatServer server)
 
bool Handle (IUser fromUser, string command, string[] args)
 

Properties

IWorldStateServer WorldState [get]
 

Constructor & Destructor Documentation

essentials.Subsystems.Chat.WorldChatPlugin.WorldChatPlugin ( IChatServer  server)
15  {
16  this.InjectDependencies();
17  _server = server;
18  }

Member Function Documentation

bool essentials.Subsystems.Chat.WorldChatPlugin.Handle ( IUser  fromUser,
string  command,
string[]  args 
)

Attribute: 0

));

Attribute: 0

));

Attribute: 0

));

Implements essentials.Subsystems.Chat.IChatCommandHandler.

22  {
23  if (fromUser.UserAuthenticationLevel >= UserAuthLevel.Moderator && args.Length >= 1)
24  {
25  switch (command)
26  {
27  case "time":
28  try
29  {
30  this.WorldState.SetTime(double.Parse(args[0]));
31  _server.BroadcastSystemMessage("Server time set to {0}", this.WorldState.Time);
32  }
33  catch
34  {
35  _server.SendDirectedMessage(fromUser, "Unable to set time");
36  }
37  return true;
38 
39  case "skip":
40  try
41  {
42  this.WorldState.SkipTime(double.Parse(args[0]));
43  _server.BroadcastSystemMessage("Server time set to {0}", this.WorldState.Time);
44  }
45  catch
46  {
47  _server.SendDirectedMessage(fromUser, "Unable to skip time");
48  }
49  return true;
50 
51  case "speed":
52  try
53  {
54  this.WorldState.SetSpeed(double.Parse(args[0]));
55  _server.BroadcastSystemMessage("Server speed set to {0}", this.WorldState.Speed);
56  }
57  catch
58  {
59  _server.SendDirectedMessage(fromUser, "Unable to set speed");
60  }
61  return true;
62  }
63  }
64  return false;
65  }
IWorldStateServer WorldState
Definition: WorldChatPlugin.cs:10
void SendDirectedMessage(string username, string msg, params object[] args)
double Speed
Gets the speed of the ingame clock
Definition: IGameTime.cs:21
void BroadcastSystemMessage(string msg, params object[] args)
UserAuthLevel UserAuthenticationLevel
The authentication level of a user
Definition: IUser.cs:44
UserAuthLevel
User authentication level
Definition: UserAuthLevel.cs:8
double Time
The current in-game clock time
Definition: IGameTime.cs:15

Property Documentation

IWorldStateServer essentials.Subsystems.Chat.WorldChatPlugin.WorldState
getprotected

Attribute: Dependency


The documentation for this class was generated from the following file: