Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ovcc
Open Virtual Carcassonne Clone
Commits
12390c2c
Commit
12390c2c
authored
May 18, 2019
by
Jonathan Michalon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Few enhancements reading infos from valac
parent
97212e02
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
53 deletions
+9
-53
libovcc/src/network/ovcc-network-message.vala
libovcc/src/network/ovcc-network-message.vala
+2
-46
libovcc/src/ovcc-game.vala
libovcc/src/ovcc-game.vala
+1
-0
libovcc/src/ovcc-player.vala
libovcc/src/ovcc-player.vala
+2
-2
libovcc/src/ovcc-sig-queue.vala
libovcc/src/ovcc-sig-queue.vala
+0
-1
libovccclient/src/ovccclient-server.vala
libovccclient/src/ovccclient-server.vala
+2
-2
server/src/server.vala
server/src/server.vala
+2
-2
No files found.
libovcc/src/network/ovcc-network-message.vala
View file @
12390c2c
...
...
@@ -95,27 +95,6 @@ namespace OVCC.Network
return
message
;
}
public
static
async
Message
receive_async
(
DataInputStream
stream
,
Cancellable
?
cancel
=
null
)
throws
Error
{
Message
result
=
null
;
Error
?
err
=
null
;
Thread
.
create
<
void
>
(()
=>
{
try
{
result
=
Message
.
receive
(
stream
,
cancel
);
}
catch
(
Error
e
)
{
err
=
e
;
}
Idle
.
add
(
receive_async
.
callback
);
},
false
);
yield
;
if
(
err
!=
null
)
{
throw
err
;
}
return
result
;
}
public
bool
send
(
DataOutputStream
stream
,
Cancellable
?
cancel
=
null
)
throws
Error
...
...
@@ -125,27 +104,6 @@ namespace OVCC.Network
return
true
;
}
public
async
bool
send_async
(
DataOutputStream
stream
,
Cancellable
?
cancel
=
null
)
throws
Error
{
bool
result
=
true
;
Error
?
err
=
null
;
Thread
.
create
<
void
>
(()
=>
{
try
{
result
=
this
.
send
(
stream
,
cancel
);
}
catch
(
Error
e
)
{
err
=
e
;
}
Idle
.
add
(
send_async
.
callback
);
},
false
);
yield
;
if
(
err
!=
null
)
{
throw
err
;
}
return
result
;
}
protected
uint8
[]
read_buffer
(
DataInputStream
stream
,
Cancellable
?
cancel
=
null
)
throws
Error
...
...
@@ -156,13 +114,11 @@ namespace OVCC.Network
len
);
}
if
(
len
>
0
)
{
var
buf
=
new
uint8
[
len
];
if
(
len
>
0
)
{
stream
.
read
(
buf
,
cancel
);
return
buf
;
}
else
{
return
null
;
}
return
buf
;
}
protected
bool
write_buffer
(
DataOutputStream
stream
,
...
...
libovcc/src/ovcc-game.vala
View file @
12390c2c
...
...
@@ -73,6 +73,7 @@ namespace OVCC
* A class providing the description of a Game.
* This is a stripped-down group of data typically to descibe a Game over network.
*/
[
Compact
]
public
class
GameDescription
:
Object
{
public
string
name
{
get
;
construct
;
}
...
...
libovcc/src/ovcc-player.vala
View file @
12390c2c
...
...
@@ -19,8 +19,8 @@
*/
static
const
int
N_NORMAL
=
7
;
static
const
int
N_DOUBLE
=
1
;
const
int
N_NORMAL
=
7
;
const
int
N_DOUBLE
=
1
;
namespace
OVCC
...
...
libovcc/src/ovcc-sig-queue.vala
View file @
12390c2c
...
...
@@ -18,7 +18,6 @@
*
*/
[compact]
public
class
OVCC
.
SigQueue
{
private
struct
Entry
{
...
...
libovccclient/src/ovccclient-server.vala
View file @
12390c2c
...
...
@@ -318,9 +318,9 @@ namespace OVCCClient
output
=
new
DataOutputStream
(
connection
.
output_stream
);
listen_loop_cancel
=
new
Cancellable
();
send_loop_cancel
=
new
Cancellable
();
listen_loop_thread
=
Thread
.
create
<
bool
>
(
listen
_
loop
,
true
);
listen_loop_thread
=
new
Thread
<
bool
>
.
try
(
"
listen
loop
"
,
listen_loop
);
send_loop_running
=
1
;
send_loop_thread
=
Thread
.
create
<
bool
>
(
send
_
loop
,
true
);
send_loop_thread
=
new
Thread
<
bool
>
.
try
(
"
send
loop
"
,
send_loop
);
}
catch
(
IOError
.
CANCELLED
c
)
{
throw
c
;
}
catch
(
Error
e
)
{
...
...
server/src/server.vala
View file @
12390c2c
...
...
@@ -21,8 +21,8 @@
using
OVCC
;
using
OVCC.Network
;
static
const
string
TILES_FILE
=
"tiles.xml"
;
static
const
string
TILESET_FILE
=
"tileset.xml"
;
const
string
TILES_FILE
=
"tiles.xml"
;
const
string
TILESET_FILE
=
"tileset.xml"
;
/* TODO: add a Source to be notified of incoming messages asynchronously */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment