Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 23:31

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

Advertisement



Quiz Show Source 5518+

Discussion on Quiz Show Source 5518+ within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
Quiz Show Source 5518+

how to fix this Quiz Show ?










and here is Quiz Show Codes

PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.Game.ConquerStructures;

namespace 
Conquer_Online_Server.Database
{
    class 
QuizData
    
{
        public static 
void Load()
        {
            {
                
string[] AllLines System.IO.File.ReadAllLines("database\\QuizShow.txt");
                
int questionscount AllLines.Length;
                for (
int x 0questionscountx++)
                {
                    
string[] Info AllLines[x].Split('#');
                    
string Question Info[0];
                    
QuizShow.Answer[] Answers = new QuizShow.Answer[4];
                    
Answers[0] = new QuizShow.Answer(Info[1].Split(':')[0], ushort.Parse(Info[1].Split(':')[1]));
                    
Answers[1] = new QuizShow.Answer(Info[2].Split(':')[0], ushort.Parse(Info[2].Split(':')[1]));
                    
Answers[2] = new QuizShow.Answer(Info[3].Split(':')[0], ushort.Parse(Info[3].Split(':')[1]));
                    
Answers[3] = new QuizShow.Answer(Info[4].Split(':')[0], ushort.Parse(Info[4].Split(':')[1]));
                    
QuizShow.Question Q = new QuizShow.Question(QuestionAnswers);
                    
QuizShow.AllQuestions.Add((ushort)xQ);
                }
            }
        }
    }


PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.ServerBase;
using Conquer_Online_Server.Client;

namespace 
Conquer_Online_Server.Game.ConquerStructures
{
    public class 
QuizShow
    
{
        public static 
Dictionary<ushortQuestionAllQuestions = new Dictionary<ushortQuestion>();
        public static 
Dictionary<ushortQuestionQuestions = new Dictionary<ushortQuestion>();
        static 
System.Timers.Timer Timer;
        public static 
ushort QuestionNO 0;
        public static 
QuizShowScore[] Scores = new QuizShowScore[500];
        public static 
bool QuizON false;
        public static 
bool QuizON1 true;
        static List<
intContainer;
        public static 
void Start()
        {
            
QuizON true;
            
Random Rand = new Random();
            
Container = new List<int>();
            for (
int x 020x++)
            {
            
Again:
                
int Gen Rand.Next(070);
                if (!
Container.Contains(Gen))
                {
                    
Question Q = (Question)AllQuestions[(ushort)Gen];
                    
Answer[] RealAnswers = new Answer[4];
                    
bool[] Set = new bool[4];
                    for (
int i 04i++)
                    {
                        
int e Rand.Next(04);
                        while (
Set[e])
                            
Rand.Next(04);
                        
RealAnswers[i] = Q.Answers[e];
                        
Set[e] = true;
                    }
                    
Q.Answers RealAnswers;
                    
Questions.Add((ushort)xQ);
                    
Container.Add(Gen);
                }
                else
                    goto 
Again;
            }
            
Timer = new System.Timers.Timer();
            
Timer.Interval 30000;
            
Timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
            foreach (
GameState client in Kernel.GamePool.Values)
            {
                
client.Send(new Conquer_Online_Server.Network.GamePackets.QuizInfo().StartBuffer());
                
client.QuizInfo = new Info();
            }
            
Scores = new QuizShowScore[500];
            for (
int x 0501x++)
            { try { 
Scores[x] = new QuizShowScore(); } catch { continue; } }
            
Kernel.MainQuiz = new MainInfo();
            
Juststarted true;
            
QuestionNO 0;
            
Timer.Start();
            
Timer.AutoReset true;

        }
        public static 
void Stop()
        {
            
Juststarted false;
            
QuizON false;
            
Timer.AutoReset false;
        }
        static 
bool Juststarted false;

        static 
void Timer_Elapsed(object senderSystem.Timers.ElapsedEventArgs e)
        {
            if (
Juststarted)
            {
                foreach (
GameState client in Kernel.GamePool.Values)
                {
                    
string[] QA = new string[5];
                    
QA[0] = Questions[0];
                    
QA[1] = Questions[0].Answers[0];
                    
QA[2] = Questions[0].Answers[1];
                    
QA[3] = Questions[0].Answers[2];
                    
QA[4] = Questions[0].Answers[3];
                   
// string[] QA = new string[4] { Questions[0], Questions[0].Answers[0], Questions[0].Answers[1],Questions[0].Answers[2],Questions[0].Answers[3]};
                    
client.Send(new Conquer_Online_Server.Network.GamePackets.QuizInfo().QuestionBuffer(0001QA));
                    
client.QuizInfo.LastAnswer Environment.TickCount;
                }
                
QuestionNO++;
                
Juststarted false;
            }
            else
            {
                if(
QuizShow.Questions.ContainsKey((ushort)QuestionNO))
                {
                    
ushort nextq QuestionNO;
                    
nextq++;
                    foreach (
GameState client in Kernel.GamePool.Values)
                    {
                        
string[] QA = new string[5];
                        
QA[0] = Questions[0];
                        
QA[1] = Questions[0].Answers[0];
                        
QA[2] = Questions[0].Answers[1];
                        
QA[3] = Questions[0].Answers[2];
                        
QA[4] = Questions[0].Answers[3];
                        
client.Send(new Conquer_Online_Server.Network.GamePackets.QuizInfo().QuestionBuffer(client.QuizInfo.Scoreclient.QuizInfo.Time,
                            (
ushort)(800 client.QuizInfo.Score 100), 1QA));
                        
client.QuizInfo.LastAnswer Environment.TickCount;
                    }
                }
                else
                {
                    try
                    {
                        foreach (
GameState client in Kernel.GamePool.Values)
                        {
                           
client.Send(new Conquer_Online_Server.Network.GamePackets.QuizInfo().EndBuffer(client.Entity.Nameclient.QuizInfo.Scoreclient.QuizInfo.Timeclient.QuizInfo.Rank, (ushort)(800 client.QuizInfo.Score 100)));
                           
// Chr.MyClient.AddSend(Packets.QuizShowEnd(Chr.Name, Chr.QuizShowInfo.Score, Chr.QuizShowInfo.Time, Chr.QuizShowInfo.Rank, (ushort)(800 * Chr.QuizShowInfo.Score / 100)));
                        
}
                        
Timer.Elapsed -= Timer_Elapsed;
                        
Timer.Stop();
                        
Timer.Dispose();
                    }
                    catch { }
                    
QuizON false;
                }
                
QuestionNO++;
            }

        }
        public class 
QuizShowScore
        
{
            public 
uint EntityID 0;
            public 
uint Score 0;
        }
        public class 
MainInfo
        
{
            public 
string[] Name;
            public 
ushort[] Time;
            public 
ushort[] Score;
            public 
MainInfo()
            {
                
Name = new string[3];
                
Time = new ushort[3];
                
Score = new ushort[3];
                
Name[0] = "none";
                
Name[1] = "none";
                
Name[2] = "none";
                
Time[0] = 0;
                
Time[1] = 0;
                
Time[2] = 0;
                
Score[0] = 0;
                
Score[1] = 0;
                
Score[2] = 0;
            }
        }
        public class 
Info
        
{
            public 
int LastAnswer;
            public 
ushort Time;
            public 
ushort Score;
            public 
ushort QNo;
            public 
byte[] Answers;
            public 
ushort Rank;
            public 
Info()
            {
                
LastAnswer 0;
                
Time 0;
                
Score 0;
                
QNo 1;
                
Answers = new byte[Questions.Count];
                
Rank 0;
            }
        }
        public class 
Question
        
{
            public 
string m_Question;
            public 
Answer[] Answers;
            public 
Question(string questionAnswer[] answers)
            {
                
m_Question question;
                
Answers answers;
            }
            public static 
implicit operator string(Question q)
            {
                return 
q.m_Question;
            }
        }
        public class 
Answer
        
{
            public 
string m_Answer;
            public 
ushort Points;
            public 
Answer(string answerushort points)
            {
                
m_Answer answerPoints points;
            }
            public static 
implicit operator string(Answer q)
            {
                return 
q.m_Answer;
            }
        }
    }



any help ?

hey guys , any help ?
abdeen is offline  
Old 10/16/2011, 22:42   #2
 
Sp!!ke's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
that's for 5165 , not working cause isn't for actually version !
Sp!!ke is offline  
Old 10/17/2011, 13:19   #3
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
can`t we code it to make it read the questions ans the answers from QuizShow.txt file ?

and make it give exp ?
abdeen is offline  
Old 10/17/2011, 15:46   #4
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Everything can be Done but alot of patience and Experince in coding will be needed for that
shadowman123 is offline  
Old 10/17/2011, 16:11   #5
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
Quote:
Originally Posted by shadowman123 View Post
Everything can be Done but alot of patience and Experince in coding will be needed for that
but i need a little help
abdeen is offline  
Closed Thread


Similar Threads Similar Threads
quiz show
09/02/2009 - Conquer Online 2 - 1 Replies
can you copy the questions for conquer quiz show during the quiz?
quiz show
06/18/2009 - CO2 Private Server - 4 Replies
the quiz show is added in coemuv2? and the nobility rank too?. and if this is not added how i can add the quiz show and nobility rank?
Quiz Show Answers
05/29/2009 - Conquer Online 2 - 38 Replies
http://cid7.net/questions.php It includes most Non-CO related questions (will be added soon) Database Size: 1250 questions Make sure you enter most of the words from the question when submitting (it uses a very weak algorithm to search the phrases - thus the more words you have, the higher chance it gets the correct answer) You can ask questions using space or ~ Just for those who want to test it , here is a dump of a recent Co Quiz



All times are GMT +1. The time now is 23:32.


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

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.