Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zsirozas
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sillinger Péter
Zsirozas
Commits
2e3154c9
Commit
2e3154c9
authored
May 9, 2020
by
Sillinger Péter
Browse files
Options
Downloads
Patches
Plain Diff
Room infos should display without crash.
parent
1ba7bdaa
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
zsirozas/Form1.Designer.cs
+2
-0
2 additions, 0 deletions
zsirozas/Form1.Designer.cs
zsirozas/Form1.cs
+9
-7
9 additions, 7 deletions
zsirozas/Form1.cs
zsirozas/Program.cs
+2
-4
2 additions, 4 deletions
zsirozas/Program.cs
zsirozas/SignalR-Transport.cs
+3
-3
3 additions, 3 deletions
zsirozas/SignalR-Transport.cs
with
16 additions
and
14 deletions
zsirozas/Form1.Designer.cs
+
2
−
0
View file @
2e3154c9
...
@@ -435,6 +435,7 @@ namespace zsirozas
...
@@ -435,6 +435,7 @@ namespace zsirozas
this
.
listBoxUsers
.
Name
=
"listBoxUsers"
;
this
.
listBoxUsers
.
Name
=
"listBoxUsers"
;
this
.
listBoxUsers
.
Size
=
new
System
.
Drawing
.
Size
(
94
,
329
);
this
.
listBoxUsers
.
Size
=
new
System
.
Drawing
.
Size
(
94
,
329
);
this
.
listBoxUsers
.
TabIndex
=
3
;
this
.
listBoxUsers
.
TabIndex
=
3
;
this
.
listBoxUsers
.
MouseDoubleClick
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
listBoxUsers_MouseDoubleClick
);
//
//
// listBoxRooms
// listBoxRooms
//
//
...
@@ -445,6 +446,7 @@ namespace zsirozas
...
@@ -445,6 +446,7 @@ namespace zsirozas
this
.
listBoxRooms
.
Name
=
"listBoxRooms"
;
this
.
listBoxRooms
.
Name
=
"listBoxRooms"
;
this
.
listBoxRooms
.
Size
=
new
System
.
Drawing
.
Size
(
101
,
329
);
this
.
listBoxRooms
.
Size
=
new
System
.
Drawing
.
Size
(
101
,
329
);
this
.
listBoxRooms
.
TabIndex
=
2
;
this
.
listBoxRooms
.
TabIndex
=
2
;
this
.
listBoxRooms
.
MouseDoubleClick
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
listBoxRooms_MouseDoubleClick
);
//
//
// label6
// label6
//
//
...
...
This diff is collapsed.
Click to expand it.
zsirozas/Form1.cs
+
9
−
7
View file @
2e3154c9
...
@@ -202,9 +202,9 @@ namespace zsirozas
...
@@ -202,9 +202,9 @@ namespace zsirozas
void
RefreshServerInfo
()
void
RefreshServerInfo
()
{
{
if
(
client
.
remoteServer
.
ServerInfo
().
bigRoom
)
if
(
client
.
remoteServer
.
ServerInfo
().
bigRoom
&&
false
)
{
{
throw
new
NotImplementedException
();
throw
new
NotImplementedException
();
// todo kitalálni mit akartam ide
}
}
else
else
{
{
...
@@ -213,7 +213,7 @@ namespace zsirozas
...
@@ -213,7 +213,7 @@ namespace zsirozas
foreach
(
var
roomID
in
rooms
)
foreach
(
var
roomID
in
rooms
)
{
{
listBoxRooms
.
Items
.
Add
(
roomID
);
listBoxRooms
.
Items
.
Add
(
roomID
);
//
roomInfos.Add(roomID, client.remoteServer.RoomInfo(roomID));
roomInfos
.
Add
(
roomID
,
client
.
remoteServer
.
RoomInfo
(
roomID
));
}
}
var
users
=
client
.
remoteServer
.
ListUsers
();
var
users
=
client
.
remoteServer
.
ListUsers
();
var
userInfos
=
new
Dictionary
<
string
,
UserInfo
>();
var
userInfos
=
new
Dictionary
<
string
,
UserInfo
>();
...
@@ -222,8 +222,10 @@ namespace zsirozas
...
@@ -222,8 +222,10 @@ namespace zsirozas
listBoxUsers
.
Items
.
Add
(
userID
);
listBoxUsers
.
Items
.
Add
(
userID
);
userInfos
.
Add
(
userID
,
client
.
remoteServer
.
UserInfo
(
userID
));
userInfos
.
Add
(
userID
,
client
.
remoteServer
.
UserInfo
(
userID
));
}
}
lock
(
listBoxUsers
.
Tag
)
lock
(
listBoxOwnRoom
.
Tag
)
listBoxUsers
.
Tag
=
listBoxOwnRoom
.
Tag
=
userInfos
;
//lock (listBoxUsers.Tag) lock (listBoxOwnRoom.Tag) //todo thread-safety?
lock
(
listBoxRooms
.
Tag
)
listBoxRooms
.
Tag
=
roomInfos
;
listBoxUsers
.
Tag
=
listBoxOwnRoom
.
Tag
=
userInfos
;
//lock (listBoxRooms.Tag)
listBoxRooms
.
Tag
=
roomInfos
;
//TODO: folytatni...
//TODO: folytatni...
}
}
}
}
...
@@ -329,7 +331,7 @@ namespace zsirozas
...
@@ -329,7 +331,7 @@ namespace zsirozas
{
{
try
try
{
{
client
.
remoteServer
.
RemoveUser
(
client
.
userID
);
//
client.remoteServer.RemoveUser(client.userID);
//todo visszarakni amint nem fedi el a többi hibát
}
}
catch
(
Exception
)
catch
(
Exception
)
{
{
...
@@ -458,7 +460,7 @@ namespace zsirozas
...
@@ -458,7 +460,7 @@ namespace zsirozas
private
void
buttonRefreshServer_Click
(
object
sender
,
EventArgs
e
)
private
void
buttonRefreshServer_Click
(
object
sender
,
EventArgs
e
)
{
{
RefreshServerInfo
();
}
}
private
void
buttonCreateRoom_Click
(
object
sender
,
EventArgs
e
)
private
void
buttonCreateRoom_Click
(
object
sender
,
EventArgs
e
)
...
...
This diff is collapsed.
Click to expand it.
zsirozas/Program.cs
+
2
−
4
View file @
2e3154c9
...
@@ -11,10 +11,8 @@ namespace zsirozas
...
@@ -11,10 +11,8 @@ namespace zsirozas
{
{
if
(
args
.
Contains
(
"--server"
))
if
(
args
.
Contains
(
"--server"
))
{
{
//TODO: bigroom-ot feltételessé
var
srv
=
new
GameServer
(
args
.
Contains
(
"--bigroom"
),
args
.
Contains
(
"--oneshot"
));
//TODO: autostop-ot feltételessé
new
ServerWrapper
(
srv
).
Run
(
args
.
Contains
(
"--signalr"
),
!
args
.
Contains
(
"--notcp"
));
var
srv
=
new
GameServer
(
true
||
args
.
Contains
(
"--bigroom"
),
args
.
Contains
(
"--oneshot"
)
||
true
);
new
ServerWrapper
(
srv
).
Run
(
args
.
Contains
(
"--signalr"
),
true
);
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
zsirozas/SignalR-Transport.cs
+
3
−
3
View file @
2e3154c9
...
@@ -109,7 +109,7 @@ namespace zsirozas
...
@@ -109,7 +109,7 @@ namespace zsirozas
public
void
RegisterWrapper
(
ServerWrapper
_wrapper
)
public
void
RegisterWrapper
(
ServerWrapper
_wrapper
)
{
{
return
;
return
;
//only actual game servers should have wrappers
}
}
public
string
[]
ListRooms
()
public
string
[]
ListRooms
()
...
@@ -174,7 +174,7 @@ namespace zsirozas
...
@@ -174,7 +174,7 @@ namespace zsirozas
public
void
ParseNextMessage
(
Stream
s
,
object
param
)
public
void
ParseNextMessage
(
Stream
s
,
object
param
)
{
{
throw
new
Not
Implemen
tedException
();
throw
new
Not
Suppor
tedException
(
"This is just a proxy to a real game server, you shouldn't want to feed it message streams."
);
}
}
public
object
GameAction
(
string
gameID
,
string
userID
,
PlayerAction
action
,
int
cardID
)
public
object
GameAction
(
string
gameID
,
string
userID
,
PlayerAction
action
,
int
cardID
)
...
@@ -215,7 +215,7 @@ namespace zsirozas
...
@@ -215,7 +215,7 @@ namespace zsirozas
/// </summary>
/// </summary>
public
WrappedException
WrapException
(
Exception
ex
)
public
WrappedException
WrapException
(
Exception
ex
)
{
{
return
new
Microsoft
.
AspNet
.
SignalR
.
Hub
Exception
(
ex
.
Message
);
return
new
Wrapped
Exception
(
ex
.
Message
);
}
}
public
string
CreateUser
(
string
name
,
ConnectionType
type
,
object
backTalk
)
public
string
CreateUser
(
string
name
,
ConnectionType
type
,
object
backTalk
)
...
...
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