00001 /* 00002 00003 ************************************************************************* 00004 00005 ArmageTron -- Just another Tron Lightcycle Game in 3D. 00006 Copyright (C) 2005 by 00007 and the AA DevTeam (see the file AUTHORS(.txt) in the main source directory) 00008 00009 ************************************************************************** 00010 00011 This program is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License 00013 as published by the Free Software Foundation; either version 2 00014 of the License, or (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with this program; if not, write to the Free Software 00023 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00024 00025 *************************************************************************** 00026 00027 */ 00028 00029 #include <iostream> 00030 00031 #include "eEventNotification.h" 00032 #include "ePlayer.h" 00033 #include "nNetwork.h" 00034 #include "tString.h" 00035 #ifdef MACOSX_XCODE 00036 #ifndef DEDICATED 00037 # include "AAGrowlBridge.h" 00038 #endif 00039 #endif 00040 00041 void se_eventNotificationHandle( nMessage &m ); 00042 00043 static nVersionFeature se_eventNotificationFeature( 20 ); 00044 static nDescriptor se_eventNotificationDescriptor( 199, se_eventNotificationHandle, "event_notification" ); 00045 00046 void se_eventNotificationHandle( nMessage &m ) 00047 { 00048 tString title, message; 00049 m >> title; 00050 m >> message; 00051 #ifdef MACOSX_XCODE 00052 #ifndef DEDICATED 00053 Growl(title, message); 00054 #endif 00055 #endif 00056 } 00057 00058 void se_sendEventNotification( tString title, tString message ) 00059 { 00060 for ( int user = MAXCLIENTS; user > 0; --user ) 00061 { 00062 if ( sn_Connections[ user ].socket ) 00063 { 00064 if ( se_eventNotificationFeature.Supported( user ) ) 00065 { 00066 nMessage *m = new nMessage( se_eventNotificationDescriptor ); 00067 *m << title; 00068 *m << message; 00069 m->Send( user ); 00070 } 00071 00072 } 00073 } 00074 }