Skip to content

Commit

Permalink
Add console connect command
Browse files Browse the repository at this point in the history
  • Loading branch information
adam4813 committed Feb 6, 2021
1 parent 7529e16 commit f5d437a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ int main(int argc, char* argv[]) {
std::string message(args, end_arg - args);
lua_sys->ExecuteString(message);
});
console.AddConsoleCommand(
"connect",
"connect [ip] : Connect to a server [ip]",
[&connection] (const char* args) {
const char* end_arg = args;
while (*end_arg != '\0') {
end_arg++;
}
// Args now points were the arguments begins
std::string ip(args, end_arg - args);
connection.Connect(ip);
});
console.AddSlashHandler(
[&lua_sys] (const char* args) {
const char* end_arg = args;
Expand Down

0 comments on commit f5d437a

Please sign in to comment.