Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help threading remove
#1
hey there. i were working at an cmd/plugin called moderator rules, but then i released it on an forum did the admin there said to me: "using System Threading; will crash the server, so i dont want to use it. sorry"
PHP Code:
using System.IO;
using System.Threading;
using Addon;

namespace 
Rules
{
    public class 
Rules CPlugin
    
{
        
string[] rules = { "" };
        public 
override void OnServerLoad()
        {
            
rules File.ReadAllLines("addon\\rules.txt");
            
ServerPrint("ModRules plugin by EnVi Sweden Rocks");
        }

        public 
override ChatType OnSay(string MessageServerClient Client)
        {
            
ServerPrint(Client.Name ": " Message);
            if (!
Message.StartsWith("!modrules"))
            {
                return 
ChatType.ChatContinue;
            }
            
Message.Split(new char[]
            {
                
' '
            
});

            {
                
Thread shru = new Thread(ShowRules);
                
shru.Start(Client);
                return 
ChatType.ChatNone;
            }
            return 
ChatType.ChatGame;
        }

        private 
void ShowRules(object cli)
        {
            
ServerClient sc = (ServerClient)cli;
            foreach (
string rule in rules)
            {
                
Thread.Sleep(1000);
                
TellClient(sc.ClientNum"[^1RULES^7]: " ruletrue);
                
ServerPrint("console to " sc.Name ": " "[^1RULES^7]: " rule);
            }
        }
    }


is it possible to remove System Threading and change it?
Reply

#2
I really doubt if you created this yourself considering you don't even understand what threading is.
Eitherway, Use ThreadPool or master131's Timing class (found in the mw3 server addon extensions)
Reply

#3
Well. I'm an new coder (newbie) and need to learn stuffs.
Reply

#4
So you re-release plugins with changed credits?
Yea, I'm sure that'll be a educational experience.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Is it safe exactly when i remove the battery from the laptop? checkitnowa 2 3,167 09-13-2013, 08:15
Last Post: CJGreenLabel
  Help remove timer Dynasty 15 8,307 08-25-2013, 13:56
Last Post: hillbilly
  how to remove commands in the chat ExoGamer* 6 4,452 07-20-2013, 09:24
Last Post: Pozzuh
  Help Remove Death Barriers? Help Please! camxxcore 1 2,566 06-28-2013, 09:38
Last Post: Yamato
  Help Removing threading hillbilly 4 3,502 01-02-2013, 07:49
Last Post: hillbilly
  Help Remove Threading/tidyup hillbilly 4 4,587 09-16-2012, 11:09
Last Post: zxz0O0
  [Request] plugin to remove all secondary ammo ALEXFDR 1 2,360 09-08-2012, 23:32
Last Post: Nekochan
  Remove mini map moosa67 2 2,599 08-22-2012, 21:26
Last Post: Nukem
  how to remove the boot dlc Beliy.IV 0 1,879 07-02-2012, 18:16
Last Post: Beliy.IV
  Remove Thread worldclass 1 2,142 06-22-2012, 22:39
Last Post: surtek

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.