예제 #1
0
 static void stop(string name, string message, NetEndpoint enpoint)
 {
     watches[name].Stop();
     switch (enpoint)
     {
         case NetEndpoint.CLIENT:
             Client.print("info", string.Format("{0} : {1} ms", message, watches[name].ElapsedMilliseconds));
             break;
         case NetEndpoint.SERVER:
             Server.print("info", string.Format("{0} : {1} ms", message, watches[name].ElapsedMilliseconds));
             break;
     }
     watches.Remove(name);
 }
예제 #2
0
        static void stop(string name, string message, NetEndpoint enpoint)
        {
            watches[name].Stop();
            switch (enpoint)
            {
            case NetEndpoint.CLIENT:
                Client.print("info", string.Format("{0} : {1} ms", message, watches[name].ElapsedMilliseconds));
                break;

            case NetEndpoint.SERVER:
                Server.print("info", string.Format("{0} : {1} ms", message, watches[name].ElapsedMilliseconds));
                break;
            }
            watches.Remove(name);
        }
예제 #3
0
        public static void handle(NetIncomingMessage message, NetEndpoint endpoint)
        {
            PacketID id = (PacketID)message.ReadInt32();

            switch (endpoint)
            {
                case NetEndpoint.NONE:
                    break;
                case NetEndpoint.CLIENT:
                    handlers[id].onclientrecieve(message);
                    break;
                case NetEndpoint.SERVER:
                    handlers[id].onserverrecieve(message);
                    break;
            }
        }
예제 #4
0
        static void start(string name, string message, NetEndpoint endpoint)
        {
            Stopwatch w = new Stopwatch();
            w.Start();
            watches.Add(name, w);

            switch (endpoint)
            {
                case NetEndpoint.CLIENT:
                    Client.print("info", message);
                    break;
                case NetEndpoint.SERVER:
                    Server.print("info", message);
                    break;
            }
        }
예제 #5
0
        public static void handle(NetIncomingMessage message, NetEndpoint endpoint)
        {
            PacketID id = (PacketID)message.ReadInt32();

            switch (endpoint)
            {
            case NetEndpoint.NONE:
                break;

            case NetEndpoint.CLIENT:
                handlers[id].onclientrecieve(message);
                break;

            case NetEndpoint.SERVER:
                handlers[id].onserverrecieve(message);
                break;
            }
        }
예제 #6
0
        static void start(string name, string message, NetEndpoint endpoint)
        {
            Stopwatch w = new Stopwatch();

            w.Start();
            watches.Add(name, w);

            switch (endpoint)
            {
            case NetEndpoint.CLIENT:
                Client.print("info", message);
                break;

            case NetEndpoint.SERVER:
                Server.print("info", message);
                break;
            }
        }
예제 #7
0
        public static T write <T>(NetEndpoint endpoint) where T : Packet, new()
        {
            T t = new T();

            t.endpoint = endpoint;

            switch (endpoint)
            {
            case NetEndpoint.NONE:
                break;

            case NetEndpoint.CLIENT:
                t.outgoingmessage = Client.net.CreateMessage();
                break;

            case NetEndpoint.SERVER:
                t.outgoingmessage = Server.net.CreateMessage();
                break;
            }

            t.writedefault();

            return(t);
        }