File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
CrazyCar/Assets/Scripts/System Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 7
7
using LitJson ;
8
8
9
9
public interface IKCPSystem : ISystem {
10
- void ConnectKCP ( string url ) ;
10
+ void Connect ( string url ) ;
11
11
void SendMsgToServer ( string msg ) ;
12
12
void CloseConnect ( ) ;
13
13
@@ -31,7 +31,7 @@ public void CloseConnect() {
31
31
kcpManager . Close ( ) ;
32
32
}
33
33
34
- public void ConnectKCP ( string url ) {
34
+ public void Connect ( string url ) {
35
35
host = url ;
36
36
kcpManager . ConnectKCP ( host , port ) ;
37
37
}
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public void Connect(string url) {
98
98
if ( netType == NetType . WebSocket ) {
99
99
this . GetSystem < IWebSocketSystem > ( ) . Connect ( url ) ;
100
100
} else if ( netType == NetType . KCP ) {
101
- this . GetSystem < IKCPSystem > ( ) . ConnectKCP ( url ) ;
101
+ this . GetSystem < IKCPSystem > ( ) . Connect ( url ) ;
102
102
}
103
103
}
104
104
@@ -136,12 +136,6 @@ public void SendMsgToServer(string msg) {
136
136
137
137
public void RespondAction ( JsonData recJD ) {
138
138
MsgType msgType = ( MsgType ) ( int ) recJD [ "msg_type" ] ;
139
- if ( msgType == MsgType . CreatePlayer || msgType == MsgType . PlayerState ||
140
- msgType == MsgType . PlayerOperat || msgType == MsgType . PlayerCompleteGame ) {
141
- if ( ( int ) recJD [ "uid" ] == this . GetModel < IUserModel > ( ) . Uid ) {
142
- return ;
143
- }
144
- }
145
139
146
140
if ( msgType == MsgType . CreatePlayer ) {
147
141
playerCreateMsg = this . GetSystem < IDataParseSystem > ( ) . ParsePlayerCreateMsg ( recJD ) ;
You can’t perform that action at this time.
0 commit comments