home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Games / Empire-0.6-MIS / ServerController.h < prev    next >
Encoding:
Text File  |  1997-10-23  |  2.8 KB  |  97 lines

  1. //
  2. // $Id: ServerController.h,v 1.5 1997/10/23 05:17:55 nygard Exp $
  3. //
  4.  
  5. //
  6. //  This file is a part of Empire, a game of exploration and conquest.
  7. //  Copyright (C) 1996  Steve Nygard
  8. //
  9. //  This program is free software; you can redistribute it and/or modify
  10. //  it under the terms of the GNU General Public License as published by
  11. //  the Free Software Foundation; either version 2 of the License, or
  12. //  (at your option) any later version.
  13. //
  14. //  This program is distributed in the hope that it will be useful,
  15. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. //  GNU General Public License for more details.
  18. //
  19. //  You should have received a copy of the GNU General Public License
  20. //  along with this program; if not, write to the Free Software
  21. //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. //
  23. //  You may contact the author by:
  24. //     e-mail:  nygard@telusplanet.net
  25. //
  26.  
  27.  
  28. #import <AppKit/AppKit.h>
  29. #import <Foundation/NSConnection.h>
  30. #import "Empire.h"
  31. #import "EmpireProtocols.h"
  32.  
  33. @class Client;
  34.  
  35. //======================================================================
  36.  
  37. @interface ServerController : NSObject <EmpireServerConnectionProtocol>
  38. {
  39.     IBOutlet NSWindow *serverWindow;
  40.     IBOutlet NSTextField *statusTextfield;
  41.  
  42.     NSMutableArray *clientList;
  43.     id serverConnection;
  44.  
  45.     NSMutableArray *observers;
  46.     IBOutlet NSTextView *messageText;
  47.  
  48.     IBOutlet NSTableView *clientTable;
  49. }
  50.  
  51. + (void) initialize;
  52.  
  53. - (void) awakeFromNib;
  54.  
  55. - init;
  56. - (void) dealloc;
  57.  
  58. - (void) showPanel;
  59.  
  60. - (void) establishServer:sender;
  61. - (void) stopServer:sender;
  62.  
  63. - (void) doubleAction:sender;
  64.  
  65. - (void) showText:(NSString *)format, ...;
  66.  
  67. - (void) connectionDidDie:(NSNotification *)notification;
  68.  
  69. - (BOOL) connection:(NSConnection *)parentConnection shouldMakeNewConnection:(NSConnection *)newConnection;
  70. - (Client *) clientAtIndex:(int)index;
  71.  
  72. //======================================================================
  73. // EmpireServerConnectionProtocol
  74. //======================================================================
  75.  
  76. - (void) ping;
  77. - (void) client:clientController onHost:(NSString *)hostname;
  78. - (void) aboutToDisconnect:sender;
  79.  
  80. //======================================================================
  81. // NSTableDataSource
  82. //======================================================================
  83.  
  84. - (int) numberOfRowsInTableView:(NSTableView *)aTableView;
  85. - tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
  86.  
  87. //======================================================================
  88. // ObserverPattern
  89. //======================================================================
  90.  
  91. - (void) attach:observer;
  92. - (void) detach:observer;
  93. - (void) newClientHost:(NSString *)hostname;
  94. - (void) removedClientHostNumber:(int)index;
  95.  
  96. @end
  97.