Empyrion: Galactic Survival Wiki
Advertisement

Index: GameAPI

Standard: Listing your mod[ | ]

Basic[ | ]

When a player writes in chat '!mods', your mod should list itself.

Proposed implementation[ | ]

Under Game_Event, when receiving Event_ChatMessage, you should check if it is '!mods'

The check should ideally react to any casing. (!Mods, !MODS, !mods alike)

This should only respond to the user, rather than be server-wide.

Pre-req[ | ]

Code sample[ | ]

public void Game_Event(CmdId cmdId, ushort seqNr, object data)
{
try
{
 switch (cmdId)
 {
  case CmdId.Event_ChatMessage:
   ChatInfo ci = (ChatInfo)data;
   if (ci == null) { break; }
   if (ci.type != 8 && ci.type != 7 && ci.msg.ToLower().IndexOf("!mods") == 0)
   {
    ChatMessage(thismod,ci.playerId);
   }
  break;
 } 
}
Advertisement