Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
partiview
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stuart Levy
partiview
Commits
5745e68c
Commit
5745e68c
authored
23 years ago
by
slevy
Browse files
Options
Downloads
Patches
Plain Diff
Plugin-ize.
parent
565a7689
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nethack.cc
+14
-12
14 additions, 12 deletions
src/nethack.cc
with
14 additions
and
12 deletions
src/nethack.cc
+
14
−
12
View file @
5745e68c
#include
"nethack.h"
#ifndef USE_NETHACK
void
nethack_init
()
{
}
#else
/* do USE_NETHACK */
...
...
@@ -25,7 +23,6 @@ void nethack_init() { }
#include
"specks.h"
#include
"partiviewc.h"
#include
"partiview.H"
#include
"nethack.h"
struct
sockaddr_in
netsin
;
...
...
@@ -36,9 +33,10 @@ struct netops {
int
cmds
;
};
struct
netops
listening
=
{
1
,
1
};
struct
netops
broadcasting
=
{
0
,
0
};
static
struct
netops
listening
=
{
1
,
1
};
static
struct
netops
broadcasting
=
{
0
,
0
};
static
int
net_parse_args
(
struct
stuff
**
,
int
argc
,
char
*
argv
[],
char
*
fname
,
void
*
);
static
void
dorecv
(
int
fd
,
void
*
junk
);
static
int
setnet
(
struct
sockaddr_in
*
sinp
,
int
ttl
);
static
int
sendjump
(
float
txyz
[
3
],
float
rxyz
[
3
]
);
...
...
@@ -51,11 +49,13 @@ void rxyz2aer( float aer[3], const float rxyz[3] );
static
int
netupdates
;
void
nethack_init
()
{
extern
"C"
{
void
nethack_init
()
{
parti_add_commands
(
net_parse_args
,
"net"
,
NULL
);
}
}
int
net_parse_args
(
struct
stuff
**
,
int
argc
,
char
*
argv
[],
void
*
)
{
int
net_parse_args
(
struct
stuff
**
,
int
argc
,
char
*
argv
[],
char
*
fname
,
void
*
)
{
int
i
;
struct
sockaddr_in
sin
;
...
...
@@ -91,7 +91,7 @@ int net_parse_args( struct stuff **, int argc, char *argv[], void * ) {
memcpy
(
&
sin
.
sin_addr
,
hp
->
h_addr_list
[
0
],
sizeof
(
sin
.
sin_addr
));
sin
.
sin_family
=
hp
->
h_addrtype
;
}
else
{
msg
(
"net addrs: %s: unknown host
\n
"
,
argv
[
2
]);
msg
(
"
%s:
net addrs: %s: unknown host
\n
"
,
fname
,
argv
[
2
]);
break
;
}
setnet
(
&
sin
,
ttl
);
...
...
@@ -205,9 +205,6 @@ static void cmdtrace( struct stuff **, int argc, char *argv[] ) {
static
int
setnet
(
struct
sockaddr_in
*
sinp
,
int
ttl
)
{
int
multi
=
IN_CLASSD
(
ntohl
(
sinp
->
sin_addr
.
s_addr
)
);
struct
sockaddr_in
osin
;
int
i
;
struct
hostent
*
hp
;
static
int
on
=
1
;
if
(
netfd
>=
0
)
{
...
...
@@ -287,6 +284,7 @@ static int setnet(struct sockaddr_in *sinp, int ttl) {
Fl
::
add_fd
(
netfd
,
dorecv
,
NULL
);
netupdate
();
return
1
;
}
#define PV_MAGIC 0x19570118
...
...
@@ -388,9 +386,13 @@ static void receivecmd( int *buf, int len, struct sockaddr_in *srcsin ) {
parti_redraw
();
}
#ifndef __BITS_SOCKET_H
# define socklen_t int
#endif
static
void
dorecv
(
int
fd
,
void
*
junk
)
{
struct
sockaddr_in
sfrom
;
s
ize
_t
sfromlen
=
sizeof
(
sfrom
);
s
ocklen
_t
sfromlen
=
sizeof
(
sfrom
);
int
len
;
int
buf
[
16384
];
int
kind
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment