Browse Source

refactor: 💩 Temporarily removed the 'place' property to accommodate the needs of the new version.

Temporarily removed the 'place' property to accommodate the needs of the new version.
tags/v0.1.0
Shawqeem 2 years ago
parent
commit
c7175b3021
3 changed files with 75 additions and 71 deletions
  1. +70
    -70
      logic/Client/MainWindow.xaml.cs
  2. +1
    -1
      logic/cmd/PlaybackServer.cmd
  3. +4
    -0
      logic/cmd/video.cmd

+ 70
- 70
logic/Client/MainWindow.xaml.cs View File

@@ -572,96 +572,96 @@ namespace Client


private bool CanSee(MessageOfStudent msg) private bool CanSee(MessageOfStudent msg)
{ {
if (msg.PlayerState == PlayerState.Quit || msg.PlayerState == PlayerState.Graduated)
return false;
if (isSpectatorMode || isPlaybackMode)
return true;
if (humanOrButcher && human != null)
{
if (msg.Place == human.Place)
return true;
if (msg.PlayerId == playerID + Preparation.Utility.GameData.numOfPeople)//robot and its owner
return true;
}
else if (!humanOrButcher && butcher != null)
{
if (msg.Place == butcher.Place)
return true;
}
if (msg.Place == Protobuf.PlaceType.Grass)
return false;
//if (msg.PlayerState == PlayerState.Quit || msg.PlayerState == PlayerState.Graduated)
// return false;
//if (isSpectatorMode || isPlaybackMode)
// return true;
//if (humanOrButcher && human != null)
//{
// if (msg.Place == human.Place)
// return true;
// if (msg.PlayerId == playerID + Preparation.Utility.GameData.numOfPeople)//robot and its owner
// return true;
//}
//else if (!humanOrButcher && butcher != null)
//{
// if (msg.Place == butcher.Place)
// return true;
//}
//if (msg.Place == Protobuf.PlaceType.Grass)
// return false;
return true; return true;
} }


private bool CanSee(MessageOfTricker msg) private bool CanSee(MessageOfTricker msg)
{ {
if (isSpectatorMode || isPlaybackMode)
return true;
if (!humanOrButcher && butcher != null)
{
if (butcher.Guid == msg.Guid) // 自己能看见自己
return true;
}
if (humanOrButcher && human != null)
{
if (msg.TrickerType == Protobuf.TrickerType.Assassin)
{
foreach (var buff in msg.Buff)
{
if (buff == Protobuf.TrickerBuffType.TrickerInvisible)
return false;
}
}
if (msg.Place == human.Place)
return true;
}
if (msg.Place == Protobuf.PlaceType.Grass)
return false;
//if (isSpectatorMode || isPlaybackMode)
// return true;
//if (!humanOrButcher && butcher != null)
//{
// if (butcher.Guid == msg.Guid) // 自己能看见自己
// return true;
//}
//if (humanOrButcher && human != null)
//{
// if (msg.TrickerType == Protobuf.TrickerType.Assassin)
// {
// foreach (var buff in msg.Buff)
// {
// if (buff == Protobuf.TrickerBuffType.TrickerInvisible)
// return false;
// }
// }
// if (msg.Place == human.Place)
// return true;
//}
//if (msg.Place == Protobuf.PlaceType.Grass)
// return false;
return true; return true;
} }


private bool CanSee(MessageOfProp msg) private bool CanSee(MessageOfProp msg)
{ {
if (isSpectatorMode || isPlaybackMode)
return true;
if (humanOrButcher && human != null)
{
if (msg.Place == human.Place)
return true;
}
else if (!humanOrButcher && butcher != null)
{
if (msg.Place == butcher.Place)
return true;
}
if (msg.Place == Protobuf.PlaceType.Grass)
return false;
//if (isSpectatorMode || isPlaybackMode)
// return true;
//if (humanOrButcher && human != null)
//{
// if (msg.Place == human.Place)
// return true;
//}
//else if (!humanOrButcher && butcher != null)
//{
// if (msg.Place == butcher.Place)
// return true;
//}
//if (msg.Place == Protobuf.PlaceType.Grass)
// return false;
return true; return true;
} }


private bool CanSee(MessageOfBullet msg) private bool CanSee(MessageOfBullet msg)
{ {
if (isSpectatorMode || isPlaybackMode)
return true;
if (humanOrButcher && human != null)
{
if (msg.Place == human.Place)
return true;
}
else if (!humanOrButcher && butcher != null)
{
if (msg.Place == butcher.Place)
return true;
}
if (msg.Place == Protobuf.PlaceType.Grass)
return false;
//if (isSpectatorMode || isPlaybackMode)
// return true;
//if (humanOrButcher && human != null)
//{
// if (msg.Place == human.Place)
// return true;
//}
//else if (!humanOrButcher && butcher != null)
//{
// if (msg.Place == butcher.Place)
// return true;
//}
//if (msg.Place == Protobuf.PlaceType.Grass)
// return false;
return true; return true;
} }


private bool CanSee(MessageOfBombedBullet msg) private bool CanSee(MessageOfBombedBullet msg)
{ {
if (isSpectatorMode || isPlaybackMode)
return true;
//if (isSpectatorMode || isPlaybackMode)
// return true;
//if (humanOrButcher && human != null) //if (humanOrButcher && human != null)
//{ //{
// if (msg.Place == human.Place) // if (msg.Place == human.Place)


+ 1
- 1
logic/cmd/PlaybackServer.cmd View File

@@ -1,2 +1,2 @@
@echo off @echo off
start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --port 8888 --fileName .\ladder1.thuaipb --playback --playbackSpeed 4.0
start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --port 8888 --fileName .\cannot.thuaipb --playback --playbackSpeed 2.0

+ 4
- 0
logic/cmd/video.cmd View File

@@ -0,0 +1,4 @@
@echo off


start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --ip thuai6.eesast.com --port 8889 --characterID 2030

Loading…
Cancel
Save