You can subscribe to this list here.
2002 |
Jan
(10) |
Feb
(28) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Lee B. <lb...@us...> - 2002-02-08 06:21:10
|
Update of /cvsroot/spaceninjas/spaceninjas/src In directory usw-pr-cvs1:/tmp/cvs-serv16521 Added Files: spaceninjas.h Log Message: This core header file should be included by all source files. --- NEW FILE: spaceninjas.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: spaceninjas.h,v 1.1 2002/02/08 06:21:07 lberger Exp $ #ifndef __spaceninjas_h__ #define __spaceninjas_h__ // This header files defines everything that is needed by all targets in the // Space Ninjas source tree. Every file should include this header file to // ensure that these definitions are found. Obviously, care should be used // when adding new definitions here since every file will depend on this // header file. // Define all the types that space ninjas uses. This should make porting // a little easier. // FIXME: these definitions currently assume gcc running on an Intel platform. typedef signed int int32; typedef unsigned int uint32; typedef signed short int16; typedef unsigned short uint16; typedef char int8; typedef unsigned char uint8; typedef unsigned char byte; typedef float float32; typedef double float64; #endif // __spaceninjas_h__ |
From: Lee B. <lb...@us...> - 2002-02-08 06:20:34
|
Update of /cvsroot/spaceninjas/spaceninjas In directory usw-pr-cvs1:/tmp/cvs-serv16384 Modified Files: configure.in Log Message: added c++ support Index: configure.in =================================================================== RCS file: /cvsroot/spaceninjas/spaceninjas/configure.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** configure.in 7 Feb 2002 06:14:43 -0000 1.1 --- configure.in 8 Feb 2002 06:20:31 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- AC_ISC_POSIX AC_PROG_CC + AC_PROG_CXX AC_PROG_CPP AC_STDC_HEADERS |
Update of /cvsroot/spaceninjas/spaceninjas/src/net In directory usw-pr-cvs1:/tmp/cvs-serv16201 Modified Files: Makefile.am Added Files: Event.h EventCreator.h EventCreatorBase.h EventFactory.cc EventFactory.h StreamBuffer.h Streamable.h Log Message: Initial pass on the new event code. Nothing is integrated yet, but most of the framework has been implemented. --- NEW FILE: Event.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: Event.h,v 1.1 2002/02/08 06:19:56 lberger Exp $ #ifndef __Event_h__ #define __Event_h__ #include <spaceninjas.h> // An event is any trigger that may arise. It may come from a timer, network // event, or any other form of external stimulus. The Event class itself // does not provide much functionality beyond a simple name for the rest of // the event handling code. class Event { public: Event() {} virtual ~Event() {} // This function returns the name of the event. This name must be unique // acrost all events, and it is recommended that the class name is used. // // Note: Runtime type information cannot be used for this. This string must // be the same on every platform, and the C++ standard defines that // type_info::name() returns an implementation defined string (q.v., section // 18.5.1 paragraph 7). virtual const char *GetEventName() const = 0; }; #endif // __Event_h__ --- NEW FILE: EventCreator.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: EventCreator.h,v 1.1 2002/02/08 06:19:56 lberger Exp $ #ifndef __EventCreator_h__ #define __EventCreator_h__ #include <spaceninjas.h> #include <net/EventCreatorBase.h> #include <net/EventFactory.h> // The EventCreator is a template-based classed that is responsible for // creating an event of a given type. The event factory uses this class to // allocate an event. Also, when this class is created, it automatically // registers itself with the event factory. Typically, one of these classes // is created per event in the global scope. template < typename T > class EventCreator : public EventCreatorBase { public: EventCreator(); virtual ~EventCreator(); virtual Event *CreateEvent() const; }; inline template < typename T > EventCreator< T >::EventCreator() { EventFactory::RegisterEvent( this ); } inline template < typename T > EventCreator< T >::~EventCreator() { EventFactory::UnRegisterEvent( this ); } inline template < typename T > Event * EventCreator< T >::CreateEvent() const { return new T; } #endif // __EventCreator_h__ --- NEW FILE: EventCreatorBase.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: EventCreatorBase.h,v 1.1 2002/02/08 06:19:56 lberger Exp $ #ifndef __EventCreatorBase_h__ #define __EventCreatorBase_h__ #include <spaceninjas.h> class Event; // This class provides no functionality other than a name and a pure virtual // function to allocate an event. The templated EventCreator class derives // from this class. This makes the event factory's life easier since it does // not have to deal with the myriad of templated EventCreator subclasses. class EventCreatorBase { public: EventCreatorBase() {} virtual ~EventCreatorBase() {} virtual Event *CreateEvent() const = 0; }; #endif // __EventCreatorBase_h__ --- NEW FILE: EventFactory.cc --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: EventFactory.cc,v 1.1 2002/02/08 06:19:56 lberger Exp $ #include <assert.h> #include <map> #include <string> #include <net/EventFactory.h> #include <net/Event.h> #include <net/EventCreatorBase.h> // At the core of the event factory is the table that keeps track of all the // registered events. Extend the EventFactory namespace that is defined in // the header file with the table information and any other private interface // functions. namespace EventFactory { using std::map; using std::string; // Define a table that will contain all of the event creator objects. The // key into the mapping is the event's name, and the data is the creator // pointer. typedef map< string, EventCreatorBase * > CreatorTable; CreatorTable m_creators; void EventFactory::RegisterEvent( EventCreatorBase *creator ) { // The key into the creator table is the event's name. Quickly create an // event and fetch its name. Event *event = creator->CreateEvent(); string name = event->GetEventName(); delete event; // Save the given creator into the creators table. assert( m_creators[name] == NULL ); m_creators[name] = creator; } void EventFactory::UnRegisterEvent( EventCreatorBase *creator ) { // The key into the creator table is the event's name. Quickly create an // event and fetch its name. Event *event = creator->CreateEvent(); string name = event->GetEventName(); delete event; // Remove the event from the creators table. assert( m_creators[name] != NULL ); m_creators[name] = NULL; } Event * EventFactory::CreateEvent( const char *name ) { // All the real work for creating an event is handled by the event creator // class. Simply fetch the proper creator and forward along the request. EventCreatorBase *creator = m_creators[name]; assert( creator != NULL ); return creator->CreateEvent(); } } --- NEW FILE: EventFactory.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: EventFactory.h,v 1.1 2002/02/08 06:19:56 lberger Exp $ #ifndef __EventFactory_h__ #define __EventFactory_h__ #include <spaceninjas.h> class Event; class EventCreatorBase; // The EventFactory is a singleton that is responsible for creating new // events. This factory is primarly used by the network code to create the // proper events as they are received from the network; however, other code // paths may use the event factory to create new events should they need them. namespace EventFactory { // This function registers a new event into the event factory. The event // itself is wrapped up into the EventCreatorBase class. Once this call has // been made, the factory will be able to create the event specified event. // Since the factory will keep the passed in pointer, it is important that // the given EventCreatorBase not to be deleted. void RegsiterEvent( EventCreatorBase *creator ); // This function is similar to RegisterEvent(), except is removes an event // from the event factory. It is pretty atypical to call this function. It // is provided mainly for orthogonality. The given EventCreatorBase must be // the same pointer that was passed into RegisterEvent() originally. void UnRegsiterEvent( EventCreatorBase *creator ); // This function is the main API for the event factory. It allocates and // returns a new event of the specified name. The caller is responsible for // deleting the event that is returned. // // FIXME: The event factory needs to be switched over to some id-based // system so strings are not being passed around everywhere. Event *CreatorEvent( const char *name ); } #endif // __EventFactory_h__ --- NEW FILE: StreamBuffer.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: StreamBuffer.h,v 1.1 2002/02/08 06:19:56 lberger Exp $ #ifndef __StreamBuffer_h__ #define __StreamBuffer_h__ #include <spaceninjas.h> // The StreamBuffer is a class that handles marshalling and unmarshalling (or // packing and unpacking) any arbitrary data. It has a simple Stream() // function that can be used regardless which direction the stream buffer is // operating. This allows the user to have a single function that simply // calls Stream() on a series of variables and StreamBuffer "does the right // thing" (tm). StreamBuffer uses the Streamable template to do all of this // magic. class StreamBuffer { public: // This enumeration defines the direction that the stream buffer will // operate. Packing adds data to the stream buffer, and unpacking removes // it (and intiailzes some given variable). enum Direction { Packing, UnPacking }; StreamBuffer( Direction dir ); // This templated member function is the main API for a stream buffer. This // is a bi-directional function that will add or removed data from the // stream buffer. If this is a packing stream, then the given argument is // added to the stream. For unpacking streams, the given argument is // initialized to whatever value was in the stream. // // Note: A Streamable must exist for the given type. If one doesn't exist, // then the type is simply memcpy'd into/out of the stream. This may not // properly handle some classes. Also, pointer values should not be // streamed. template < typename T > void Stream( T& val ); // FIXME: Remove this function. It's simply here for debugging the initial // implementation of this class. void DumpBuffer(); protected: // Friend every streamable since they need to manipulate the streamable. // This helps keep this class's interface clean. template < typename T > friend class Streamable; // This function sets that the given number of bytes have been used. If // this is a packing stream, then both the buffer size and the position // pointer are incremented by the specified amount. For an unpacking // stream, the position pointer is simply incremented. Streamables should // use this function when they have processed some data out of this stream. void AdvanceStream( size_t bytes ); private: // This buffer contains all the data of the stream buffer. When the stream // buffer is packing, all streamed data will be written to here, and the // size member will be incremented. For unpacking, the buffer contains the // entire data buffer that was previously packed, and the size member notes // how big that buffer is. // // FIXME: This buffer needs to become dynamic. byte m_buffer[1024]; size_t m_size; // During packing m_pos points to the first *unused* character in the // buffer. During unpacking m_pos points to the next byte that needs to be // unmarshalled. In both instances, m_pos points to the next spot in // the buffer to be used. byte *m_pos; // This variable keeps track whether this stream buffer is being used for // packing or unpacking of data. Direction m_dir; }; #endif // __StreamBuffer_h__ --- NEW FILE: Streamable.h --- // -*-C++-*- // // Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: Streamable.h,v 1.1 2002/02/08 06:19:56 lberger Exp $ #ifndef __Streamable_h__ #define __Streamable_h__ #include <net/Streamable.h> // The Streamable class is a templated class that is responsible for actually // writing an object into a stream buffer. The generic template simply // memcpy's the object into/out of the stream. For data structures that this // simple process will not work, then a specialized template should be // created. template < typename T > class Streamable { public: Streamable( T& obj ); void Stream( StreamBuffer& stream ); private: T& m_obj; }; template < typename T > Streamable< T >::Streamable( T& obj ) : m_obj( obj ) { } template < typename T > void Streamable< T >::Stream( StreamBuffer& stream ) { // FIXME: This function should be doing bounds checks on the stream. // If the stream is a packing stream, then copy our object into it. // Otherwise, copy the next data blob out of the stream buffer and into our // object. if ( stream.IsPacking() ) memcpy( stream.GetPosition(), &m_obj, sizeof( m_obj ) ); else memcpy( &m_obj, stream.GetPosition(), sizeof( m_obj ) ); // Regardless if we are packing or not, move the stream by the number of // bytes that we have used. stream.AdvanceStream( sizeof( m_obj ) ); } #endif // __Streamable_h__ Index: Makefile.am =================================================================== RCS file: /cvsroot/spaceninjas/spaceninjas/src/net/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 7 Feb 2002 06:14:44 -0000 1.1 --- Makefile.am 8 Feb 2002 06:19:56 -0000 1.2 *************** *** 1,37 **** # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ ! # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. ! # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. ! # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! # # $Id$ ! # CFLAGS = \ ! # @CFLAGS@ \ ! # $(LIBGLADE_CFLAGS) \ ! # `gnome-config gnomecanvaspixbuf --cflags` ! ! # bin_PROGRAMS = spaceninjas-client ! ! # spaceninjas_client_SOURCES = \ ! # main.c \ ! # callbacks.c ! ! # spaceninjas_client_LDADD = \ ! # $(GNOME_LIBDIR) \ ! # $(GNOMEUI_LIBS) \ ! # $(LIBGLADE_LIBS) ! # spaceninjas_client_LDFLAGS = \ ! # `gnome-config gnomecanvaspixbuf --libs` --- 1,29 ---- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ ! # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. ! # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. ! # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! # # $Id$ ! lib_LTLIBRARIES = libsnnet.la ! libsnnet_la_SOURCES = \ ! Event.h \ ! EventCreator.h \ ! EventCreatorBase.h \ ! EventFactory.cc \ ! EventFactory.h \ ! StreamBuffer.h \ ! Streamable.h |
From: Lee B. <lb...@us...> - 2002-02-08 06:19:59
|
Update of /cvsroot/spaceninjas/spaceninjas/src/net/events In directory usw-pr-cvs1:/tmp/cvs-serv16201/events Added Files: .cvsignore Log Message: Initial pass on the new event code. Nothing is integrated yet, but most of the framework has been implemented. --- NEW FILE: .cvsignore --- Makefile.in |
From: Lee B. <lb...@us...> - 2002-02-08 06:19:59
|
Update of /cvsroot/spaceninjas/spaceninjas/src/net/streamables In directory usw-pr-cvs1:/tmp/cvs-serv16201/streamables Added Files: .cvsignore Log Message: Initial pass on the new event code. Nothing is integrated yet, but most of the framework has been implemented. --- NEW FILE: .cvsignore --- Makefile.in |
From: Lee B. <lb...@us...> - 2002-02-08 06:17:03
|
Update of /cvsroot/spaceninjas/spaceninjas/src/net/streamables In directory usw-pr-cvs1:/tmp/cvs-serv15779/streamables Log Message: Directory /cvsroot/spaceninjas/spaceninjas/src/net/streamables added to the repository |
From: Lee B. <lb...@us...> - 2002-02-08 06:17:03
|
Update of /cvsroot/spaceninjas/spaceninjas/src/net/events In directory usw-pr-cvs1:/tmp/cvs-serv15779/events Log Message: Directory /cvsroot/spaceninjas/spaceninjas/src/net/events added to the repository |
From: Lee B. <lb...@us...> - 2002-02-08 02:21:28
|
Update of /cvsroot/spaceninjas/spaceninjas-client/src In directory usw-pr-cvs1:/tmp/cvs-serv32660/spaceninjas-client/src Removed Files: .cvsignore Makefile.am callbacks.c main.c main.h you.png Log Message: removed some unused projects --- .cvsignore DELETED --- --- Makefile.am DELETED --- --- callbacks.c DELETED --- --- main.c DELETED --- --- main.h DELETED --- --- you.png DELETED --- |
Update of /cvsroot/spaceninjas/spaceninjas-client In directory usw-pr-cvs1:/tmp/cvs-serv32660/spaceninjas-client Removed Files: .cvsignore AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README autogen.sh configure.in spaceninjas.glade Log Message: removed some unused projects --- .cvsignore DELETED --- --- AUTHORS DELETED --- --- COPYING DELETED --- --- ChangeLog DELETED --- --- INSTALL DELETED --- --- Makefile.am DELETED --- --- NEWS DELETED --- --- README DELETED --- --- autogen.sh DELETED --- --- configure.in DELETED --- --- spaceninjas.glade DELETED --- |
Update of /cvsroot/spaceninjas/spaceninjas-server In directory usw-pr-cvs1:/tmp/cvs-serv30487 Removed Files: .cvsignore AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README autogen.sh configure.in Log Message: removed unused projects --- .cvsignore DELETED --- --- AUTHORS DELETED --- --- COPYING DELETED --- --- ChangeLog DELETED --- --- INSTALL DELETED --- --- Makefile.am DELETED --- --- NEWS DELETED --- --- README DELETED --- --- autogen.sh DELETED --- --- configure.in DELETED --- |
From: Lee B. <lb...@us...> - 2002-02-08 02:15:48
|
Update of /cvsroot/spaceninjas/spaceninjas-server/src In directory usw-pr-cvs1:/tmp/cvs-serv30487/src Removed Files: .cvsignore Makefile.am main.c Log Message: removed unused projects --- .cvsignore DELETED --- --- Makefile.am DELETED --- --- main.c DELETED --- |
From: Anthony S. <si...@us...> - 2002-02-07 23:37:28
|
Update of /cvsroot/spaceninjas/spaceninjas/src/client In directory usw-pr-cvs1:/tmp/cvs-serv24254 Modified Files: callbacks.c main.c Log Message: Source beautification to forestall painful death at the hands of DrZam. Index: callbacks.c =================================================================== RCS file: /cvsroot/spaceninjas/spaceninjas/src/client/callbacks.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** callbacks.c 7 Feb 2002 20:07:40 -0000 1.2 --- callbacks.c 7 Feb 2002 23:37:25 -0000 1.3 *************** *** 64,68 **** case GDK_Home: dx = -1; ! if ( you_x % 2 == 0 ) // even dy = -1; break; --- 64,68 ---- case GDK_Home: dx = -1; ! if ( you_x % 2 == 0 ) dy = -1; break; *************** *** 70,74 **** case GDK_KP_Home: dx = -1; ! if ( you_x % 2 == 0 ) // even dy = -1; break; --- 70,74 ---- case GDK_KP_Home: dx = -1; ! if ( you_x % 2 == 0 ) dy = -1; break; *************** *** 76,80 **** case GDK_Page_Up: dx = 1; ! if ( you_x % 2 == 0 ) // even dy = -1; break; --- 76,80 ---- case GDK_Page_Up: dx = 1; ! if ( you_x % 2 == 0 ) dy = -1; break; *************** *** 82,86 **** case GDK_KP_Page_Up: dx = 1; ! if ( you_x % 2 == 0 ) // even dy = -1; break; --- 82,86 ---- case GDK_KP_Page_Up: dx = 1; ! if ( you_x % 2 == 0 ) dy = -1; break; *************** *** 88,92 **** case GDK_End: dx = -1; ! if ( you_x % 2 == 1 ) // odd dy = 1; break; --- 88,92 ---- case GDK_End: dx = -1; ! if ( you_x % 2 == 1 ) dy = 1; break; *************** *** 94,98 **** case GDK_KP_End: dx = -1; ! if ( you_x % 2 == 1 ) // odd dy = 1; break; --- 94,98 ---- case GDK_KP_End: dx = -1; ! if ( you_x % 2 == 1 ) dy = 1; break; *************** *** 100,104 **** case GDK_Page_Down: dx = 1; ! if ( you_x % 2 == 1 ) // odd dy = 1; break; --- 100,104 ---- case GDK_Page_Down: dx = 1; ! if ( you_x % 2 == 1 ) dy = 1; break; *************** *** 106,110 **** case GDK_KP_Page_Down: dx = 1; ! if ( you_x % 2 == 1 ) // odd dy = 1; break; --- 106,110 ---- case GDK_KP_Page_Down: dx = 1; ! if ( you_x % 2 == 1 ) dy = 1; break; Index: main.c =================================================================== RCS file: /cvsroot/spaceninjas/spaceninjas/src/client/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.c 7 Feb 2002 20:07:40 -0000 1.2 --- main.c 7 Feb 2002 23:37:25 -0000 1.3 *************** *** 227,231 **** } else if ( strcmp( cmd, "move" ) == 0 ) { on_server_move( args ); ! } else if ( strcmp( cmd, "me" ) == 0 ) { // changed this back to "me" to support the command processor on_server_emote( args ); } else { --- 227,231 ---- } else if ( strcmp( cmd, "move" ) == 0 ) { on_server_move( args ); ! } else if ( strcmp( cmd, "me" ) == 0 ) { on_server_emote( args ); } else { *************** *** 302,306 **** void ! on_server_emote( const gchar *args ) // Sid's Amazing Emote Handler! { gchar dup_args[1024]; --- 302,306 ---- void ! on_server_emote( const gchar *args ) { gchar dup_args[1024]; *************** *** 471,475 **** else { real_x = (double)x * ( hexpoint() * 3.0 ) + (double)BOARD_BORDER; ! real_y = (double)y * (double)CELL_SIZE + (double)BOARD_BORDER + ( (double)CELL_SIZE / 2.0 ); } --- 471,476 ---- else { real_x = (double)x * ( hexpoint() * 3.0 ) + (double)BOARD_BORDER; ! real_y = (double)y * (double)CELL_SIZE + (double)BOARD_BORDER ! + ( (double)CELL_SIZE / 2.0 ); } *************** *** 499,520 **** "x1", (double)BOARD_BORDER, "y1", (double)BOARD_BORDER, ! "x2", (double)( BOARD_BORDER + BOARD_SIZE * ( hexpoint() * 6.0 ) ), "y2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "fill_color", "white", NULL ); ! for ( i = 1; i < ( BOARD_SIZE * 2 ); i++ ) { // This iterates down the board ! for ( j = 0; j < 9; j++ ) { // This iterates across the board ! if ( i % 2 == 1 ) { // odd number offset = 2 * hexpoint(); } ! else { // even number offset = 5 * hexpoint(); } draw_a_hexagon( gnome_canvas_root( canvas ), ! BOARD_BORDER + offset + j * ( 6 * hexpoint() ), BOARD_BORDER + ( CELL_SIZE / 2 ) * i, THICKNESS, "white", "black" ); --- 500,523 ---- "x1", (double)BOARD_BORDER, "y1", (double)BOARD_BORDER, ! "x2", (double)( BOARD_BORDER + BOARD_SIZE ! * ( hexpoint() * 6.0 ) ), "y2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "fill_color", "white", NULL ); ! for ( i = 1; i < ( BOARD_SIZE * 2 ); i++ ) { ! for ( j = 0; j < 9; j++ ) { ! if ( i % 2 == 1 ) { offset = 2 * hexpoint(); } ! else { offset = 5 * hexpoint(); } draw_a_hexagon( gnome_canvas_root( canvas ), ! BOARD_BORDER + offset + j * ( 6 * hexpoint() ), ! BOARD_BORDER + ( CELL_SIZE / 2 ) * i, THICKNESS, "white", "black" ); |
From: Anthony S. <si...@us...> - 2002-02-07 20:07:46
|
Update of /cvsroot/spaceninjas/spaceninjas/src/client In directory usw-pr-cvs1:/tmp/cvs-serv30841 Modified Files: callbacks.c main.c Log Message: Changed grid from rectangle to hexagon, changed movement to coincide, coordinate system might need work, very crude for now, needs work all around. Index: callbacks.c =================================================================== RCS file: /cvsroot/spaceninjas/spaceninjas/src/client/callbacks.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** callbacks.c 7 Feb 2002 06:14:44 -0000 1.1 --- callbacks.c 7 Feb 2002 20:07:40 -0000 1.2 *************** *** 56,76 **** case GDK_KP_Down: dx = 0; dy = 1; break; ! case GDK_Right: dx = 1; dy = 0; break; ! case GDK_KP_Right: dx = 1; dy = 0; break; ! case GDK_Left: dx = -1; dy = 0; break; ! case GDK_KP_Left: dx = -1; dy = 0; break; ! case GDK_Home: dx = -1; dy = -1; break; ! case GDK_KP_Home: dx = -1; dy = -1; break; ! case GDK_Page_Up: dx = 1; dy = -1; break; ! case GDK_KP_Page_Up: dx = 1; dy = -1; break; ! case GDK_End: dx = -1; dy = 1; break; ! case GDK_KP_End: dx = -1; dy = 1; break; ! case GDK_Page_Down: dx = 1; dy = 1; break; ! case GDK_KP_Page_Down: dx = 1; dy = 1; break; case GDK_apostrophe: --- 56,112 ---- case GDK_KP_Down: dx = 0; dy = 1; break; ! case GDK_Left: break; ! case GDK_KP_Left: break; ! case GDK_Right: break; ! case GDK_KP_Right: break; ! case GDK_Home: ! dx = -1; ! if ( you_x % 2 == 0 ) // even ! dy = -1; ! break; ! ! case GDK_KP_Home: ! dx = -1; ! if ( you_x % 2 == 0 ) // even ! dy = -1; ! break; ! case GDK_Page_Up: ! dx = 1; ! if ( you_x % 2 == 0 ) // even ! dy = -1; ! break; ! ! case GDK_KP_Page_Up: ! dx = 1; ! if ( you_x % 2 == 0 ) // even ! dy = -1; ! break; ! case GDK_End: ! dx = -1; ! if ( you_x % 2 == 1 ) // odd ! dy = 1; ! break; ! ! case GDK_KP_End: ! dx = -1; ! if ( you_x % 2 == 1 ) // odd ! dy = 1; ! break; ! case GDK_Page_Down: ! dx = 1; ! if ( you_x % 2 == 1 ) // odd ! dy = 1; ! break; ! ! case GDK_KP_Page_Down: ! dx = 1; ! if ( you_x % 2 == 1 ) // odd ! dy = 1; ! break; case GDK_apostrophe: *************** *** 90,96 **** you_y += dy; ! you_x = MIN( you_x, BOARD_SIZE - 1 ); you_x = MAX( you_x, 0 ); ! you_y = MIN( you_y, BOARD_SIZE - 1 ); you_y = MAX( you_y, 0 ); --- 126,139 ---- you_y += dy; ! you_x = MIN( you_x, BOARD_SIZE + 1 ); you_x = MAX( you_x, 0 ); ! ! if ( you_x % 2 == 1 ) { ! you_y = MIN( you_y, BOARD_SIZE - 2 ); ! } ! else { ! you_y = MIN( you_y, BOARD_SIZE - 1 ); ! } ! you_y = MAX( you_y, 0 ); Index: main.c =================================================================== RCS file: /cvsroot/spaceninjas/spaceninjas/src/client/main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.c 7 Feb 2002 06:14:44 -0000 1.1 --- main.c 7 Feb 2002 20:07:40 -0000 1.2 *************** *** 24,27 **** --- 24,28 ---- #include <stdlib.h> #include <sys/socket.h> + #include <math.h> #include "main.h" *************** *** 44,47 **** --- 45,50 ---- GtkEntry *connect_dialog_port = NULL; + gdouble hexpoint(); + gchar your_nick[64]; int you_x = 0; *************** *** 352,355 **** --- 355,400 ---- } + gdouble + hexpoint() + { + gdouble hexcalc; + + hexcalc = ( (double)CELL_SIZE / 2.0 ) / ( tan( M_PI / 3.0 ) ); + + return hexcalc; + } + + void + draw_a_hexagon( GnomeCanvasGroup *group, + gdouble grid_x, gdouble grid_y, + gdouble thickness, + const char *fill_color, + const char *outline_color ) + { + GnomeCanvasPoints *points = gnome_canvas_points_new( 6 ); + + points->coords[0] = grid_x - hexpoint(); + points->coords[1] = grid_y + (double)CELL_SIZE / 2.0; + points->coords[2] = grid_x + hexpoint(); + points->coords[3] = grid_y + (double)CELL_SIZE / 2.0; + points->coords[4] = grid_x + 2.0 * hexpoint(); + points->coords[5] = grid_y; + points->coords[6] = grid_x + hexpoint(); + points->coords[7] = grid_y - (double)CELL_SIZE / 2.0; + points->coords[8] = grid_x - hexpoint(); + points->coords[9] = grid_y - (double)CELL_SIZE / 2.0; + points->coords[10] = grid_x - 2.0 * hexpoint(); + points-> coords[11] = grid_y; + + gnome_canvas_item_new( group, + gnome_canvas_polygon_get_type(), + "points", points, + "fill_color", fill_color, + "outline_color", outline_color, + "width_units", thickness, + NULL ); + + gnome_canvas_points_free( points ); + } void *************** *** 412,416 **** { GnomeCanvasGroup *avatar; ! int real_x, real_y; avatar = (GnomeCanvasGroup *)g_hash_table_lookup( avatar_hash, nick ); --- 457,461 ---- { GnomeCanvasGroup *avatar; ! gdouble real_x, real_y; avatar = (GnomeCanvasGroup *)g_hash_table_lookup( avatar_hash, nick ); *************** *** 420,429 **** } ! real_x = x * CELL_SIZE + BOARD_BORDER; ! real_y = y * CELL_SIZE + BOARD_BORDER; gnome_canvas_item_set( GNOME_CANVAS_ITEM( avatar ), ! "x", (double)real_x, ! "y", (double)real_y, NULL ); --- 465,480 ---- } ! if ( x % 2 == 0 ) { // even ! real_x = (double)x * ( hexpoint() * 3.0 ) + (double)BOARD_BORDER; ! real_y = (double)y * (double)CELL_SIZE + (double)BOARD_BORDER; ! } ! else { ! real_x = (double)x * ( hexpoint() * 3.0 ) + (double)BOARD_BORDER; ! real_y = (double)y * (double)CELL_SIZE + (double)BOARD_BORDER + ( (double)CELL_SIZE / 2.0 ); ! } gnome_canvas_item_set( GNOME_CANVAS_ITEM( avatar ), ! "x", real_x, ! "y", real_y, NULL ); *************** *** 441,445 **** void draw_grid() { ! int i; gnome_canvas_item_new( gnome_canvas_root( canvas ), --- 492,497 ---- void draw_grid() { ! int i, j; ! gdouble offset; gnome_canvas_item_new( gnome_canvas_root( canvas ), *************** *** 447,474 **** "x1", (double)BOARD_BORDER, "y1", (double)BOARD_BORDER, ! "x2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "y2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "fill_color", "white", NULL ); ! for ( i = 0; i <= BOARD_SIZE; i++ ) { ! draw_a_line( gnome_canvas_root( canvas ), ! BOARD_BORDER, ! BOARD_BORDER + i * CELL_SIZE, ! BOARD_BORDER + BOARD_SIZE * CELL_SIZE, ! BOARD_BORDER + i * CELL_SIZE, ! THICKNESS, ! "black" ); ! } - for ( i = 0; i <= BOARD_SIZE; i++ ) { - draw_a_line( gnome_canvas_root( canvas ), - BOARD_BORDER + i * CELL_SIZE, - BOARD_BORDER, - BOARD_BORDER + i * CELL_SIZE, - BOARD_BORDER + BOARD_SIZE * CELL_SIZE, - THICKNESS, - "black" ); - } status_text = gnome_canvas_item_new( gnome_canvas_root( canvas ), --- 499,525 ---- "x1", (double)BOARD_BORDER, "y1", (double)BOARD_BORDER, ! "x2", (double)( BOARD_BORDER + BOARD_SIZE * ( hexpoint() * 6.0 ) ), "y2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "fill_color", "white", NULL ); ! for ( i = 1; i < ( BOARD_SIZE * 2 ); i++ ) { // This iterates down the board ! ! for ( j = 0; j < 9; j++ ) { // This iterates across the board ! ! if ( i % 2 == 1 ) { // odd number ! offset = 2 * hexpoint(); ! } ! else { // even number ! offset = 5 * hexpoint(); ! } ! ! draw_a_hexagon( gnome_canvas_root( canvas ), ! BOARD_BORDER + offset + j * ( 6 * hexpoint() ), BOARD_BORDER + ( CELL_SIZE / 2 ) * i, ! THICKNESS, "white", "black" ); ! ! } ! } status_text = gnome_canvas_item_new( gnome_canvas_root( canvas ), |
From: Lee B. <lb...@us...> - 2002-02-07 06:14:47
|
Update of /cvsroot/spaceninjas/spaceninjas/src/server In directory usw-pr-cvs1:/tmp/cvs-serv24733/src/server Added Files: .cvsignore Makefile.am main.c Log Message: initial tree --- NEW FILE: .cvsignore --- Makefile.in --- NEW FILE: Makefile.am --- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: Makefile.am,v 1.1 2002/02/07 06:14:44 lberger Exp $ CFLAGS = \ @CFLAGS@ \ $(GLIB_CFLAGS) \ $(GUILE_CFLAGS) bin_PROGRAMS = spaceninjas-server spaceninjas_server_SOURCES = \ main.c spaceninjas_server_LDADD = \ $(GLIB_LIBS) spaceninjas_server_LDFLAGS = \ $(GUILE_LDFLAGS) --- NEW FILE: main.c --- /* ** Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: main.c,v 1.1 2002/02/07 06:14:44 lberger Exp $ */ #include <arpa/inet.h> #include <glib.h> #include <guile/gh.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> GMainLoop *main_loop = NULL; GSList *clients = NULL; gboolean OnServerRead( GIOChannel *source, GIOCondition condition, gpointer data ); gboolean OnClientRead( GIOChannel *source, GIOCondition condition, gpointer data ); void InitServer(); void sns_main( int argc, char *argv[] ); void InitServer() { int fd; GIOChannel *io_chan; struct sockaddr_in addr; // create a socket. fd = socket( PF_INET, SOCK_STREAM, 0 ); if ( fd < 0 ) { perror( "socket" ); exit( EXIT_FAILURE ); } // bind it to a port addr.sin_family = AF_INET; addr.sin_port = htons( 5555 ); addr.sin_addr.s_addr = htonl( INADDR_ANY ); if ( bind( fd, ( struct sockaddr * )&addr, sizeof( addr ) ) < 0 ) { perror( "bind" ); exit( EXIT_FAILURE ); } // allow connections. if ( listen( fd, 1 ) < 0 ) { perror( "listen" ); exit( EXIT_FAILURE ); } // make the io channel. io_chan = g_io_channel_unix_new( fd ); g_io_add_watch( io_chan, G_IO_IN, OnServerRead, NULL ); printf( "server initialized.\n" ); } gboolean OnServerRead( GIOChannel *source, GIOCondition condition, gpointer data ) { int fd; GIOChannel *io_chan; // connect to the client. fd = accept( g_io_channel_unix_get_fd( source ), NULL, 0 ); if ( fd < 0 ) { perror( "accept" ); exit( EXIT_FAILURE ); } // make the io channel. io_chan = g_io_channel_unix_new( fd ); g_io_add_watch( io_chan, G_IO_IN, OnClientRead, NULL ); clients = g_slist_append( clients, io_chan ); printf( "client connected\n" ); return TRUE; } gboolean OnClientRead( GIOChannel *source, GIOCondition condition, gpointer data ) { size_t bytes_read; char msg[1024]; GSList *iter; // read in the data from the client. g_io_channel_read( source, msg, sizeof( msg ), &bytes_read ); msg[bytes_read] = 0; // we read zero bytes when the client disconnects. if ( bytes_read == 0 ) { printf( "client disconnected\n" ); clients = g_slist_remove( clients, source ); g_io_channel_close( source ); g_io_channel_unref( source ); return FALSE; } // display to "console" the client's message. printf( "client: %s\n", msg ); // echo the message to the clients. for ( iter = clients; iter != NULL; iter = g_slist_next( iter ) ) { GIOChannel *channel = iter->data; guint bytes_written; g_io_channel_write( channel, msg, bytes_read, &bytes_written ); } return TRUE; } int main( int argc, char *argv[] ) { gh_enter( argc, argv, sns_main ); /* gn_enter never returns, but just to be paranoid */ g_assert( FALSE ); return 0; } void sns_main( int argc, char *argv[] ) { main_loop = g_main_new( FALSE ); InitServer(); g_main_run( main_loop ); } |
Update of /cvsroot/spaceninjas/spaceninjas In directory usw-pr-cvs1:/tmp/cvs-serv24733 Added Files: .cvsignore AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README acconfig.h autogen.sh configure.in Log Message: initial tree --- NEW FILE: .cvsignore --- Makefile.in aclocal.m4 config.guess config.h.in config.sub configure ltconfig ltmain.sh stamp-h.in spaceninjas.glade.bak --- NEW FILE: AUTHORS --- Lee Berger <lb...@ro...> Steve Elliott <tha...@us...> Anthony Speagle <ea...@si...> Every attempt has been made to keep this file up to date. If there are any errors in this list please contact Lee Berger <lb...@ro...>. --- NEW FILE: COPYING --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: ChangeLog --- --- NEW FILE: INSTALL --- Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. --- NEW FILE: Makefile.am --- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: Makefile.am,v 1.1 2002/02/07 06:14:43 lberger Exp $ AUTOMAKE_OPTIONS = 1.4 SUBDIRS = src data EXTRA_DIST = spaceninjas.glade --- NEW FILE: NEWS --- --- NEW FILE: README --- --- NEW FILE: acconfig.h --- #undef DATA_DIR --- NEW FILE: autogen.sh --- #!/bin/sh # # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: autogen.sh,v 1.1 2002/02/07 06:14:43 lberger Exp $ # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. PKG_NAME="Space Ninjas" (test -f $srcdir/configure.in \ ## put other tests here ) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level $PKG_NAME directory" exit 1 } which gnome-autogen.sh || { echo "You need to install gnome-common from the GNOME CVS tree" exit 1; } . gnome-autogen.sh --- NEW FILE: configure.in --- dnl Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl dnl dnl $Id: configure.in,v 1.1 2002/02/07 06:14:43 lberger Exp $ AC_PREREQ(2.13) AC_INIT(configure.in) AM_CONFIG_HEADER(src/config.h) AM_INIT_AUTOMAKE(spaceninjas, 0.1) AM_MAINTAINER_MODE GNOME_COMMON_INIT AC_ISC_POSIX AC_PROG_CC AC_PROG_CPP AC_STDC_HEADERS AC_ARG_PROGRAM AM_PROG_LIBTOOL GNOME_INIT # for some reason, when this is turned on main.c doesn't compile because gcc # claims that draw_grid() isn't prototyped even though it is. however, if # draw_grid() is given a parameter that isn't used, gcc doesn't give the # warning??? #GNOME_COMPILE_WARNINGS GUILE_FLAGS AM_PATH_GLIB( 1.2.10,, AC_MSG_ERROR(Cannot find GLIB: Please install it version 1.2.10+)) AM_PATH_LIBGLADE(, AC_MSG_ERROR(Cannot find LibGlade: Please install it.), gnome) AM_PATH_GDK_PIXBUF( 0.14.0,, AC_MSG_ERROR(Cannot find Gdk-Pixbuf: Please install version 0.14.0+)) # FIXME: make an option to specify this... BASE_DIR=`pwd` AC_DEFINE_UNQUOTED(DATA_DIR, "${BASE_DIR}/data/") # make sure that errors get turned on, and warnings are compile errors. CFLAGS="${CFLAGS} -Wall -Werror" AC_OUTPUT([ Makefile data/Makefile src/Makefile src/client/Makefile src/net/Makefile src/server/Makefile ]) |
From: Lee B. <lb...@us...> - 2002-02-07 06:14:46
|
Update of /cvsroot/spaceninjas/spaceninjas/src/client In directory usw-pr-cvs1:/tmp/cvs-serv24733/src/client Added Files: .cvsignore Makefile.am callbacks.c main.c main.h Log Message: initial tree --- NEW FILE: .cvsignore --- Makefile.in --- NEW FILE: Makefile.am --- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: Makefile.am,v 1.1 2002/02/07 06:14:43 lberger Exp $ CFLAGS = \ @CFLAGS@ \ $(LIBGLADE_CFLAGS) \ `gnome-config gnomecanvaspixbuf --cflags` bin_PROGRAMS = spaceninjas-client spaceninjas_client_SOURCES = \ main.c \ callbacks.c spaceninjas_client_LDADD = \ $(GNOME_LIBDIR) \ $(GNOMEUI_LIBS) \ $(LIBGLADE_LIBS) spaceninjas_client_LDFLAGS = \ `gnome-config gnomecanvaspixbuf --libs` --- NEW FILE: callbacks.c --- /* ** Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: callbacks.c,v 1.1 2002/02/07 06:14:44 lberger Exp $ */ #include "main.h" void on_exit_activate() { gtk_main_quit(); } void on_about_activate() { GladeXML *xml = get_xml( "about_dialog" ); g_assert( xml != NULL ); gtk_object_unref( GTK_OBJECT( xml ) ); } gint on_board_key_press_event( GtkWidget *item, GdkEventKey *event, gpointer data ) { int dx = 0; int dy = 0; switch ( event->keyval ) { case GDK_Up: dx = 0; dy = -1; break; case GDK_KP_Up: dx = 0; dy = -1; break; case GDK_Down: dx = 0; dy = 1; break; case GDK_KP_Down: dx = 0; dy = 1; break; case GDK_Right: dx = 1; dy = 0; break; case GDK_KP_Right: dx = 1; dy = 0; break; case GDK_Left: dx = -1; dy = 0; break; case GDK_KP_Left: dx = -1; dy = 0; break; case GDK_Home: dx = -1; dy = -1; break; case GDK_KP_Home: dx = -1; dy = -1; break; case GDK_Page_Up: dx = 1; dy = -1; break; case GDK_KP_Page_Up: dx = 1; dy = -1; break; case GDK_End: dx = -1; dy = 1; break; case GDK_KP_End: dx = -1; dy = 1; break; case GDK_Page_Down: dx = 1; dy = 1; break; case GDK_KP_Page_Down: dx = 1; dy = 1; break; case GDK_apostrophe: gtk_widget_grab_focus( GTK_WIDGET( input ) ); return TRUE; default: return FALSE; } if ( event->state & GDK_CONTROL_MASK ) { dx *= 5; dy *= 5; } you_x += dx; you_y += dy; you_x = MIN( you_x, BOARD_SIZE - 1 ); you_x = MAX( you_x, 0 ); you_y = MIN( you_y, BOARD_SIZE - 1 ); you_y = MAX( you_y, 0 ); write_to_server( "move (%d,%d) %s", you_x, you_y, your_nick ); return TRUE; } void on_input_activate( GtkEditable *input, gpointer user_data ) { gchar *text = gtk_entry_get_text( GTK_ENTRY( input ) ); gchar msg[1024]; gchar cmd[1024]; if ( text[0] == '/' ) { sscanf( text, "/%s %[^-]", cmd, msg ); write_to_server( "%s %s: %s", cmd, your_nick, msg ); } else { write_to_server( "say %s: %s", your_nick, text ); } gtk_entry_set_text( GTK_ENTRY( input ), "" ); gtk_widget_grab_focus( GTK_WIDGET( canvas ) ); } void on_connect_okay_clicked( GtkButton *button, gpointer user_data ) { gchar *nick = gtk_entry_get_text( connect_dialog_nick ); gchar *server = gtk_entry_get_text( connect_dialog_address ); gchar *port_text = gtk_entry_get_text( connect_dialog_port ); unsigned short int port = atoi( port_text ); connect_to_server( nick, server, port ); } void on_connect_dialog_clicked( GnomeDialog *gnomedialog, gint arg1, gpointer user_data ) { printf( "on_connect_dialog_clicked %d\n", arg1 ); } gint on_connect_dialog_close( GnomeDialog *gnomedialog, gpointer user_data ) { if ( server_io_chan == NULL ) gtk_main_quit(); return FALSE; } --- NEW FILE: main.c --- /* ** Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: main.c,v 1.1 2002/02/07 06:14:44 lberger Exp $ */ #include <arpa/inet.h> #include <netdb.h> #include <stdlib.h> #include <sys/socket.h> #include "main.h" GnomeApp *app = NULL; GnomeCanvas *canvas = NULL; GnomeCanvasGroup *boardgroup = NULL; GnomeCanvasItem *status_text = NULL; GnomeCanvasGroup *status_image = NULL; GnomeCanvasGroup *you = NULL; GtkWidget *input = NULL; GtkWidget *history = NULL; GIOChannel *server_io_chan = NULL; GtkEntry *connect_dialog_nick = NULL; GtkEntry *connect_dialog_address = NULL; GtkEntry *connect_dialog_port = NULL; gchar your_nick[64]; int you_x = 0; int you_y = 0; GHashTable *avatar_hash; gboolean on_server_read( GIOChannel *source, GIOCondition condition, gpointer data ); void init_sockaddr( struct sockaddr_in *name, const char *hostname, unsigned short int port ); void on_server_connect( const gchar *args ); void on_server_say( const gchar *args ); void on_server_move( const gchar *args ); void on_server_emote( const gchar *args ); void process_command( const gchar *cmd, const gchar *args ); void create_avatar( const gchar *ags, int x, int y ); void move_avatar( const gchar *ags, int x, int y ); void draw_a_line( GnomeCanvasGroup *group, gint x1, gint y1, gint x2, gint y2, gdouble thickness, const char *color ); void draw_grid(); void init_sockaddr( struct sockaddr_in *name, const char *hostname, unsigned short int port ) { struct hostent *hostinfo; name->sin_family = AF_INET; name->sin_port = htons (port); hostinfo = gethostbyname( hostname ); if (hostinfo == NULL) { fprintf (stderr, "Unknown host %s.\n", hostname); exit (EXIT_FAILURE); } name->sin_addr = *(struct in_addr *) hostinfo->h_addr; } void connect_to_server( const char *nick, const char *server, unsigned short int port ) { struct sockaddr_in addr; int fd; int x, y; printf( "connecting to %s:%d as %s\n", server, port, nick ); // create the socket. fd = socket( PF_INET, SOCK_STREAM, 0 ); if ( fd < 0 ) { perror( "creating client socket" ); exit( EXIT_FAILURE ); } // connect to the server. init_sockaddr( &addr, server, port ); if ( connect( fd, (struct sockaddr *)&addr, sizeof( addr ) ) < 0 ) { perror( "connect" ); exit( EXIT_FAILURE ); } // make the io channel. server_io_chan = g_io_channel_unix_new( fd ); g_io_add_watch( server_io_chan, G_IO_IN, on_server_read, NULL ); // send the connect message. x = (int)( (double)BOARD_SIZE * rand() / ( RAND_MAX + 1.0 ) ); y = (int)( (double)BOARD_SIZE * rand() / ( RAND_MAX + 1.0 ) ); write_to_server( "connect (%d,%d) %s", x, y, nick ); strcpy( your_nick, nick ); printf( "connected to server.\n" ); } void write_to_server( const gchar *fmt, ... ) { gchar msg[1024]; gint bytes_written; va_list args; va_start( args, fmt ); vsnprintf( msg, sizeof( msg ), fmt, args ); strcat( msg, "\n" ); va_end( args ); g_io_channel_write( server_io_chan, msg, strlen( msg ), &bytes_written ); } gboolean on_server_read( GIOChannel *source, GIOCondition condition, gpointer data ) { size_t bytes_read; gchar msg[1024]; gchar *next_cmd; gchar *cmd; gchar *args; // read in the data from the server g_io_channel_read( source, msg, sizeof( msg ), &bytes_read ); msg[bytes_read] = '\0' ; // we read zero bytes when the server disconnects. if ( bytes_read == 0 ) { printf( "server disconnected\n" ); g_io_channel_close( source ); g_io_channel_unref( source ); gtk_main_quit(); return FALSE; } cmd = msg; next_cmd = msg; while ( *next_cmd != '\0' ) { next_cmd = strchr( cmd, '\n' ); *next_cmd = 0; ++next_cmd; // find the command name and dispatch to the handler. args = strchr( cmd, ' ' ); if ( args != NULL ) { *args = '\0'; ++args; } process_command( cmd, args ); cmd = next_cmd; } return TRUE; } void process_command( const gchar *cmd, const gchar *args ) { if ( strcmp( cmd, "say" ) == 0 ) { on_server_say( args ); } else if ( strcmp( cmd, "connect" ) == 0 ) { on_server_connect( args ); } else if ( strcmp( cmd, "move" ) == 0 ) { on_server_move( args ); } else if ( strcmp( cmd, "me" ) == 0 ) { // changed this back to "me" to support the command processor on_server_emote( args ); } else { printf( "server: %s( %s )\n", cmd, args ); } } void on_server_connect( const gchar *args ) { int x, y; int c; const gchar *nick; sscanf( args, "(%d,%d) %n", &x, &y, &c ); nick = args + c; create_avatar( nick, x, y ); } void on_server_move( const gchar *args ) { int x, y; int c; const char *nick; sscanf( args, "(%d,%d) %n", &x, &y, &c ); nick = args + c; move_avatar( nick, x, y ); } void on_server_say( const gchar *args ) { gchar dup_args[1024]; gchar chat_msg[1024]; gchar *name; gchar *msg; GdkColor name_color; GdkColormap *cmap = gdk_colormap_get_system(); gdk_color_parse( "blue", &name_color ); gdk_colormap_alloc_color( cmap, &name_color, FALSE, TRUE ); strcpy( dup_args, args ); name = dup_args; msg = strchr( dup_args, ':' ); ++msg; *msg = 0; ++msg; snprintf( chat_msg, sizeof( chat_msg ), " %s\n", msg ); gtk_text_insert( GTK_TEXT( history ), NULL, &name_color, NULL, name, strlen( name ) ); gtk_text_insert( GTK_TEXT( history ), NULL, NULL, NULL, chat_msg, strlen( chat_msg ) ); } void on_server_emote( const gchar *args ) // Sid's Amazing Emote Handler! { gchar dup_args[1024]; gchar emote[1024]; gchar *name; gchar *msg; GdkColor emote_color; GdkColormap *cmap = gdk_colormap_get_system(); gdk_color_parse( "red", &emote_color ); gdk_colormap_alloc_color( cmap, &emote_color, FALSE, TRUE ); strcpy( dup_args, args ); name = dup_args; msg = strchr( dup_args, ':' ); *msg = 0; ++msg; snprintf( emote, sizeof( emote ), "* %s%s\n", name, msg ); gtk_text_insert( GTK_TEXT( history ), NULL, &emote_color, NULL, emote, strlen( emote ) ); } void draw_a_line( GnomeCanvasGroup *group, gint x1, gint y1, gint x2, gint y2, gdouble thickness, const char *color ) { GnomeCanvasPoints *points = gnome_canvas_points_new( 2 ); points->coords[0] = x1; points->coords[1] = y1; points->coords[2] = x2; points->coords[3] = y2; gnome_canvas_item_new( group, gnome_canvas_line_get_type(), "points", points, "fill_color", color, "width_units", thickness, NULL ); gnome_canvas_points_free( points ); } void create_avatar( const gchar *nick, gint x, gint y ) { GdkPixbuf *you_png = gdk_pixbuf_new_from_file( DATA_DIR "you.png" ); GnomeCanvasItem *item; GnomeCanvasGroup *avatar; item = gnome_canvas_item_new( gnome_canvas_root( canvas ), gnome_canvas_group_get_type(), "x", (double)BOARD_BORDER, "y", (double)BOARD_BORDER, NULL ); avatar = GNOME_CANVAS_GROUP( item ); gnome_canvas_item_new( avatar, gnome_canvas_pixbuf_get_type(), "pixbuf", you_png, "x", (double)0, "y", (double)0, NULL ); gnome_canvas_item_new( avatar, gnome_canvas_text_get_type(), "x", (double)17, "y", (double)29, "text", nick, "justification", GTK_JUSTIFY_CENTER, "anchor", GTK_ANCHOR_CENTER, "fill_color", "black", "font", "-*-clean-medium-r-normal-*-12-*-*-*-*-*-*", NULL ); gnome_canvas_item_new( avatar, gnome_canvas_text_get_type(), "x", (double)16, "y", (double)28, "text", nick, "justification", GTK_JUSTIFY_CENTER, "anchor", GTK_ANCHOR_CENTER, "fill_color", "blue", "font", "-*-clean-medium-r-normal-*-12-*-*-*-*-*-*", NULL ); gdk_pixbuf_unref( you_png ); g_hash_table_insert( avatar_hash, g_strdup( nick ), avatar ); move_avatar( nick, x, y ); } void move_avatar( const gchar *nick, gint x, gint y ) { GnomeCanvasGroup *avatar; int real_x, real_y; avatar = (GnomeCanvasGroup *)g_hash_table_lookup( avatar_hash, nick ); if ( avatar == NULL ) { create_avatar( nick, x, y ); return; } real_x = x * CELL_SIZE + BOARD_BORDER; real_y = y * CELL_SIZE + BOARD_BORDER; gnome_canvas_item_set( GNOME_CANVAS_ITEM( avatar ), "x", (double)real_x, "y", (double)real_y, NULL ); gnome_canvas_item_move( GNOME_CANVAS_ITEM( avatar ), 0, 0 ); // hack if ( strcmp( nick, your_nick ) == 0 ) { you_x = x; you_y = y; } } void draw_grid() { int i; gnome_canvas_item_new( gnome_canvas_root( canvas ), gnome_canvas_rect_get_type(), "x1", (double)BOARD_BORDER, "y1", (double)BOARD_BORDER, "x2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "y2", (double)( BOARD_BORDER + BOARD_SIZE * CELL_SIZE ), "fill_color", "white", NULL ); for ( i = 0; i <= BOARD_SIZE; i++ ) { draw_a_line( gnome_canvas_root( canvas ), BOARD_BORDER, BOARD_BORDER + i * CELL_SIZE, BOARD_BORDER + BOARD_SIZE * CELL_SIZE, BOARD_BORDER + i * CELL_SIZE, THICKNESS, "black" ); } for ( i = 0; i <= BOARD_SIZE; i++ ) { draw_a_line( gnome_canvas_root( canvas ), BOARD_BORDER + i * CELL_SIZE, BOARD_BORDER, BOARD_BORDER + i * CELL_SIZE, BOARD_BORDER + BOARD_SIZE * CELL_SIZE, THICKNESS, "black" ); } status_text = gnome_canvas_item_new( gnome_canvas_root( canvas ), gnome_canvas_text_get_type(), "x", (double)BOARD_BORDER, "y", (double)( BOARD_SIZE * CELL_SIZE + BOARD_BORDER ), "anchor", GTK_ANCHOR_WEST, "font", "fixed", "fill_color", "black", "text", "", NULL ); status_image = NULL; } GladeXML * get_xml( const char *root ) { GladeXML *xml = NULL; g_return_val_if_fail( root != NULL, NULL ); xml = glade_xml_new( DATA_DIR "spaceninjas.glade", root ); if ( xml == NULL ) { g_warning( "could not open " DATA_DIR "spaceninjas.glade" ); return NULL; } return xml; } int main( int argc, char *argv[] ) { GladeXML *xml; GtkWidget *w; srand( time( NULL ) ); avatar_hash = g_hash_table_new( g_str_hash, g_str_equal ); #ifdef ENABLE_NLS bindtextdomain( PACKAGE, PACKAGE_LOCALE_DIR ); textdomain( PACKAGE ); #endif gtk_set_locale(); gnome_init( PACKAGE, VERSION, argc, argv ); glade_gnome_init(); gdk_rgb_init(); xml = get_xml( "main_window" ); g_assert( xml != NULL ); w = glade_xml_get_widget( xml, "board" ); canvas = GNOME_CANVAS( w ); input = glade_xml_get_widget( xml, "input" ); history = glade_xml_get_widget( xml, "history" ); gnome_canvas_set_scroll_region( canvas, 0.0, 0.0, BOARD_SIZE * CELL_SIZE + 2 * BOARD_BORDER, BOARD_SIZE * CELL_SIZE + 2 * BOARD_BORDER ); gtk_widget_set_usize( GTK_WIDGET( canvas ), BOARD_SIZE * CELL_SIZE + 2 * BOARD_BORDER, BOARD_SIZE * CELL_SIZE + 2 * BOARD_BORDER ); glade_xml_signal_autoconnect( xml ); gtk_object_unref( GTK_OBJECT( xml ) ); ///// xml = get_xml( "connect_dialog" ); g_assert( xml != NULL ); w = glade_xml_get_widget( xml, "nick" ); connect_dialog_nick = GTK_ENTRY( w ); w = glade_xml_get_widget( xml, "server_address" ); connect_dialog_address = GTK_ENTRY( w ); w = glade_xml_get_widget( xml, "server_port" ); connect_dialog_port = GTK_ENTRY( w ); glade_xml_signal_autoconnect( xml ); gtk_object_unref( GTK_OBJECT( xml ) ); ///// draw_grid(); gtk_main(); return 0; } --- NEW FILE: main.h --- /* ** Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: main.h,v 1.1 2002/02/07 06:14:44 lberger Exp $ */ #ifndef __main_h__ #define __main_h__ #include <config.h> #include <gnome.h> #include <glade/glade.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gnome-canvas-pixbuf.h> #include <gdk/gdkkeysyms.h> #define BOARD_SIZE 16 #define BOARD_BORDER 15 #define CELL_SIZE 32 #define THICKNESS 1 extern GnomeApp *app; extern GnomeCanvas *canvas; extern GnomeCanvasGroup *boardgroup; extern GnomeCanvasItem *status_text; extern GnomeCanvasGroup *status_image; extern GnomeCanvasGroup *you; extern GtkWidget *input; extern GtkWidget *history; extern GIOChannel *server_io_chan; extern GtkEntry *connect_dialog_nick; extern GtkEntry *connect_dialog_address; extern GtkEntry *connect_dialog_port; extern gchar your_nick[64]; extern int you_x; extern int you_y; GladeXML *get_xml( const char *root ); void connect_to_server( const char *nick, const char *hostname, unsigned short int port ); void write_to_server( const gchar *fmt, ... ); #endif // __main_h__ |
From: Lee B. <lb...@us...> - 2002-02-07 06:14:46
|
Update of /cvsroot/spaceninjas/spaceninjas/src/net In directory usw-pr-cvs1:/tmp/cvs-serv24733/src/net Added Files: .cvsignore Makefile.am Log Message: initial tree --- NEW FILE: .cvsignore --- Makefile.in --- NEW FILE: Makefile.am --- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: Makefile.am,v 1.1 2002/02/07 06:14:44 lberger Exp $ # CFLAGS = \ # @CFLAGS@ \ # $(LIBGLADE_CFLAGS) \ # `gnome-config gnomecanvaspixbuf --cflags` # bin_PROGRAMS = spaceninjas-client # spaceninjas_client_SOURCES = \ # main.c \ # callbacks.c # spaceninjas_client_LDADD = \ # $(GNOME_LIBDIR) \ # $(GNOMEUI_LIBS) \ # $(LIBGLADE_LIBS) # spaceninjas_client_LDFLAGS = \ # `gnome-config gnomecanvaspixbuf --libs` |
From: Lee B. <lb...@us...> - 2002-02-07 06:14:46
|
Update of /cvsroot/spaceninjas/spaceninjas/src In directory usw-pr-cvs1:/tmp/cvs-serv24733/src Added Files: .cvsignore Makefile.am Log Message: initial tree --- NEW FILE: .cvsignore --- Makefile.in config.h.in stamp-h.in --- NEW FILE: Makefile.am --- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: Makefile.am,v 1.1 2002/02/07 06:14:43 lberger Exp $ SUBDIRS = net server client |
From: Lee B. <lb...@us...> - 2002-02-07 06:14:46
|
Update of /cvsroot/spaceninjas/spaceninjas/data In directory usw-pr-cvs1:/tmp/cvs-serv24733/data Added Files: .cvsignore Makefile.am spaceninjas.glade you.png Log Message: initial tree --- NEW FILE: .cvsignore --- spaceninjas.glade.bak Makefile.in --- NEW FILE: Makefile.am --- # Copyright (C) 2002 The Space Ninjas Team. http://www.spaceninjas.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: Makefile.am,v 1.1 2002/02/07 06:14:43 lberger Exp $ EXTRA_DIST = \ spaceninjas.glade \ you.png --- NEW FILE: spaceninjas.glade --- <?xml version="1.0"?> <GTK-Interface> <project> <name>Space Ninjas</name> <program_name>spaceninjas</program_name> <directory></directory> <source_directory>src</source_directory> <pixmaps_directory>pixmaps</pixmaps_directory> <language>C</language> <gnome_support>True</gnome_support> <gettext_support>False</gettext_support> </project> <widget> <class>GnomeAbout</class> <name>about_dialog</name> <modal>True</modal> <copyright>(c) 2001 by Lee Berger</copyright> <authors>Lee Berger </authors> <comments>omg space ninjas plz. homepage: http://www.spaceninjas.org/</comments> </widget> <widget> <class>GnomeApp</class> <name>main_window</name> <signal> <name>destroy</name> <handler>on_exit_activate</handler> <last_modification_time>Mon, 21 Jan 2002 20:05:17 GMT</last_modification_time> </signal> <title>Space Ninjas</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> <allow_shrink>False</allow_shrink> <allow_grow>True</allow_grow> <auto_shrink>False</auto_shrink> <enable_layout_config>True</enable_layout_config> <widget> <class>GnomeDock</class> <child_name>GnomeApp:dock</child_name> <name>dock1</name> <allow_floating>True</allow_floating> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> <widget> <class>GnomeDockItem</class> <name>dockitem1</name> <border_width>2</border_width> <placement>GNOME_DOCK_TOP</placement> <band>0</band> <position>0</position> <offset>0</offset> <locked>False</locked> <exclusive>True</exclusive> <never_floating>False</never_floating> <never_vertical>True</never_vertical> <never_horizontal>False</never_horizontal> <shadow_type>GTK_SHADOW_OUT</shadow_type> <widget> <class>GtkMenuBar</class> <name>menubar1</name> <shadow_type>GTK_SHADOW_NONE</shadow_type> <widget> <class>GtkMenuItem</class> <name>game1</name> <label>_Game</label> <right_justify>False</right_justify> <widget> <class>GtkMenu</class> <name>game1_menu</name> <widget> <class>GtkPixmapMenuItem</class> <name>exit1</name> <signal> <name>activate</name> <handler>on_exit_activate</handler> <last_modification_time>Mon, 21 Jan 2002 20:03:25 GMT</last_modification_time> </signal> <stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item> </widget> </widget> </widget> <widget> <class>GtkMenuItem</class> <name>help1</name> <stock_item>GNOMEUIINFO_MENU_HELP_TREE</stock_item> <widget> <class>GtkMenu</class> <name>help1_menu</name> <widget> <class>GtkPixmapMenuItem</class> <name>about1</name> <signal> <name>activate</name> <handler>on_about_activate</handler> <last_modification_time>Mon, 21 Jan 2002 20:02:32 GMT</last_modification_time> </signal> <stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item> </widget> </widget> </widget> </widget> </widget> <widget> <class>GnomeDockItem</class> <name>dockitem2</name> <border_width>1</border_width> <placement>GNOME_DOCK_TOP</placement> <band>1</band> <position>0</position> <offset>0</offset> <locked>False</locked> <exclusive>True</exclusive> <never_floating>False</never_floating> <never_vertical>False</never_vertical> <never_horizontal>False</never_horizontal> <shadow_type>GTK_SHADOW_OUT</shadow_type> <widget> <class>GtkToolbar</class> <name>toolbar1</name> <border_width>1</border_width> <orientation>GTK_ORIENTATION_HORIZONTAL</orientation> <type>GTK_TOOLBAR_BOTH</type> <space_size>16</space_size> <space_style>GTK_TOOLBAR_SPACE_LINE</space_style> <relief>GTK_RELIEF_NONE</relief> <tooltips>True</tooltips> <widget> <class>GtkButton</class> <child_name>Toolbar:button</child_name> <name>button4</name> <signal> <name>clicked</name> <handler>on_exit_activate</handler> <last_modification_time>Mon, 21 Jan 2002 20:11:43 GMT</last_modification_time> </signal> <label>Exit</label> <stock_pixmap>GNOME_STOCK_PIXMAP_EXIT</stock_pixmap> </widget> </widget> </widget> <widget> <class>GtkHPaned</class> <child_name>GnomeDock:contents</child_name> <name>hpaned1</name> <handle_size>10</handle_size> <gutter_size>12</gutter_size> <position>0</position> <widget> <class>GnomeCanvas</class> <child_name>GnomeDock:contents</child_name> <name>board</name> <can_focus>True</can_focus> <has_focus>True</has_focus> <signal> <name>key_press_event</name> <handler>on_board_key_press_event</handler> <after>True</after> <last_modification_time>Sun, 27 Jan 2002 01:49:43 GMT</last_modification_time> </signal> <anti_aliased>True</anti_aliased> <scroll_x1>0</scroll_x1> <scroll_y1>0</scroll_y1> <scroll_x2>100</scroll_x2> <scroll_y2>100</scroll_y2> <pixels_per_unit>1</pixels_per_unit> <child> <shrink>False</shrink> <resize>False</resize> </child> </widget> <widget> <class>GtkVBox</class> <name>vbox1</name> <homogeneous>False</homogeneous> <spacing>0</spacing> <child> <shrink>True</shrink> <resize>True</resize> </child> <widget> <class>GtkScrolledWindow</class> <name>scrolledwindow1</name> <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> <widget> <class>GtkText</class> <name>history</name> <editable>False</editable> <text></text> </widget> </widget> <widget> <class>GnomeEntry</class> <name>entry1</name> <max_saved>10</max_saved> <child> <padding>0</padding> <expand>False</expand> <fill>False</fill> </child> <widget> <class>GtkEntry</class> <child_name>GnomeEntry:entry</child_name> <name>input</name> <can_focus>True</can_focus> <signal> <name>activate</name> <handler>on_input_activate</handler> <after>True</after> <last_modification_time>Sun, 27 Jan 2002 01:56:43 GMT</last_modification_time> </signal> <editable>True</editable> <text_visible>True</text_visible> <text_max_length>0</text_max_length> <text></text> </widget> </widget> </widget> </widget> </widget> <widget> <class>GnomeAppBar</class> <child_name>GnomeApp:appbar</child_name> <name>appbar1</name> <has_progress>True</has_progress> <has_status>True</has_status> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> </widget> <widget> <class>GnomeDialog</class> <name>connect_dialog</name> <signal> <name>clicked</name> <handler>on_connect_dialog_clicked</handler> <last_modification_time>Wed, 30 Jan 2002 00:08:37 GMT</last_modification_time> </signal> <signal> <name>close</name> <handler>on_connect_dialog_close</handler> <last_modification_time>Wed, 30 Jan 2002 00:09:42 GMT</last_modification_time> </signal> <title>Space Ninjas - Connect</title> <type>GTK_WINDOW_DIALOG</type> <position>GTK_WIN_POS_CENTER</position> <modal>True</modal> <allow_shrink>False</allow_shrink> <allow_grow>False</allow_grow> <auto_shrink>False</auto_shrink> <auto_close>True</auto_close> <hide_on_close>False</hide_on_close> <widget> <class>GtkVBox</class> <child_name>GnomeDialog:vbox</child_name> <name>dialog-vbox1</name> <homogeneous>False</homogeneous> <spacing>8</spacing> <child> <padding>4</padding> <expand>True</expand> <fill>True</fill> </child> <widget> <class>GtkHButtonBox</class> <child_name>GnomeDialog:action_area</child_name> <name>dialog-action_area1</name> <layout_style>GTK_BUTTONBOX_END</layout_style> <spacing>8</spacing> <child_min_width>85</child_min_width> <child_min_height>27</child_min_height> <child_ipad_x>7</child_ipad_x> <child_ipad_y>0</child_ipad_y> <child> <padding>0</padding> <expand>False</expand> <fill>True</fill> <pack>GTK_PACK_END</pack> </child> <widget> <class>GtkButton</class> <name>connect_okay</name> <can_default>True</can_default> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>on_connect_okay_clicked</handler> <last_modification_time>Wed, 30 Jan 2002 00:34:06 GMT</last_modification_time> </signal> <stock_button>GNOME_STOCK_BUTTON_OK</stock_button> </widget> <widget> <class>GtkButton</class> <name>button7</name> <can_default>True</can_default> <can_focus>True</can_focus> <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button> </widget> </widget> <widget> <class>GtkFrame</class> <name>frame1</name> <border_width>4</border_width> <label>Space Ninjas Server</label> <label_xalign>0</label_xalign> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> <widget> <class>GtkTable</class> <name>table1</name> <border_width>4</border_width> <rows>3</rows> <columns>2</columns> <homogeneous>False</homogeneous> <row_spacing>0</row_spacing> <column_spacing>8</column_spacing> <widget> <class>GtkLabel</class> <name>label4</name> <label>Port</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <left_attach>0</left_attach> <right_attach>1</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkLabel</class> <name>label3</name> <label>Server</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <left_attach>0</left_attach> <right_attach>1</right_attach> <top_attach>1</top_attach> <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkSpinButton</class> <name>server_port</name> <can_focus>True</can_focus> <climb_rate>1</climb_rate> <digits>0</digits> <numeric>True</numeric> <update_policy>GTK_UPDATE_ALWAYS</update_policy> <snap>False</snap> <wrap>False</wrap> <value>5555</value> <lower>0</lower> <upper>65535</upper> <step>1</step> <page>10</page> <page_size>10</page_size> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> <top_attach>2</top_attach> <bottom_attach>3</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkEntry</class> <name>server_address</name> <can_focus>True</can_focus> <editable>True</editable> <text_visible>True</text_visible> <text_max_length>0</text_max_length> <text>localhost</text> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> <top_attach>1</top_attach> <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkLabel</class> <name>label5</name> <label>Name</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <left_attach>0</left_attach> <right_attach>1</right_attach> <top_attach>0</top_attach> <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> <widget> <class>GtkEntry</class> <name>nick</name> <can_focus>True</can_focus> <editable>True</editable> <text_visible>True</text_visible> <text_max_length>0</text_max_length> <text>no one</text> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> <top_attach>0</top_attach> <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> <yfill>False</yfill> </child> </widget> </widget> </widget> </widget> </widget> </GTK-Interface> --- NEW FILE: you.png --- PNG IÄF,Å*]ß5õöö.Ù½Üùð3óÌ<ÏæyeÿEòµudÔbsùCAÿzû $§ÇQÏO±©Ø²$6D·&q-ö±n£*f1Å26DÒÚê k 3 ¤].a2®NçzBFq%*ßÀxD½².|^Ó!Ø:`>~¹`[ ei´Ï4NĪ°=HL#ëd¤÷L M·Ffn\¸æéØæ |òÅøôÀxÎx%ª )9-dú íµ¢ ;JÈ#=åÖ«®*#Qt©³§&´ÑqG Àj¦_|ÝÉøªVä÷nÀ*5KXR21üÖêýõ`Ó~áS4 ßðEûÉ~ÆÅQ<."PËxïqü9óÆ>äÆçñQ8)"ðCðëÎ8~W̬¹%<ÌÌá9î(rÁ#¡¨ìã_OcàL$¾+× WøfqÊ=F7âðVü^Å!lí®äô=ÃmúóC2ãBz]8Ýx*ÜP'£¾9ÍRÜ#¸·¸[ ¯ ýxð2ê:Ü-"! ù5Ã8Ýèö¯xç°O³<äúB¬,Ñcb[ÒùA9 Ôú7B~. n¥m÷þ'ü« «ªqs½ |
From: Lee B. <lb...@us...> - 2002-02-07 06:11:09
|
Update of /cvsroot/spaceninjas/spaceninjas/src/server In directory usw-pr-cvs1:/tmp/cvs-serv24167/server Log Message: Directory /cvsroot/spaceninjas/spaceninjas/src/server added to the repository |
From: Lee B. <lb...@us...> - 2002-02-07 06:11:09
|
Update of /cvsroot/spaceninjas/spaceninjas/src/net In directory usw-pr-cvs1:/tmp/cvs-serv24167/net Log Message: Directory /cvsroot/spaceninjas/spaceninjas/src/net added to the repository |
From: Lee B. <lb...@us...> - 2002-02-07 06:11:09
|
Update of /cvsroot/spaceninjas/spaceninjas/src/client In directory usw-pr-cvs1:/tmp/cvs-serv24167/client Log Message: Directory /cvsroot/spaceninjas/spaceninjas/src/client added to the repository |
From: Lee B. <lb...@us...> - 2002-02-07 06:06:44
|
Update of /cvsroot/spaceninjas/spaceninjas/src In directory usw-pr-cvs1:/tmp/cvs-serv23559/src Log Message: Directory /cvsroot/spaceninjas/spaceninjas/src added to the repository |
From: Lee B. <lb...@us...> - 2002-02-07 06:06:44
|
Update of /cvsroot/spaceninjas/spaceninjas/data In directory usw-pr-cvs1:/tmp/cvs-serv23559/data Log Message: Directory /cvsroot/spaceninjas/spaceninjas/data added to the repository |
From: Lee B. <lb...@us...> - 2002-02-07 06:05:41
|
Update of /cvsroot/spaceninjas/spaceninjas In directory usw-pr-cvs1:/tmp/cvs-serv23430/spaceninjas Log Message: Directory /cvsroot/spaceninjas/spaceninjas added to the repository |