This commit is contained in:
2015-08-13 17:18:21 +03:00
parent f2cbdbf341
commit 39ab8d30e6
10 changed files with 117 additions and 64 deletions

View File

@@ -1,5 +1,7 @@
package ru.m.tankz;
import ru.m.tankz.proto.LeaveGameRequest;
import ru.m.tankz.proto.LeaveGameResponse;
import ru.m.tankz.proto.GameUpdateResponse;
import ru.m.tankz.proto.GameActionRequest;
import ru.m.core.connect.IConnection;
@@ -9,7 +11,8 @@ import ru.m.tankz.proto.LoginResponse;
import ru.m.tankz.proto.PersonSelectRequest;
import ru.m.tankz.proto.PersonSelectResponse;
import ru.m.tankz.proto.ErrorResponse;
import ru.m.tankz.proto.GamesRequest;
import ru.m.tankz.proto.GamesSubscribeRequest;
import ru.m.tankz.proto.GamesUnSubscribeRequest;
import ru.m.tankz.proto.GamesResponse;
import ru.m.tankz.proto.CreateGameRequest;
import ru.m.tankz.proto.CreateGameResponse;
@@ -17,8 +20,6 @@ import ru.m.tankz.proto.JoinGameRequest;
import ru.m.tankz.proto.JoinGameResponse;
import ru.m.tankz.proto.StartGameRequest;
import ru.m.tankz.proto.StartGameResponse;
import ru.m.tankz.proto.ExitGameRequest;
import ru.m.tankz.proto.ExitGameResponse;
class PacketBuilder implements IPacketBuilder {
@@ -33,7 +34,7 @@ class PacketBuilder implements IPacketBuilder {
0x0004 => PersonSelectResponse
],
0x02 => [
0x0001 => GamesRequest,
0x0001 => GamesSubscribeRequest,
0x0002 => GamesResponse,
0x0003 => CreateGameRequest,
0x0004 => CreateGameResponse,
@@ -41,8 +42,9 @@ class PacketBuilder implements IPacketBuilder {
0x0006 => JoinGameResponse,
0x0007 => StartGameRequest,
0x0008 => StartGameResponse,
0x0009 => ExitGameRequest,
0x000a => ExitGameResponse
0x0009 => LeaveGameRequest,
0x000a => LeaveGameResponse,
0x000b => GamesUnSubscribeRequest
],
0x03 => [
0x0001 => GameActionRequest,

View File

@@ -11,7 +11,7 @@ class Tank extends MobileEntity {
public var bulletsCount:Int = 0;
public function new(personId:Int, id:Int, x:Float, y:Float, direction:Directiondo apt-g) {
public function new(personId:Int, id:Int, x:Float, y:Float, direction:Direction) {
super(id, x, y, 4, direction);
this.personId = personId;
width = 34;

View File

@@ -47,7 +47,11 @@ message Game {
required GameState state = 4;
}
message GamesRequest {
message GamesSubscribeRequest {
}
message GamesUnSubscribeRequest {
}
@@ -72,7 +76,7 @@ message JoinGameResponse {
}
message LeaveGameRequest {
required int32 game_id = 1;
}
message LeaveGameResponse {
@@ -87,14 +91,6 @@ message StartGameResponse {
required Game game = 1;
}
message ExitGameRequest {
}
message ExitGameResponse {
}
/**
Game
*/