Ejemplo n.º 1
0
        public static byte[] AddCommentMessage(SectionController controller, CommentInfo comment)
        {
            var message = new MessageWriter();

            message.AddUint8((byte)Controller.Section);
            message.AddUint8((byte)SectionMsg.AddComment);
            message.AddString(controller.name);
            message.AddBinary(comment.toBinary());
            return(message.ToBuffer());
        }
Ejemplo n.º 2
0
        public static byte[] MoveToTopThreadMessage(SectionController controller, ThreadInfo thread)
        {
            var message = new MessageWriter();

            message.AddUint8((byte)Controller.Section);
            message.AddUint8((byte)SectionMsg.MoveThreadToTop);
            message.AddString(controller.name);
            message.AddUint32((uint)thread.id);
            return(message.ToBuffer());
        }
Ejemplo n.º 3
0
        public static byte[] AddThreadMessage(SectionController controller, ThreadInfo thread)
        {
            var message = new MessageWriter();

            message.AddUint8((byte)Controller.Section);
            message.AddUint8((byte)SectionMsg.AddThread);
            message.AddString(controller.name);
            message.AddBinary(thread.toBinary());
            return(message.ToBuffer());
        }
Ejemplo n.º 4
0
        public static byte[] RemoveCommentMessage(SectionController controller, CommentInfo comment)
        {
            var message = new MessageWriter();

            message.AddUint8((byte)Controller.Section);
            message.AddUint8((byte)SectionMsg.RemoveComment);
            message.AddString(controller.name);
            message.AddUint32((uint)comment.threadID);
            message.AddUint32((uint)comment.commentID);
            return(message.ToBuffer());
        }
Ejemplo n.º 5
0
        public static byte[] UpdateThreadMessage(SectionController controller, ThreadInfo thread)
        {
            var message = new MessageWriter();

            message.AddUint8((byte)Controller.Section);
            message.AddUint8((byte)SectionMsg.UpdateThread);
            message.AddString(controller.name);
            message.AddUint32((uint)thread.id);
            message.AddString(thread.title);
            message.AddString(thread.description);
            return(message.ToBuffer());
        }
Ejemplo n.º 6
0
        public static byte[] AllThreadsMessage(SectionController controller)
        {
            var message = new MessageWriter();

            message.AddUint8((byte)Controller.Section);
            message.AddUint8((byte)SectionMsg.AllThreads);
            message.AddString(controller.name);
            message.AddUint32((uint)controller.threadController.threads.Count);
            for (int i = 0; i < controller.threadController.threads.Count; i++)
            {
                ThreadInfo t = controller.threadController.threads[i];
                message.AddBinary(t.toBinary());
            }
            return(message.ToBuffer());
        }
Ejemplo n.º 7
0
        public ServerController()
        {
            networking        = new Networking(this);
            accountController = new AccountController(this);

            loginController = new LoginController(this);
            chatController  = new ChatController(this);
            logicTimer      = new HighResolutionTimer(8, logic); //120 fps logic timer
            codingSection   = new SectionController(this, "Coding Section");
            //allSection = new SectionController(this);
            gameSection     = new SectionController(this, "Game Section");
            graphicsSection = new SectionController(this, "Graphics Section");
            otherSection    = new SectionController(this, "Other Section");

            networking.Start();
            Console.ReadKey(true);
            networking.Stop();
            Thread.Sleep(1000);
        }
 public SectionMessageSender(SectionController c)
 {
     controller = c;
 }
Ejemplo n.º 9
0
 public SectionIOController(SectionController c)
 {
     controller = c;
 }
 public ThreadController(SectionController c)
 {
     controller = c;
     threads    = new List <ThreadInfo>();
 }