public void ResetRoomInfo(int gen2) { for (int id = 0; id < 200; ++id) { this._objects[id] = new ObjectInfo(id); } this._mapId = RoomsManager.getGenV(gen2, 1); this.stageType = RoomsManager.getGenV(gen2, 2); this._sourceToMap = -1; this.Map = (MapModel)null; this.LastRound = 0; this._dropCounter = 0; this._isBotMode = false; this._hasC4 = false; this._serverRound = 0; this._objsSyncRound = 0; this.LastObjsSync = new DateTime(); this.LastPlayersSync = new DateTime(); this.BombPosition = new Half3(); if (!Config.isTestMode) { return; } Logger.warning("A room has been reseted by server.", false); }
public bool RoundResetRoomF1(int round) { lock (this._lock) { if (this.LastRound != round) { if (Config.isTestMode) { Logger.warning("Reseting room. [Last: " + (object)this.LastRound + "; New: " + (object)round + "]", false); } DateTime now = DateTime.Now; this.LastRound = round; this._hasC4 = false; this.BombPosition = new Half3(); this._dropCounter = 0; this._objsSyncRound = 0; this._sourceToMap = this._mapId; if (!this._isBotMode) { for (int index = 0; index < 16; ++index) { Player player = this._players[index]; player._life = player._maxLife; } this.LastPlayersSync = now; this.Map = MappingXML.getMapById(this._mapId); List <ObjModel> objModelList = this.Map != null ? this.Map._objects : (List <ObjModel>)null; if (objModelList != null) { for (int index = 0; index < objModelList.Count; ++index) { ObjModel objModel = objModelList[index]; ObjectInfo objectInfo = this._objects[objModel._id]; objectInfo._life = objModel._life; if (!objModel._noInstaSync) { objModel.SetRandomAnimToObj(this, objectInfo); } else { objectInfo._anim = new AnimModel() { _nextAnim = 1 }; objectInfo.lastInteractionTime = now; } objectInfo._model = objModel; objectInfo.DestroyState = 0; MappingXML.SetObjectives(objModel, this); } } this.LastObjsSync = now; this._objsSyncRound = round; } return(true); } } return(false); }
/// <summary> /// Reseta as informações da sala, caso a rodada seja válida. /// </summary> /// <param name="round">Rodada</param> /// <returns></returns> public bool RoundResetRoomF1(int round) { lock (_lock) { if (LastRound != round) { if (Config.isTestMode) { Printf.warning("Reseting room. [Last: " + LastRound + "; New: " + round + "]"); } DateTime now = DateTime.Now; LastRound = round; _hasC4 = false; BombPosition = new Half3(); _dropCounter = 0; _objsSyncRound = 0; _sourceToMap = _mapId; if (!_isBotMode) { for (int i = 0; i < 16; i++) { Player player = _players[i]; player._life = player._maxLife; } LastPlayersSync = now; Map = MappingXML.getMapById(_mapId); List <ObjModel> objsm = Map != null ? Map._objects : null; if (objsm != null) { for (int i = 0; i < objsm.Count; i++) { ObjModel ob = objsm[i]; ObjectInfo obj = _objects[ob._id]; obj._life = ob._life; if (!ob._noInstaSync) { ob.GetARandomAnim(this, obj); } else { obj._anim = new AnimModel { _nextAnim = 1 }; obj._useDate = now; } obj._model = ob; obj.DestroyState = 0; MappingXML.SetObjectives(ob, this); } } LastObjsSync = now; _objsSyncRound = round; } return(true); } } return(false); }
public bool RoundResetRoomS1(int round) { lock (this._lock) { if (this.LastRound != round) { if (Config.isTestMode) { Logger.warning("Reseting room. [Last: " + (object)this.LastRound + "; New: " + (object)round + "]", false); } this.LastRound = round; this._hasC4 = false; this._dropCounter = 0; this.BombPosition = new Half3(); if (!this._isBotMode) { for (int index = 0; index < 16; ++index) { Player player = this._players[index]; player._life = player._maxLife; } DateTime now = DateTime.Now; this.LastPlayersSync = now; for (int index = 0; index < this._objects.Length; ++index) { ObjectInfo objectInfo = this._objects[index]; ObjModel model = objectInfo._model; if (model != null) { objectInfo._life = model._life; if (!model._noInstaSync) { model.SetRandomAnimToObj(this, objectInfo); } else { objectInfo._anim = new AnimModel() { _nextAnim = 1 }; objectInfo.lastInteractionTime = now; } objectInfo.DestroyState = 0; } } this.LastObjsSync = now; this._objsSyncRound = round; if (this.stageType == 3 || this.stageType == 5) { this._bar1 = this._default1; this._bar2 = this._default2; } } return(true); } } return(false); }
/// <summary> /// Reseta as informações da sala, caso a rodada seja válida. /// </summary> /// <param name="round">Rodada</param> /// <returns></returns> public bool RoundResetRoomS1(int round) { lock (_lock) { if (LastRound != round) { if (Config.isTestMode) { Printf.warning("Reseting room. [Last: " + LastRound + "; New: " + round + "]"); } LastRound = round; _hasC4 = false; _dropCounter = 0; BombPosition = new Half3(); if (!_isBotMode) { for (int i = 0; i < 16; i++) { Player player = _players[i]; player._life = player._maxLife; } DateTime now = DateTime.Now; LastPlayersSync = now; for (int i = 0; i < _objects.Length; i++) { ObjectInfo obj = _objects[i]; ObjModel ob = obj._model; if (ob != null) { obj._life = ob._life; if (!ob._noInstaSync) { ob.GetARandomAnim(this, obj); } else { obj._anim = new AnimModel { _nextAnim = 1 }; obj._useDate = now; } obj.DestroyState = 0; } } LastObjsSync = now; _objsSyncRound = round; if ((stageType == 3 || stageType == 5)) { _bar1 = _default1; _bar2 = _default2; } } return(true); } } return(false); }
private static void CreatePreview(Half3 data, StringBuilder sb) { sb.Append("["); sb.Append(data.x); sb.Append(", "); sb.Append(data.y); sb.Append(", "); sb.Append(data.z); sb.Append("]"); }
public void Serialize(ref Half3 value) { // Write optimized version without using Serialize methods if (Mode == SerializerMode.Write) { Writer.Write(value.X.RawValue); Writer.Write(value.Y.RawValue); Writer.Write(value.Z.RawValue); } else { value.X.RawValue = Reader.ReadUInt16(); value.Y.RawValue = Reader.ReadUInt16(); value.Z.RawValue = Reader.ReadUInt16(); } }
public void ResetBattleInfos() { this._respawnByServer = -1; this._respawnByUser = -2; this._respawnByLogic = 0; this.Immortal = false; this.isDead = true; this._neverRespawn = true; this.WeaponClass = ClassType.Unknown; this.WeaponSlot = 0; this.LastPing = new DateTime(); this.LastDie = new DateTime(); this._C4First = new DateTime(); this._C4FTime = 0.0f; this.Position = new Half3(); this._life = 100; this._maxLife = 100; this._plantDuration = Config.plantDuration; this._defuseDuration = Config.defuseDuration; }
public void ResetBattleInfos() { _respawnByServer = -1; _respawnByUser = -2; _respawnByLogic = 0; Immortal = false; isDead = true; _neverRespawn = true; WeaponClass = ClassType.Unknown; WeaponSlot = 0; LastPing = new DateTime(); LastDie = new DateTime(); _C4First = new DateTime(); _C4FTime = 0; Position = new Half3(); _life = 100; _maxLife = 100; _plantDuration = Config.plantDuration; _defuseDuration = Config.defuseDuration; }
public void ResetRoomInfo(int gen2) { for (int i = 0; i < 200; ++i) { _objects[i] = new ObjectInfo(i); } _mapId = RoomsManager.getGenV(gen2, 1); stageType = RoomsManager.getGenV(gen2, 2); _sourceToMap = -1; Map = null; LastRound = 0; _dropCounter = 0; _isBotMode = false; _hasC4 = false; _serverRound = 0; _objsSyncRound = 0; LastObjsSync = new DateTime(); LastPlayersSync = new DateTime(); BombPosition = new Half3(); if (Config.isTestMode) { Printf.warning("A room has been reseted by server."); } }
public void LogPlayerPos(Half3 EndBullet) { Logger.warning("[Player position] X: " + (object)this.Position.X + "; Y: " + (object)this.Position.Y + "; Z: " + (object)this.Position.Z, false); Logger.warning("[End Bullet position] X: " + (object)EndBullet.X + "; Y: " + (object)EndBullet.Y + "; Z: " + (object)EndBullet.Z, false); }
protected internal void writeTVector(Half3 half) { this.writeT((float)half.X); this.writeT((float)half.Y); this.writeT((float)half.Z); }
public static string ToString(Half3 value) { return(string.Format(CultureInfo.InvariantCulture, "{0}, {1}, {2}", value.X, value.Y, value.Z)); }
protected internal void writeTVector(Half3 half) { writeT(half.X); writeT(half.Y); writeT(half.Z); }
protected internal void writeHVector(Half3 half) { writeH(half.X.RawValue); writeH(half.Y.RawValue); writeH(half.Z.RawValue); }
public void LogPlayerPos(Half3 EndBullet) { SaveLog.warning("[Player position] X: " + Position.X + "; Y: " + Position.Y + "; Z: " + Position.Z); SaveLog.warning("[End Bullet position] X: " + EndBullet.X + "; Y: " + EndBullet.Y + "; Z: " + EndBullet.Z); }