public void Connect(IPAddress address, int port)
        {
            try
            {
                var ep   = new IPEndPoint(address, port);
                var hail = NetworkSocket.CreateMessage("unity-Client: request open connection");

                Log.Information("attempting connection to: {ep}", ep.ToString());

                NetworkSocket.Connect(ep, hail);
            }
            catch (System.Exception e)
            {
                Log.Error("Error: {e}", e.ToString());
            }
        }
示例#2
0
        public static void SendCommand(CommandType command, string target, string[] values)
        {
            var lenght = values.Length;
            var buffer = NetworkSocket.CreateMessage();

            buffer.Write((short)PacketList.CL_GS_AdminTool);
            buffer.Write((short)command);
            buffer.Write(target);
            buffer.Write(lenght);

            for (var n = 0; n < lenght; n++)
            {
                buffer.Write(values[n]);
            }

            NetworkSocket.SendData(SocketEnum.GameServer, buffer);
        }