Skip to content

Commit

Permalink
1.4 changes sofar
Browse files Browse the repository at this point in the history
- Fix resolution manager exception
- Fix disable usless components exception (untested)
- Add round timer config settings (has issues)
- Add more warhead settings.
  • Loading branch information
Courtney May committed Feb 15, 2018
1 parent a364aa4 commit 2f788be
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 74 deletions.
44 changes: 10 additions & 34 deletions server_mod/AlphaWarheadDetonationControll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
using UnityEngine;
using UnityEngine.Networking;

// Token: 0x02000065 RID: 101
public class AlphaWarheadDetonationController : NetworkBehaviour
{
// Token: 0x060001B7 RID: 439
public void StartDetonation()
{
if (this.detonationInProgress || !this.lever.GetState())
float elapsed = Time.time - this.smCharacterClassManager.smRoundStartTime;
if (this.detonationInProgress || !this.lever.GetState() || elapsed < (float)this.smNukeActivationMinTime)
{
return;
}
Expand All @@ -18,18 +17,16 @@ public void StartDetonation()
this.smStartTime = Time.time;
}

// Token: 0x060001B8 RID: 440
public void CancelDetonation()
{
float timeSinceStart = Time.time - this.smStartTime;
if (this.detonationInProgress && this.detonationTime > 2f && timeSinceStart >= (float)this.smCooldown)
float elapsed = Time.time - this.smStartTime;
if (this.detonationInProgress && this.detonationTime > 2f && elapsed >= (float)this.smCooldown)
{
this.detonationInProgress = false;
this.NetworkdetonationTime = 0f;
}
}

// Token: 0x060001B9 RID: 441
private void FixedUpdate()
{
if (base.isLocalPlayer && this.awdc != null && this.lightStatus != (this.awdc.detonationTime != 0f))
Expand Down Expand Up @@ -90,14 +87,12 @@ private void FixedUpdate()
}
}

// Token: 0x060001BA RID: 442
private void Explode()
{
this.detonated = true;
this.ExplodePlayers();
}

// Token: 0x060001BB RID: 443
[ServerCallback]
private void CmdOpenDoors()
{
Expand All @@ -114,7 +109,6 @@ private void CmdOpenDoors()
}
}

// Token: 0x060001BC RID: 444
[ServerCallback]
private void ExplodePlayers()
{
Expand All @@ -129,7 +123,6 @@ private void ExplodePlayers()
}
}

// Token: 0x060001BD RID: 445
[ServerCallback]
private void CmdCloseBlastDoors()
{
Expand All @@ -144,7 +137,6 @@ private void CmdCloseBlastDoors()
}
}

// Token: 0x060001BE RID: 446
[ClientCallback]
private void TransmitData(float t)
{
Expand All @@ -155,7 +147,6 @@ private void TransmitData(float t)
this.CmdSyncData(t);
}

// Token: 0x060001BF RID: 447
[ServerCallback]
private void CmdSyncData(float t)
{
Expand All @@ -166,18 +157,18 @@ private void CmdSyncData(float t)
this.NetworkdetonationTime = t;
}

// Token: 0x060001C0 RID: 448
private void Start()
{
this.smCharacterClassManager = base.GetComponent<CharacterClassManager>();
this.smCooldown = ConfigFile.GetInt("nuke_disable_cooldown", 0);
this.smNukeActivationMinTime = ConfigFile.GetInt("nuke_min_time", 0);
if (!TutorialManager.status)
{
this.lever = GameObject.Find("Lever_Alpha_Controller").GetComponent<LeverButton>();
this.lights = UnityEngine.Object.FindObjectsOfType<ToggleableLight>();
}
}

// Token: 0x060001C1 RID: 449
private void SetLights(bool b)
{
ToggleableLight[] array = this.lights;
Expand All @@ -187,14 +178,10 @@ private void SetLights(bool b)
}
}

// Token: 0x060001C2 RID: 450
private void UNetVersion()
{
}

// Token: 0x17000029 RID: 41
// (get) Token: 0x060001C3 RID: 451
// (set) Token: 0x060001C4 RID: 452
public float NetworkdetonationTime
{
get
Expand All @@ -207,7 +194,6 @@ public float NetworkdetonationTime
}
}

// Token: 0x060001C5 RID: 453
public override bool OnSerialize(NetworkWriter writer, bool forceAll)
{
if (forceAll)
Expand All @@ -232,7 +218,6 @@ public override bool OnSerialize(NetworkWriter writer, bool forceAll)
return flag;
}

// Token: 0x060001C6 RID: 454
public override void OnDeserialize(NetworkReader reader, bool initialState)
{
if (initialState)
Expand All @@ -246,43 +231,34 @@ public override void OnDeserialize(NetworkReader reader, bool initialState)
}
}

// Token: 0x040001F1 RID: 497
[SyncVar]
public float detonationTime;

// Token: 0x040001F2 RID: 498
private bool detonationInProgress;

// Token: 0x040001F3 RID: 499
private bool detonated;

// Token: 0x040001F4 RID: 500
private bool doorsOpen;

// Token: 0x040001F5 RID: 501
private bool blastDoors;

// Token: 0x040001F6 RID: 502
private GameObject host;

// Token: 0x040001F7 RID: 503
private bool lightStatus;

// Token: 0x040001F8 RID: 504
private AWSoundController awsc;

// Token: 0x040001F9 RID: 505
private LeverButton lever;

// Token: 0x040001FA RID: 506
private AlphaWarheadDetonationController awdc;

// Token: 0x040001FB RID: 507
private ToggleableLight[] lights;

// Token: 0x04000BF4 RID: 3060
private float smStartTime;

// Token: 0x04000BF5 RID: 3061
private int smCooldown;

private int smNukeActivationMinTime;

private CharacterClassManager smCharacterClassManager;
}
Loading

0 comments on commit 2f788be

Please sign in to comment.