Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    You don't run mysql notifier as administrator -.-

    Nilly meant the server.exe and wserver.exe

    (from /bin/debug/server/server.exe and /bin/debug/wserver/wserver.exe)
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  2. #17
    York1058's Avatar
    Join Date
    Oct 2014
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0

    Lightbulb Possible cause

    Well I made another video to better explain my problem , and I'm posting the next program.cs
    that would be the file on which that accusing errors at compile time or run the server ...



    Code:
     using System;
    using System.Collections.Generic;
    using System****;
    using System.Net;
    using System.Threading;
    
    namespace server
    {
        internal class Program
        {
            private const int port = 80;
            private static HttpListener listener;
            private static Thread listen;
            private static readonly Thread[] workers = new Thread[5];
            private static readonly Queue<HttpListenerContext> contextQueue = new Queue<HttpListenerContext>();
            private static readonly object queueLock = new object();
            private static readonly ManualResetEvent queueReady = new ManualResetEvent(false);
    
            private static void Main(string[] args)
            {
                listener = new HttpListener();
                listener.Prefixes.Add("https://*:" + port + "/");
                listener.Start();
    
                listen = new Thread(ListenerCallback);
                listen.Start();
                for (int i = 0; i < workers.Length; i++)
                {
                    workers[i] = new Thread(Worker);
                    workers[i].Start();
                }
                Console.CancelKeyPress += (sender, e) =>
                {
                    Console.WriteLine("Terminating...");
                    listener.Stop();
                    while (contextQueue.Count > 0)
                        Thread.Sleep(100);
                    Environment.Exit(0);
                };
                Console.WriteLine("Listening at port " + port + "...");
                Thread.CurrentThread.Join();
            }
    
            private static void ListenerCallback()
            {
                try
                {
                    do
                    {
                        HttpListenerContext context = listener.GetContext();
                        lock (queueLock)
                        {
                            contextQueue.Enqueue(context);
                            queueReady.Set();
                        }
                    } while (true);
                }
                catch
                {
                }
            }
    
            private static void Worker()
            {
                while (queueReady.WaitOne())
                {
                    HttpListenerContext context;
                    lock (queueLock)
                    {
                        if (contextQueue.Count > 0)
                            context = contextQueue.Dequeue();
                        else
                        {
                            queueReady.Reset();
                            continue;
                        }
                    }
    
                    try
                    {
                        ProcessRequest(context);
                    }
                    catch
                    {
                    }
                }
            }
    
            private static void ProcessRequest(HttpListenerContext context)
            {
                try
                {
                    IRequestHandler handler;
    
                    if (!RequestHandlers.Handlers.TryGetValue(context.Req  uest.Url.LocalPath, out handler))
                    {
                        context.Response.StatusCode = 400;
                        context.Response.StatusDescription = "Bad request";
                        using (var wtr = new StreamWriter(context.Response.OutputStream))
                            wtr.Write("<h1>Bad request</h1>");
                    }
                    else
                        handler.HandleRequest(context);
                }
                catch (Exception e)
                {
                    using (var wtr = new StreamWriter(context.Response.OutputStream))
                        wtr.Write("<Error>Internal Server Error</Error>");
                    Console.Error.WriteLine(e);
                }
    
                context.Response.Close();
            }
        }
    }



    teste

  3. #18
    nilly's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    2,652
    Reputation
    155
    Thanks
    13,983
    My Mood
    Angelic
    @York1058, take a step back for a min. I watched your first video and noticed a few things. First, the server.bat and wserver.bat are referencing a non-existent file which is why you get the error. Open the 2 bat files up and look at the path they try to run. You'll find that the file is no where to be found which is what that first error is all about.

    When running the server, the only thing you need to run is the Run Server.bat (of course have mySQL open in background). You didn't run that .bat as administrator like when trying the broken singular .bat files. Run that with administrator and it should work (at least get you by your problem here).

    Try this. Run Visual Studios with administrator. Build the project. And start the server.exe with visual studios like you did in the 2nd video. It should no longer error out on the .listen() part.

    In my original post, I meant the only program need to run as administrator is the server. Not the world server or sql as they use ports that microsoft doesn't care about. The only reason you need to run the server as administrator is because it is configured to use port 80.
    Be careful, stray too far from the pack and you'll get lost.

  4. #19
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Quote Originally Posted by nilly View Post
    @York1058, take a step back for a min. I watched your first video and noticed a few things. First, the server.bat and wserver.bat are referencing a non-existent file which is why you get the error. Open the 2 bat files up and look at the path they try to run. You'll find that the file is no where to be found which is what that first error is all about.

    When running the server, the only thing you need to run is the Run Server.bat (of course have mySQL open in background). You didn't run that .bat as administrator like when trying the broken singular .bat files. Run that with administrator and it should work (at least get you by your problem here).

    Try this. Run Visual Studios with administrator. Build the project. And start the server.exe with visual studios like you did in the 2nd video. It should no longer error out on the .listen() part.

    In my original post, I meant the only program need to run as administrator is the server. Not the world server or sql as they use ports that microsoft doesn't care about. The only reason you need to run the server as administrator is because it is configured to use port 80.
    Just to further expand on this, the batch files shouldn't be used unless edited properly because I have noticed that it tends to crash on you. It is easier to just go to the bin folders to run the programs.
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Help Request] Phoenix loading error retrying
    By SashaDaCat in forum Realm of the Mad God Private Servers Help
    Replies: 8
    Last Post: 08-09-2014, 09:17 PM
  2. [Help Request] Phoenix Source error server.exe
    By markus098 in forum Realm of the Mad God Private Servers Help
    Replies: 6
    Last Post: 08-06-2014, 01:08 PM
  3. [Help Request] Phoenix Realms Error :/
    By mukiatro in forum Realm of the Mad God Private Servers Help
    Replies: 2
    Last Post: 07-30-2014, 06:24 AM
  4. Phoenix source error.
    By LCraft303 in forum Realm of the Mad God Private Servers Help
    Replies: 3
    Last Post: 07-25-2014, 08:12 PM
  5. [Help Request] phoenix realm error
    By KieronZeCoder in forum Realm of the Mad God Private Servers Help
    Replies: 0
    Last Post: 04-28-2014, 02:37 PM