49 |
@implementation NetGameList |
@implementation NetGameList |
50 |
|
|
51 |
/** |
/** |
52 |
* Initialise NetGameList with the existing games. These games are researched |
* Initialize NetGameList. |
|
* on the local network. |
|
53 |
*/ |
*/ |
54 |
- (id) init |
- (id) init |
55 |
{ |
{ |
58 |
if (self != nil) |
if (self != nil) |
59 |
{ |
{ |
60 |
_gameList = AUTORELEASE ([NSMutableArray array]); |
_gameList = AUTORELEASE ([NSMutableArray array]); |
|
[self searchGames]; |
|
61 |
} |
} |
62 |
|
|
63 |
return self; |
return self; |
115 |
{ |
{ |
116 |
NSArray *partyList = [[server partyList] allValues]; |
NSArray *partyList = [[server partyList] allValues]; |
117 |
unsigned int i; |
unsigned int i; |
118 |
for (i = 1; i <= [partyList count]; i++) |
for (i = 0; i < [partyList count]; i++) |
119 |
[self _addGameIDWithParty: [partyList objectAtIndex: i] |
[self _addGameIDWithParty: [partyList objectAtIndex: i] |
120 |
withHost: [[[NetConnection currentConnection] |
withHost: [[[NetConnection currentConnection] |
121 |
sendPort] host]]; |
sendPort] host]]; |
145 |
initGame: game]; |
initGame: game]; |
146 |
if (sendPort != nil) |
if (sendPort != nil) |
147 |
{ |
{ |
|
// NetInfosClient *inf = [[gameID party] clientWithName: playerName]; |
|
|
// HgPlayerState *playerState; |
|
|
// playerState = [inf playerState]; |
|
|
|
|
148 |
NetConnection *cnx = [NetConnection |
NetConnection *cnx = [NetConnection |
149 |
connectionWithReceivePort: receivePort |
connectionWithReceivePort: receivePort |
150 |
sendPort: sendPort]; |
sendPort: sendPort]; |
155 |
initWithProxy: serverInfosClient |
initWithProxy: serverInfosClient |
156 |
withGame: game]); |
withGame: game]); |
157 |
[cnx setRootObject: client]; |
[cnx setRootObject: client]; |
158 |
|
|
159 |
|
[serverInfosClient createProxy]; |
160 |
|
[serverInfosClient delegateClient]; |
161 |
return client; |
return client; |
162 |
} |
} |
163 |
else |
else |