diff --git a/games/GGS-Killtrolpanel/ggskpanel.glade b/games/GGS-Killtrolpanel/ggskpanel.glade new file mode 100644 index 0000000..3f85df9 --- /dev/null +++ b/games/GGS-Killtrolpanel/ggskpanel.glade @@ -0,0 +1,135 @@ + + + + + + 561 + 521 + + + True + + + True + + + True + <span size="x-large">GGS Killtrolpanel</span> + True + + + False + 0 + + + + + True + kill_process_icon.jpg + + + False + False + 1 + + + + + False + False + 0 + + + + + True + 3 + 2 + True + + + All players + True + True + True + + + + + + Coordinator + True + True + True + + + + 1 + 2 + + + + + Dispatcher + True + True + True + + + + 1 + 2 + + + + + Coordinator backup + True + True + True + + + + 1 + 2 + 1 + 2 + + + + + All tables + True + True + True + + + + 2 + 3 + + + + + All GameVMs + True + True + True + + + + 1 + 2 + 2 + 3 + + + + + 1 + + + + + + diff --git a/games/GGS-Killtrolpanel/kill_process_icon.jpg b/games/GGS-Killtrolpanel/kill_process_icon.jpg new file mode 100644 index 0000000..7768c3d Binary files /dev/null and b/games/GGS-Killtrolpanel/kill_process_icon.jpg differ diff --git a/games/GGS-Killtrolpanel/kpanel.py b/games/GGS-Killtrolpanel/kpanel.py new file mode 100644 index 0000000..3f8438a --- /dev/null +++ b/games/GGS-Killtrolpanel/kpanel.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +import sys, socket, thread, gobject, getpass, time, os +try: + import pygtk + pygtk.require("2.16") +except: + pass +try: + import gtk + import gtk.glade +except: + sys.exit(1) + +class GGSKPanel: + + def __init__(self): + #Set the Glade file + self.gladefile = "ggskpanel.glade" + self.wTree = gtk.glade.XML(self.gladefile, "window1") + + #Create our dictionay and connect it + dic = { "on_window1_destroy_event" : gtk.main_quit + ,"on_coordinatorButton_clicked" : lambda x: self.terminateProcess("ggs_coordinator") + ,"on_coordinatorBackupButton_clicked" :\ + lambda x: self.terminateProcess("ggs_coordinator_backup") + ,"on_dispatcherButton_clicked" : lambda x: self.terminateProcess("ggs_dispatcher") + } + + self.wTree.signal_autoconnect(dic) + + self.wTree.get_widget("window1").show() + + def terminateProcess(self, process): + os.system("echo \"exit(whereis(%s), 'Bye bye').\" | erl_call -sname ggs -e" % process) + + def setStatus(self, msg): + self.wTree.get_widget("statusbar").push(0, msg) + + +if __name__ == "__main__": + chat = GGSKPanel() + gobject.threads_init() + gtk.main() diff --git a/games/GGSChat/chat.py b/games/GGSChat/chat.py index a56f915..5dc6fd0 100644 --- a/games/GGSChat/chat.py +++ b/games/GGSChat/chat.py @@ -25,11 +25,11 @@ class GGSChat: thread.start_new_thread(self.listenChat, ()) thread.start_new_thread(self.luserCheck, ()) #Create our dictionay and connect it - dic = {"on_window1_destroy_event" : gtk.main_quit - , "on_sendButton_clicked" : lambda x: self.chat() - , "on_entry_activate" : lambda x : self.chat() - , "on_nickBox_activate" : lambda x : self.changeNick() - , "on_chatBox_focus" : lambda x, y: self.wTree.get_widget("entry").grab_focus() + dic = {"on_window1_destroy_event" : gtk.main_quit + , "on_sendButton_clicked" : lambda x: self.chat() + , "on_entry_activate" : lambda x : self.chat() + , "on_nickBox_activate" : lambda x : self.changeNick() + , "on_chatBox_focus" : lambda x, y: self.wTree.get_widget("entry").grab_focus() } self.wTree.signal_autoconnect(dic) diff --git a/src/ggs_coordinator.erl b/src/ggs_coordinator.erl index ba65c5a..14a7048 100644 --- a/src/ggs_coordinator.erl +++ b/src/ggs_coordinator.erl @@ -2,7 +2,7 @@ %% API Exports -export([start_link/0, stop/1, join_table/1, create_table/1, join_lobby/0, - respawn_player/2, respawn_table/1, remove_player/2]). + respawn_player/2, respawn_table/1, remove_player/2, get_all_players/0]). %% gen_server callback exports -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, @@ -53,6 +53,9 @@ remove_player(_From, _Player) -> %gen_server:cast(ggs_coordinator, {remove_player, Player}). ggs_logger:not_implemented(). +get_all_players() -> + gen_server:call(?SERVER, get_all_players). + %% Just to shorten the name back_up(State) -> ggs_coordinator_backup:back_up(State), @@ -99,6 +102,9 @@ handle_call({create_table, {force, TableID}}, From, State) -> back_up(NewState), {reply, {ok, TableID}, NewState}; +handle_call(get_all_players, _From, State) -> + {reply, State#co_state.players, State}; + handle_call(_Message, _From, State) -> {noreply, State}.