diff --git a/Makefile b/Makefile index 63c26cd..f683f14 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,8 @@ NAME = ircserv -SRC = main.cpp Server/Server.cpp Client/Client.cpp \ - Channel/Channel.cpp \ - commands/pass.cpp commands/nick.cpp commands/user.cpp \ - commands/join.cpp commands/privmsg.cpp \ - commands/part.cpp +SRC = main.cpp Server/Server.cpp -HEADERS = Client/Client.hpp \ - Server/Server.hpp \ - Channel/Channel.hpp +HEADERS = Server/Server.hpp OBJ = $(SRC:.cpp=.o) diff --git a/Server/Server.cpp b/Server/Server.cpp new file mode 100644 index 0000000..153fea7 --- /dev/null +++ b/Server/Server.cpp @@ -0,0 +1,38 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Server.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: iherman- +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +// C++ lib functions +#include + +# include +# include + +class Server +{ + private: + + public: + Server(); + Server(int port, const std::string& password); + ~Server(); + + Server &operator=(const Server& other); +}; + +#endif // SERVER_HPP \ No newline at end of file diff --git a/ircserv b/ircserv new file mode 100755 index 0000000..063bd45 Binary files /dev/null and b/ircserv differ diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..8a2144d --- /dev/null +++ b/main.cpp @@ -0,0 +1,49 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: iherman- > port)) + throw std::runtime_error("Invalid port"); + + if (input.peek() != EOF) + throw std::runtime_error("Malformed port"); + + return port; +} + +int main(int argc, char *argv[]) +{ + if (argc != 3) + { + std::cerr << "Usage: ./ircserv " << std::endl; + return 1; + } + + try + { + int port = get_port(argv[1]); + Server server(port, argv[2]); + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + return 1; + } + + // run server +} \ No newline at end of file