public void TransitToRoom(RoomTransitionWaypointData roomData) { Debug.Log("Transiting to room: " + roomData.roomToTransitTo.ToString()); currentRoom = roomData.roomToTransitTo; mainCamara.transform.position = roomData.newCamaraPosistion; player.transform.position = roomData.newPlayerPosistion; }
public void CreateGameRoom(User player, GameRoom gameRoom) { if (player == null || gameRoom == null) { return; } GameRooms.Add(gameRoom.Id, gameRoom); player.GameRoomRef = gameRoom; }
public void RemoveGameRoom(User leader, GameRoom gameRoom) { if (leader == null || gameRoom == null) { return; } if (gameRoom.Leader.Id == leader.Id) { gameRoom.ClearPlayers(leader.Id); GameRooms.Remove(gameRoom.Id); } }
public GameRoom LookupGameRoom(User user, string gameRoomId, out string errMsg) { errMsg = string.Empty; if (user == null) { return(null); } if (!GameRooms.ContainsKey(gameRoomId ?? "")) { errMsg = string.Format(Constants.Instance.ErrorMessage.Cant_Find_Game_Room, gameRoomId); return(null); } return(GameRooms[gameRoomId]); }
public List <GameRoom> GetGameRooms() { return(GameRooms.Select(x => x.Value).ToArray().ToList()); }
public int CreateRoom(int teamCount, string gameRoomName, int theGameRoomsHostClientID) { GameRooms.Add(GenerateManageeID(), new GameRoom(teamCount, gameRoomName)); return(IDSeed); }
public static string GetSaveFilePath(GameRooms game_room, GameplaySpeeds gameplay_speed) => game_room + "_" + gameplay_speed + ".txt";
public ButtonLevel(int x, int y, GameRooms game_room) : base(x, y, 150, 84) { this.ShouldDrawBorder = false; this.GameRoom = game_room; this.IsUnlocked = this.DetermineIsUnlocked(); }
public int GetRoomsQty() { return(GameRooms.Count()); }
public GameRoom TryToLookupRoom(string gameRoomId) { return(GameRooms.ContainsKey(gameRoomId ?? "") ? GameRooms[gameRoomId] : null); }
private bool WaitForStartingInfo(NetClient client, out string msg) { var time = DateTime.Now; NetIncomingMessage inc; while (true) { if (DateTime.Now.Subtract(time).Seconds > 10) { msg = "Couldn't find server"; return(false); } if ((inc = client.ReadMessage()) == null) { continue; } switch (inc.MessageType) { case NetIncomingMessageType.Data: if (inc.ReadByte() == (byte)PacketTypes.StartState) { var count1 = inc.ReadInt32(); GameRooms.Clear(); for (int i = 0; i < count1; i++) { var tempRoom = new GameRoom(); tempRoom.Name = inc.ReadString(); GameRooms.Add(tempRoom); } msg = "Successfully connected to lobby"; return(true); } break; case NetIncomingMessageType.StatusChanged: switch ((NetConnectionStatus)inc.ReadByte()) { //When connected to the server case NetConnectionStatus.Connected: break; //When disconnected from the server case NetConnectionStatus.Disconnected: { string reason = inc.ReadString(); if (string.IsNullOrEmpty(reason)) { msg = "Connection denied"; return(false); } msg = "Connection denied, reason: " + reason; return(false); } break; } break; } } }