Register for your free account! | Forgot your password?

You last visited: Today at 20:46

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Request]Broadcast timer O.O

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
[Request]Broadcast timer O.O

umm could any one help me with a broadcast timer...i want it to go like that "if "Broadcast timer = #" then it would send your msg O.O lets say person #1 send a msg then person #2 sends a msg right after him....the timer will stop it for like 10 secs and then release it O.O any ideas? thx =)



BlooD-BoY is offline  
Old   #2
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,875
So you want a queued broadcast? Like after 10 seconds (or more) if a message is pending, the next message gets appended to (sent)? If so...

Code:
//requires
//using System.Threading;
//using System.Collections.Generic;

// call BroadcastQueue.Init() when the server starts up

    public class BroadcastQueue
    {
        private static Queue<byte[]> Queue;

        private static void ExportGlobalPacket(byte[] Packet)
        {
            // method to send the packet to everyone on the server
        }
        public static void Init()
        {
            Queue = new Queue<byte[]>();
            new Thread(
                delegate()
                {
                    while (true)
                    {
                        const int Ten_Seconds = 10 * 1000;
                        byte[] Outgoing;
                        lock (Queue)
                        {
                            Outgoing = Queue.Dequeue();
                        }
                        ExportGlobalPacket(Outgoing);
                        Thread.Sleep(Ten_Seconds);
                    }
                }
            ).Start();
        }
        public static void Add(byte[] BroadcastMsgPacket)
        {
            lock (Queue)
            {
                Queue.Enqueue(BroadcastMsgPacket);
            }
        }
    }


InfamousNoone is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Request] Timer-Freeze
Is it possible to freeze/increase/lower the time in matches? Like say your playing touchdown, the game would keep going until one team scored...
7 Replies - S4 League
Request: War Timer Alarm
Hey I was wondering if anyone had made a program that makes an alarm go off when war is near... this would be useful for people who dont wanna have...
5 Replies - 12Sky2
[Request]CountDown timer
Hey, Can I request the code for a 10 minute countdown timer like Timer T = new timer(); int minutes = 10; int seconds = 0; T.Start();...
11 Replies - CO2 PServer - Discussions / Questions
[REQUEST~GUIDE]How to make a Timer
Hei all, i need a guide to make a timer, ive made the start but i want to end it if (DateTime.Now.DayOfWeek...
1 Replies - CO2 PServer - Discussions / Questions
Request Unlimited Party Timer
Is there a mod or something you can change to make the party unlimited?
15 Replies - Mabinogi



All times are GMT +2. The time now is 20:46.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.