added serverLog to API
This commit is contained in:
parent
4abcdd5579
commit
08e086084c
4 changed files with 14 additions and 15 deletions
|
@ -26,7 +26,7 @@ class Chat
|
|||
table_token = gets.chomp unless @is_bot
|
||||
|
||||
@ggs_network = GGSNetwork.new(self, table_token)
|
||||
@ggs_network.connect("ggs.jeena.net", 9000)
|
||||
@ggs_network.connect("localhost", 9000)
|
||||
end
|
||||
|
||||
def ggsNetworkReady(ggs_network, am_i_host)
|
||||
|
@ -125,6 +125,8 @@ class Chat
|
|||
toggle_log
|
||||
elsif message == "/help"
|
||||
help
|
||||
elsif message == "/exit"
|
||||
exit
|
||||
elsif message == "/ignore"
|
||||
@ignore = @ignore ? false : true
|
||||
if @ignore
|
||||
|
@ -181,6 +183,7 @@ class Chat
|
|||
puts "| /bots | stop all bots |"
|
||||
puts "| /log | toggle logging |"
|
||||
puts "| /ignore | toggle ignoring everyone |"
|
||||
puts "| /exit | exit chat |"
|
||||
puts "| /help | show this help |"
|
||||
puts "+-----------------------------------------------+"
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ function playerCommand(player_id, command, args) {
|
|||
} else if(command == "message") {
|
||||
message(player_id, args);
|
||||
} else if(command == "ping") {
|
||||
GGS.sendCommand(player_id, "pong", args);
|
||||
GGS.sendCommand(player_id, "pong", GGS.serverInfo() + "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ function changeNick(player_id, nick) {
|
|||
GGS.localStorage.setItem("nick_" + player_id, nick);
|
||||
|
||||
if (!old_nick) {
|
||||
GGS.sendCommandToAll("notice", nick + " joined ä");
|
||||
GGS.sendCommandToAll("notice", nick + " joined");
|
||||
} else {
|
||||
GGS.sendCommandToAll("notice", old_nick + " is now called " + nick);
|
||||
}
|
||||
|
|
Reference in a new issue