2017-05-26 18:49:27 -04:00
|
|
|
|
using System;
|
|
|
|
|
using SharedLibrary;
|
2017-05-27 00:22:50 -04:00
|
|
|
|
using SharedLibrary.Interfaces;
|
2017-05-26 18:49:27 -04:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Welcome_Plugin
|
|
|
|
|
{
|
|
|
|
|
public class Plugin : IPlugin
|
|
|
|
|
{
|
|
|
|
|
public string Author
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "RaidMax";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float Version
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return 1.0f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Welcome Plugin";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-27 18:08:04 -04:00
|
|
|
|
public async Task OnLoadAsync()
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-27 18:08:04 -04:00
|
|
|
|
public async Task OnUnloadAsync()
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-27 18:08:04 -04:00
|
|
|
|
public async Task OnTickAsync(Server S)
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-27 18:08:04 -04:00
|
|
|
|
public async Task OnEventAsync(Event E, Server S)
|
2017-05-26 18:49:27 -04:00
|
|
|
|
{
|
|
|
|
|
if (E.Type == Event.GType.Connect)
|
|
|
|
|
{
|
|
|
|
|
Player newPlayer = E.Origin;
|
|
|
|
|
|
|
|
|
|
if (newPlayer.Level >= Player.Permission.Trusted && !E.Origin.Masked)
|
|
|
|
|
await E.Owner.Broadcast(Utilities.levelToColor(newPlayer.Level) + " ^5" + newPlayer.Name + " ^7has joined the server.");
|
|
|
|
|
|
|
|
|
|
if (newPlayer.Level == Player.Permission.Flagged)
|
|
|
|
|
await E.Owner.ToAdmins($"^1NOTICE: ^7Flagged player ^5{newPlayer.Name}^7 has joined!");
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CountryLookupProj.CountryLookup CLT = new CountryLookupProj.CountryLookup("Plugins/GeoIP.dat");
|
|
|
|
|
await E.Owner.Broadcast($"^5{newPlayer.Name} ^7hails from ^5{CLT.lookupCountryName(newPlayer.IP)}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|