Пример #1
0
        public override void Initialize()
        {
            tPulse = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));

            //Loading Friends DB
            if (File.Exists(FriendsDB.DefaultFile))
            {
                FriendsList = FriendsDB.Load(FriendsDB.DefaultFile);
            }
            else
            {
                FriendsList.Save(FriendsDB.DefaultFile);
            }


            //Adding commands

            tPulse.Commands.ChatCommands.Add(new Command("", FriendCommand, "friend"));
            tPulse.Commands.ChatCommands.Add(new Command("", MessageCommand, "fmsg"));
            tPulse.Commands.ChatCommands.Add(new Command("", MessageAllCommand, "fall"));
            //Commands.ChatCommands.Add(new Command("", MessageCommand, "sendcoord"));
            tPulse.Commands.OnPlayerLogin += new PlayerLoginHandler(PlayerLogin);
            //Hooks.WorldHooks.SaveWorld += new Hooks.WorldHooks.SaveWorldD(WorldHooks_SaveWorld);
            tPulse.OnWorldSaved += new WorldSavedHandler(OnWorldSaved);
        }
Пример #2
0
        public override void Initialize()
        {
            //Get TPulse instance

            tPulse = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));


            //Commands
            //  /join : to join a channel
            //  /channel : super-command
            //      add : add channel (need group < admin)
            //      del : delete a channel (need group < admin)
            //      list : listing
            //  /cmsg : send a message in the channel
            //can be null be aware !

            tPulse.Commands.ChatCommands.Add(new Command("", JoinCommand, "join"));
            tPulse.Commands.ChatCommands.Add(new Command("", LeaveCommand, "leave"));
            tPulse.Commands.ChatCommands.Add(new Command("", ChannelCommand, "channel"));
            tPulse.Commands.ChatCommands.Add(new Command("", ChannelMessage, "cmsg"));

            DefaultChannel = Manager.DefaultChannel;

            Channels.AddRange(Manager.ChatChannels);

            //Connection hooks

            tPulse.OnPlayerJoin  += new PlayerConnectionHandler(PlayerJoinServer);
            tPulse.OnPlayerLeave += new PlayerConnectionHandler(PlayerLeaveServer);

            //World Saved Hooks

            tPulse.OnWorldSaved += new WorldSavedHandler(OnWorldSaved);
        }
Пример #3
0
 public TChatChannels(Main game)
     : base(game)
 {
     AutoJoin = true;
     PlugInHandler.AddPlugIn(this);
     Manager = new ChannelManager();
 }
Пример #4
0
        internal static void CreateHttpClient(ref HttpClient httpClient)
        {
            if (httpClient != null)
            {
                httpClient.Dispose();
            }

            // HttpClient functionality can be extended by plugging multiple handlers together and providing
            // HttpClient with the configured handler pipeline.
            HttpMessageHandler handler = new HttpClientHandler();
            handler = new PlugInHandler(handler); // Adds a custom header to every request and response message.            
            httpClient = new HttpClient(handler);

            // The following line sets a "User-Agent" request header as a default header on the HttpClient instance.
            // Default headers will be sent with every request sent from this HttpClient instance.
            //httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("Sample", "v8"));
        }
Пример #5
0
        public override void Initialize()
        {
            tPulse  = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));
            Setting = ArenaSetting.Load(ArenaSettingFile);
            //todo

            //commands
            tPulse.Commands.ChatCommands.Add(new Command("", SetPrepare, "asetprepare"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetTeamStart, "asetstart"));
            tPulse.Commands.ChatCommands.Add(new Command("", PreparePlayers, "aprepare"));
            tPulse.Commands.ChatCommands.Add(new Command("", AssignPlayerTeam, "aassign"));
            tPulse.Commands.ChatCommands.Add(new Command("", ResetTeams, "areset"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetArenaHall, "asethall"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetAterMatch, "asetroom"));

            Hooks.GameHooks.Update += new Action(GameHooks_Update);

            //Team Color
            //Console.WriteLine(Main.teamColor.Length);
            Main.teamColor[1] = Color.Blue;
            Main.teamColor[2] = Color.Pink;
        }
Пример #6
0
 public TArena(Main game)
     : base(game)
 {
     PlugInHandler.AddPlugIn(this);
 }
Пример #7
0
 public override void Initialize()
 {
     tPulse = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));
     //chat commands to add
 }
Пример #8
0
 public TFriends(Main game) : base(game)
 {
     PlugInHandler.AddPlugIn(this);
 }
Пример #9
0
 public TPluginSample(Main game)
     : base(game)
 {
     PlugInHandler.AddPlugIn(this);
 }