Example #1
0
        static void Main(string[] args)
        {
            //服务器初始化
            ServerStart ss = new ServerStart(8000);

            ss.encode = MessageEncoding.Encode;
            ss.decode = MessageEncoding.Decode;
            ss.LE     = LengthEncoding.Encode;
            ss.LD     = LengthEncoding.Decode;
            ss.center = new HandlerCenter();
            ss.Start(6650);
            Console.WriteLine("服务器启动成功");
            while (true)
            {
            }


            ////同步接受和发送操作
            //Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            //server.Bind(new IPEndPoint(IPAddress.Any, 123));
            ////置于监听状态
            //server.Listen(10);
            //Socket client = server.Accept();
            //byte[] buff = new byte[1024];
            //client.Receive(buff);
            //client.Send(buff);
        }
Example #2
0
        static void Main(string[] args)
        {
            ServerStart server = new ServerStart(1000);

            server.center = new HandlerCenter();
            server.Start(8080);
            Console.ReadKey();
        }
Example #3
0
        public static void Main(string[] args)
        {
            Console.WriteLine(Define.ServerName + "............");
            ServerStart ss = new ServerStart(9000);

            ss.center = new Center();
            ss.LD     = LengthEncoding.Decode;
            ss.LE     = LengthEncoding.Encode;
            ss.Start(6650);
            Console.WriteLine("服务器启动成功");
            while (true)
            {
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            ServerStart ss = new ServerStart(9000);

            ss.lengthEncode = LengthEncoding.encode;
            ss.msgEncode    = MessageEncoding.Encode;
            ss.center       = new HandlerCenter();
            ss.lengthDecode = LengthEncoding.decode;
            ss.msgDecode    = MessageEncoding.Decode;
            ss.Start(6500);
            Console.WriteLine("服务器启动>>>>");
            while (true)
            {
            }
        }
Example #5
0
        static void Main(string[] args)
        {
            ServerStart serverStart = new ServerStart(10);

            serverStart.LD     = LengthEncoding.decode;
            serverStart.LE     = LengthEncoding.encode;
            serverStart.encode = MessageEncoding.encode;
            serverStart.decode = MessageEncoding.decode;
            serverStart.center = new HandlerCenter();
            serverStart.Start(6650);
            Console.WriteLine("服务器已启动");
            while (true)
            {
            }
        }
Example #6
0
        static void Main(string[] args)
        {
            //服务器初始化
            ServerStart ss = new ServerStart(9000);

            ss.encode       = MessageEncoding.encode;
            ss.socketHander = new HandlerCenter();
            ss.decode       = MessageEncoding.decode;
            ss.LD           = LengthEncoding.decode;
            ss.LE           = LengthEncoding.encode;
            ss.Start(6650);
            Console.WriteLine("服务器启动成功");
            while (true)
            {
            }
        }
Example #7
0
        static void Main(string[] args)
        {
            //服务器初始化
            ServerStart serverStart = new ServerStart(9000);

            serverStart.messageEncode = MessageEncoding.MessageEncode;
            serverStart.messageDecode = MessageEncoding.MessageDecode;
            serverStart.lengthEncode  = LengthEncoding.Encode;
            serverStart.lengthDecode  = LengthEncoding.Decode;
            serverStart.center        = new HandlerCenter();
            serverStart.Start(6650);
            Console.WriteLine("服务器连接成功");
            while (true)
            {
            }
        }
Example #8
0
        static void Main(string[] args)
        {
            //Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            //server.Bind(new IPEndPoint(IPAddress.Any, port));

            //// 置于监听状态
            //server.Listen(10);
            //Socket client = server.Accept();
            //byte[] buff = new byte[1024];
            //client.Receive(buff);
            //client.Send(buff);

            // 服务器初始化
            ServerStart ss = new ServerStart(9000);

            ss.Start(6666);
        }
Example #9
0
        public static void NetFrameStart()
        {
            //服务器初始化
            ServerStart ss = new ServerStart(9000);

            ss.Encode = MessageEncoding.Encode;
            ss.Decode = MessageEncoding.Decode;
            ss.Center = new HandlerCenter();
            ss.LD     = LengthEncoding.Decode;
            ss.LE     = LengthEncoding.Encode;
            ss.Start(6666);
            SerializeUtil.IsPBOrJson = false;
            UserToken.IsUdp          = false;
            Console.WriteLine("TCP服务器启动成功");
            while (true)
            {
            }
        }
Example #10
0
        static void Main(string[] args)
        {
            ServerStart serverStart = new ServerStart(10);

            serverStart.LD     = LengthEncoding.decode;
            serverStart.LE     = LengthEncoding.encode;
            serverStart.encode = MessageEncoding.encode;
            serverStart.decode = MessageEncoding.decode;
            serverStart.center = new HandlerCenter();
            serverStart.Start(6650);
            Console.WriteLine("服务器已启动");
            Console.WriteLine("hello");
            SkillInitialProperty     skillInitialProperty     = new SkillInitialProperty();     //初始化技能列表
            InventoryInItialProperty inventoryInItialProperty = new InventoryInItialProperty(); //初始化物品列表

            while (true)
            {
            }
        }
Example #11
0
        static void Main(string[] args)
        {
            //初始话服务器资源配置
            ConfigXmlFileRead.ReadGameFilePath(currentGameToLoadFilePath, allGameResourse);
            ServerStart serverStart = new ServerStart(60);

            serverStart.center = new HandlerCenter();
            serverStart.Start(3389);
            Console.WriteLine("服务器已启动");
            MysqlConnection mysqlConnection = new MysqlConnection();

            Console.WriteLine(mysqlConnection.MysqlInfo());
            DataView dataView = mysqlConnection.MysqlDataAdapter("User");

            //Console.WriteLine( dataView.Table.;
            while (true)
            {
                Console.ReadLine();
            }
        }
Example #12
0
        static void Main(string[] args)
        {
            ServerStart ss = new ServerStart(9000);

            ss.Start(6666);
        }